options: move ioprio/ioprio_class into thread_options space
[fio.git] / thread_options.h
CommitLineData
ec41265e
JA
1#ifndef FIO_THREAD_OPTIONS_H
2#define FIO_THREAD_OPTIONS_H
3
4#include "arch/arch.h"
5#include "os/os.h"
6#include "stat.h"
7#include "gettime.h"
8
9/*
10 * What type of allocation to use for io buffers
11 */
12enum fio_memtype {
13 MEM_MALLOC = 0, /* ordinary malloc */
14 MEM_SHM, /* use shared memory segments */
15 MEM_SHMHUGE, /* use shared memory segments with huge pages */
16 MEM_MMAP, /* use anonynomous mmap */
17 MEM_MMAPHUGE, /* memory mapped huge file */
18};
19
20/*
21 * What type of errors to continue on when continue_on_error is used
22 */
23enum error_type {
24 ERROR_TYPE_NONE = 0,
25 ERROR_TYPE_READ = 1 << 0,
26 ERROR_TYPE_WRITE = 1 << 1,
27 ERROR_TYPE_VERIFY = 1 << 2,
28 ERROR_TYPE_ANY = 0xffff,
29};
30
2dc1cbb5
JA
31#define BSSPLIT_MAX 64
32
ec41265e 33struct bssplit {
2dc1cbb5
JA
34 uint32_t bs;
35 uint32_t perc;
ec41265e
JA
36};
37
38struct thread_options {
39 int pad;
40 char *description;
41 char *name;
42 char *directory;
43 char *filename;
44 char *opendir;
45 char *ioengine;
83ea422a 46 char *mmapfile;
ec41265e
JA
47 enum td_ddir td_ddir;
48 unsigned int rw_seq;
49 unsigned int kb_base;
50 unsigned int ddir_seq_nr;
51 long ddir_seq_add;
52 unsigned int iodepth;
53 unsigned int iodepth_low;
54 unsigned int iodepth_batch;
55 unsigned int iodepth_batch_complete;
56
57 unsigned long long size;
58 unsigned int size_percent;
59 unsigned int fill_device;
60 unsigned long long file_size_low;
61 unsigned long long file_size_high;
62 unsigned long long start_offset;
63
64 unsigned int bs[2];
65 unsigned int ba[2];
66 unsigned int min_bs[2];
67 unsigned int max_bs[2];
68 struct bssplit *bssplit[2];
69 unsigned int bssplit_nr[2];
70
71 unsigned int nr_files;
72 unsigned int open_files;
73 enum file_lock_mode file_lock_mode;
74 unsigned int lockfile_batch;
75
76 unsigned int odirect;
77 unsigned int invalidate_cache;
78 unsigned int create_serialize;
79 unsigned int create_fsync;
80 unsigned int create_on_open;
81 unsigned int end_fsync;
82 unsigned int pre_read;
83 unsigned int sync_io;
84 unsigned int verify;
85 unsigned int do_verify;
86 unsigned int verifysort;
87 unsigned int verify_interval;
88 unsigned int verify_offset;
89 char verify_pattern[MAX_PATTERN_SIZE];
90 unsigned int verify_pattern_bytes;
91 unsigned int verify_fatal;
92 unsigned int verify_dump;
93 unsigned int verify_async;
94 unsigned long long verify_backlog;
95 unsigned int verify_batch;
96 unsigned int use_thread;
97 unsigned int unlink;
98 unsigned int do_disk_util;
99 unsigned int override_sync;
100 unsigned int rand_repeatable;
101 unsigned int use_os_rand;
102 unsigned int write_lat_log;
103 unsigned int write_bw_log;
104 unsigned int write_iops_log;
105 unsigned int log_avg_msec;
106 unsigned int norandommap;
107 unsigned int softrandommap;
108 unsigned int bs_unaligned;
109 unsigned int fsync_on_close;
110
111 unsigned int hugepage_size;
112 unsigned int rw_min_bs;
113 unsigned int thinktime;
114 unsigned int thinktime_spin;
115 unsigned int thinktime_blocks;
116 unsigned int fsync_blocks;
117 unsigned int fdatasync_blocks;
118 unsigned int barrier_blocks;
119 unsigned long long start_delay;
120 unsigned long long timeout;
121 unsigned long long ramp_time;
122 unsigned int overwrite;
123 unsigned int bw_avg_time;
124 unsigned int iops_avg_time;
125 unsigned int loops;
126 unsigned long long zone_range;
127 unsigned long long zone_size;
128 unsigned long long zone_skip;
1b79a070 129 unsigned long long lockmem;
ec41265e
JA
130 enum fio_memtype mem_type;
131 unsigned int mem_align;
132
133 unsigned int stonewall;
134 unsigned int new_group;
135 unsigned int numjobs;
136 os_cpu_mask_t cpumask;
137 unsigned int cpumask_set;
138 os_cpu_mask_t verify_cpumask;
139 unsigned int verify_cpumask_set;
140 unsigned int iolog;
141 unsigned int rwmixcycle;
142 unsigned int rwmix[2];
143 unsigned int nice;
28727df7
JA
144 unsigned int ioprio;
145 unsigned int ioprio_class;
ec41265e
JA
146 unsigned int file_service_type;
147 unsigned int group_reporting;
148 unsigned int fadvise_hint;
149 enum fio_fallocate_mode fallocate_mode;
150 unsigned int zero_buffers;
151 unsigned int refill_buffers;
152 unsigned int scramble_buffers;
e476994e
JA
153 unsigned int compress_percentage;
154 unsigned int compress_chunk;
ec41265e
JA
155 unsigned int time_based;
156 unsigned int disable_lat;
157 unsigned int disable_clat;
158 unsigned int disable_slat;
159 unsigned int disable_bw;
160 unsigned int gtod_reduce;
161 unsigned int gtod_cpu;
162 unsigned int gtod_offload;
163 enum fio_cs clocksource;
164 unsigned int no_stall;
165 unsigned int trim_percentage;
166 unsigned int trim_batch;
167 unsigned int trim_zero;
168 unsigned long long trim_backlog;
169 unsigned int clat_percentiles;
170 unsigned int overwrite_plist;
171 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
172
173 char *read_iolog_file;
174 char *write_iolog_file;
175 char *bw_log_file;
176 char *lat_log_file;
177 char *iops_log_file;
178 char *replay_redirect;
179
180 /*
181 * Pre-run and post-run shell
182 */
183 char *exec_prerun;
184 char *exec_postrun;
185
186 unsigned int rate[2];
187 unsigned int ratemin[2];
188 unsigned int ratecycle;
189 unsigned int rate_iops[2];
190 unsigned int rate_iops_min[2];
191
192 char *ioscheduler;
193
ec41265e
JA
194 /*
195 * I/O Error handling
196 */
197 enum error_type continue_on_error;
198
199 /*
200 * Benchmark profile type
201 */
202 char *profile;
203
204 /*
205 * blkio cgroup support
206 */
207 char *cgroup;
208 unsigned int cgroup_weight;
209 unsigned int cgroup_nodelete;
210
211 unsigned int uid;
212 unsigned int gid;
213
214 int flow_id;
215 int flow;
216 int flow_watermark;
217 unsigned int flow_sleep;
218
6a4cf74f
JA
219 unsigned long long offset_increment;
220
ec41265e
JA
221 unsigned int sync_file_range;
222};
223
2dc1cbb5
JA
224#define FIO_TOP_STR_MAX 256
225
226struct thread_options_pack {
227 uint8_t description[FIO_TOP_STR_MAX];
228 uint8_t name[FIO_TOP_STR_MAX];
229 uint8_t directory[FIO_TOP_STR_MAX];
230 uint8_t filename[FIO_TOP_STR_MAX];
231 uint8_t opendir[FIO_TOP_STR_MAX];
232 uint8_t ioengine[FIO_TOP_STR_MAX];
83ea422a 233 uint8_t mmapfile[FIO_TOP_STR_MAX];
2dc1cbb5
JA
234 uint32_t td_ddir;
235 uint32_t rw_seq;
236 uint32_t kb_base;
237 uint32_t ddir_seq_nr;
238 uint64_t ddir_seq_add;
239 uint32_t iodepth;
240 uint32_t iodepth_low;
241 uint32_t iodepth_batch;
242 uint32_t iodepth_batch_complete;
243
244 uint64_t size;
245 uint32_t size_percent;
246 uint32_t fill_device;
247 uint64_t file_size_low;
248 uint64_t file_size_high;
249 uint64_t start_offset;
250
251 uint32_t bs[2];
252 uint32_t ba[2];
253 uint32_t min_bs[2];
254 uint32_t max_bs[2];
255 struct bssplit bssplit[2][BSSPLIT_MAX];
256 uint32_t bssplit_nr[2];
257
258 uint32_t nr_files;
259 uint32_t open_files;
260 uint32_t file_lock_mode;
261 uint32_t lockfile_batch;
262
263 uint32_t odirect;
264 uint32_t invalidate_cache;
265 uint32_t create_serialize;
266 uint32_t create_fsync;
267 uint32_t create_on_open;
268 uint32_t end_fsync;
269 uint32_t pre_read;
270 uint32_t sync_io;
271 uint32_t verify;
272 uint32_t do_verify;
273 uint32_t verifysort;
274 uint32_t verify_interval;
275 uint32_t verify_offset;
276 uint8_t verify_pattern[MAX_PATTERN_SIZE];
277 uint32_t verify_pattern_bytes;
278 uint32_t verify_fatal;
279 uint32_t verify_dump;
280 uint32_t verify_async;
281 uint64_t verify_backlog;
282 uint32_t verify_batch;
283 uint32_t use_thread;
284 uint32_t unlink;
285 uint32_t do_disk_util;
286 uint32_t override_sync;
287 uint32_t rand_repeatable;
288 uint32_t use_os_rand;
289 uint32_t write_lat_log;
290 uint32_t write_bw_log;
291 uint32_t write_iops_log;
292 uint32_t log_avg_msec;
293 uint32_t norandommap;
294 uint32_t softrandommap;
295 uint32_t bs_unaligned;
296 uint32_t fsync_on_close;
297
298 uint32_t hugepage_size;
299 uint32_t rw_min_bs;
300 uint32_t thinktime;
301 uint32_t thinktime_spin;
302 uint32_t thinktime_blocks;
303 uint32_t fsync_blocks;
304 uint32_t fdatasync_blocks;
305 uint32_t barrier_blocks;
306 uint64_t start_delay;
307 uint64_t timeout;
308 uint64_t ramp_time;
309 uint32_t overwrite;
310 uint32_t bw_avg_time;
311 uint32_t iops_avg_time;
312 uint32_t loops;
313 uint64_t zone_range;
314 uint64_t zone_size;
315 uint64_t zone_skip;
ae278f9a 316 uint64_t lockmem;
2dc1cbb5
JA
317 uint32_t mem_type;
318 uint32_t mem_align;
319
320 uint32_t stonewall;
321 uint32_t new_group;
322 uint32_t numjobs;
323 uint8_t cpumask[FIO_TOP_STR_MAX];
324 uint32_t cpumask_set;
325 uint8_t verify_cpumask[FIO_TOP_STR_MAX];
326 uint32_t verify_cpumask_set;
327 uint32_t iolog;
328 uint32_t rwmixcycle;
329 uint32_t rwmix[2];
330 uint32_t nice;
28727df7
JA
331 uint32_t ioprio;
332 uint32_t ioprio_class;
2dc1cbb5
JA
333 uint32_t file_service_type;
334 uint32_t group_reporting;
335 uint32_t fadvise_hint;
336 uint32_t fallocate_mode;
337 uint32_t zero_buffers;
338 uint32_t refill_buffers;
339 uint32_t scramble_buffers;
e476994e
JA
340 unsigned int compress_percentage;
341 unsigned int compress_chunk;
2dc1cbb5
JA
342 uint32_t time_based;
343 uint32_t disable_lat;
344 uint32_t disable_clat;
345 uint32_t disable_slat;
346 uint32_t disable_bw;
347 uint32_t gtod_reduce;
348 uint32_t gtod_cpu;
349 uint32_t gtod_offload;
350 uint32_t clocksource;
351 uint32_t no_stall;
352 uint32_t trim_percentage;
353 uint32_t trim_batch;
354 uint32_t trim_zero;
355 uint64_t trim_backlog;
356 uint32_t clat_percentiles;
357 uint32_t overwrite_plist;
358 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
359
360 uint8_t read_iolog_file[FIO_TOP_STR_MAX];
361 uint8_t write_iolog_file[FIO_TOP_STR_MAX];
362 uint8_t bw_log_file[FIO_TOP_STR_MAX];
363 uint8_t lat_log_file[FIO_TOP_STR_MAX];
364 uint8_t iops_log_file[FIO_TOP_STR_MAX];
365 uint8_t replay_redirect[FIO_TOP_STR_MAX];
366
367 /*
368 * Pre-run and post-run shell
369 */
370 uint8_t exec_prerun[FIO_TOP_STR_MAX];
371 uint8_t exec_postrun[FIO_TOP_STR_MAX];
372
373 uint32_t rate[2];
374 uint32_t ratemin[2];
375 uint32_t ratecycle;
376 uint32_t rate_iops[2];
377 uint32_t rate_iops_min[2];
378
379 uint8_t ioscheduler[FIO_TOP_STR_MAX];
380
2dc1cbb5
JA
381 /*
382 * I/O Error handling
383 */
384 uint32_t continue_on_error;
385
386 /*
387 * Benchmark profile type
388 */
389 uint8_t profile[FIO_TOP_STR_MAX];
390
391 /*
392 * blkio cgroup support
393 */
394 uint8_t cgroup[FIO_TOP_STR_MAX];
395 uint32_t cgroup_weight;
396 uint32_t cgroup_nodelete;
397
398 uint32_t uid;
399 uint32_t gid;
400
401 int32_t flow_id;
402 int32_t flow;
403 int32_t flow_watermark;
404 uint32_t flow_sleep;
405
6a4cf74f
JA
406 uint64_t offset_increment;
407
2dc1cbb5
JA
408 uint32_t sync_file_range;
409} __attribute__((packed));
410
411extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
412extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
51167799 413extern int fio_test_cconv(struct thread_options *);
588b7f09 414extern void options_default_fill(struct thread_options *o);
2dc1cbb5 415
ec41265e 416#endif