1 #ifndef FIO_THREAD_OPTIONS_H
2 #define FIO_THREAD_OPTIONS_H
9 #include "lib/ieee754.h"
13 * What type of allocation to use for io buffers
16 MEM_MALLOC = 0, /* ordinary malloc */
17 MEM_SHM, /* use shared memory segments */
18 MEM_SHMHUGE, /* use shared memory segments with huge pages */
19 MEM_MMAP, /* use anonynomous mmap */
20 MEM_MMAPHUGE, /* memory mapped huge file */
23 #define ERROR_STR_MAX 128
25 #define BSSPLIT_MAX 64
32 #define NR_OPTS_SZ (FIO_MAX_OPTS / (8 * sizeof(uint64_t)))
34 #define OPT_MAGIC 0x4f50544e
36 struct thread_options {
38 uint64_t set_options[NR_OPTS_SZ];
43 char *filename_format;
50 unsigned int unit_base;
51 unsigned int ddir_seq_nr;
52 long long ddir_seq_add;
54 unsigned int iodepth_low;
55 unsigned int iodepth_batch;
56 unsigned int iodepth_batch_complete;
58 unsigned long long size;
59 unsigned long long io_limit;
60 unsigned int size_percent;
61 unsigned int fill_device;
62 unsigned int file_append;
63 unsigned long long file_size_low;
64 unsigned long long file_size_high;
65 unsigned long long start_offset;
67 unsigned int bs[DDIR_RWDIR_CNT];
68 unsigned int ba[DDIR_RWDIR_CNT];
69 unsigned int min_bs[DDIR_RWDIR_CNT];
70 unsigned int max_bs[DDIR_RWDIR_CNT];
71 struct bssplit *bssplit[DDIR_RWDIR_CNT];
72 unsigned int bssplit_nr[DDIR_RWDIR_CNT];
74 int *ignore_error[ERROR_TYPE_CNT];
75 unsigned int ignore_error_nr[ERROR_TYPE_CNT];
76 unsigned int error_dump;
78 unsigned int nr_files;
79 unsigned int open_files;
80 enum file_lock_mode file_lock_mode;
84 unsigned int invalidate_cache;
85 unsigned int create_serialize;
86 unsigned int create_fsync;
87 unsigned int create_on_open;
88 unsigned int create_only;
89 unsigned int end_fsync;
90 unsigned int pre_read;
93 unsigned int do_verify;
94 unsigned int verifysort;
95 unsigned int verifysort_nr;
96 unsigned int verify_interval;
97 unsigned int verify_offset;
98 char verify_pattern[MAX_PATTERN_SIZE];
99 unsigned int verify_pattern_bytes;
100 unsigned int verify_fatal;
101 unsigned int verify_dump;
102 unsigned int verify_async;
103 unsigned long long verify_backlog;
104 unsigned int verify_batch;
105 unsigned int experimental_verify;
106 unsigned int verify_state;
107 unsigned int verify_state_save;
108 unsigned int use_thread;
110 unsigned int do_disk_util;
111 unsigned int override_sync;
112 unsigned int rand_repeatable;
113 unsigned int allrand_repeatable;
114 unsigned long long rand_seed;
115 unsigned int dep_use_os_rand;
116 unsigned int log_avg_msec;
117 unsigned int log_offset;
119 unsigned int log_gz_store;
120 unsigned int norandommap;
121 unsigned int softrandommap;
122 unsigned int bs_unaligned;
123 unsigned int fsync_on_close;
124 unsigned int bs_is_seq_rand;
126 unsigned int verify_only;
128 unsigned int random_distribution;
130 fio_fp64_t zipf_theta;
133 unsigned int random_generator;
135 unsigned int perc_rand[DDIR_RWDIR_CNT];
137 unsigned int hugepage_size;
138 unsigned int rw_min_bs;
139 unsigned int thinktime;
140 unsigned int thinktime_spin;
141 unsigned int thinktime_blocks;
142 unsigned int fsync_blocks;
143 unsigned int fdatasync_blocks;
144 unsigned int barrier_blocks;
145 unsigned long long start_delay;
146 unsigned long long start_delay_high;
147 unsigned long long timeout;
148 unsigned long long ramp_time;
149 unsigned int overwrite;
150 unsigned int bw_avg_time;
151 unsigned int iops_avg_time;
153 unsigned long long zone_range;
154 unsigned long long zone_size;
155 unsigned long long zone_skip;
156 unsigned long long lockmem;
157 enum fio_memtype mem_type;
158 unsigned int mem_align;
160 unsigned int max_latency;
162 unsigned int stonewall;
163 unsigned int new_group;
164 unsigned int numjobs;
165 os_cpu_mask_t cpumask;
166 unsigned int cpumask_set;
167 os_cpu_mask_t verify_cpumask;
168 unsigned int verify_cpumask_set;
169 unsigned int cpus_allowed_policy;
171 unsigned int numa_cpumask_set;
172 unsigned short numa_mem_mode;
173 unsigned int numa_mem_prefer_node;
175 unsigned int numa_memmask_set;
177 unsigned int rwmixcycle;
178 unsigned int rwmix[DDIR_RWDIR_CNT];
181 unsigned int ioprio_class;
182 unsigned int file_service_type;
183 unsigned int group_reporting;
184 unsigned int fadvise_hint;
185 enum fio_fallocate_mode fallocate_mode;
186 unsigned int zero_buffers;
187 unsigned int refill_buffers;
188 unsigned int scramble_buffers;
189 char buffer_pattern[MAX_PATTERN_SIZE];
190 unsigned int buffer_pattern_bytes;
191 unsigned int compress_percentage;
192 unsigned int compress_chunk;
193 unsigned int dedupe_percentage;
194 unsigned int time_based;
195 unsigned int disable_lat;
196 unsigned int disable_clat;
197 unsigned int disable_slat;
198 unsigned int disable_bw;
199 unsigned int unified_rw_rep;
200 unsigned int gtod_reduce;
201 unsigned int gtod_cpu;
202 unsigned int gtod_offload;
203 enum fio_cs clocksource;
204 unsigned int no_stall;
205 unsigned int trim_percentage;
206 unsigned int trim_batch;
207 unsigned int trim_zero;
208 unsigned long long trim_backlog;
209 unsigned int clat_percentiles;
210 unsigned int percentile_precision; /* digits after decimal for percentiles */
211 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
213 char *read_iolog_file;
214 char *write_iolog_file;
218 char *replay_redirect;
221 * Pre-run and post-run shell
226 unsigned int rate[DDIR_RWDIR_CNT];
227 unsigned int ratemin[DDIR_RWDIR_CNT];
228 unsigned int ratecycle;
229 unsigned int rate_iops[DDIR_RWDIR_CNT];
230 unsigned int rate_iops_min[DDIR_RWDIR_CNT];
237 enum error_type continue_on_error;
240 * Benchmark profile type
245 * blkio cgroup support
248 unsigned int cgroup_weight;
249 unsigned int cgroup_nodelete;
257 unsigned int flow_sleep;
259 unsigned long long offset_increment;
260 unsigned long long number_ios;
262 unsigned int sync_file_range;
264 unsigned long long latency_target;
265 unsigned long long latency_window;
266 fio_fp64_t latency_percentile;
269 #define FIO_TOP_STR_MAX 256
271 struct thread_options_pack {
272 uint64_t set_options[NR_OPTS_SZ];
273 uint8_t description[FIO_TOP_STR_MAX];
274 uint8_t name[FIO_TOP_STR_MAX];
275 uint8_t directory[FIO_TOP_STR_MAX];
276 uint8_t filename[FIO_TOP_STR_MAX];
277 uint8_t filename_format[FIO_TOP_STR_MAX];
278 uint8_t opendir[FIO_TOP_STR_MAX];
279 uint8_t ioengine[FIO_TOP_STR_MAX];
280 uint8_t mmapfile[FIO_TOP_STR_MAX];
285 uint32_t ddir_seq_nr;
286 uint64_t ddir_seq_add;
288 uint32_t iodepth_low;
289 uint32_t iodepth_batch;
290 uint32_t iodepth_batch_complete;
294 uint32_t size_percent;
295 uint32_t fill_device;
296 uint32_t file_append;
297 uint64_t file_size_low;
298 uint64_t file_size_high;
299 uint64_t start_offset;
301 uint32_t bs[DDIR_RWDIR_CNT];
302 uint32_t ba[DDIR_RWDIR_CNT];
303 uint32_t min_bs[DDIR_RWDIR_CNT];
304 uint32_t max_bs[DDIR_RWDIR_CNT];
305 struct bssplit bssplit[DDIR_RWDIR_CNT][BSSPLIT_MAX];
306 uint32_t bssplit_nr[DDIR_RWDIR_CNT];
308 uint32_t ignore_error[ERROR_TYPE_CNT][ERROR_STR_MAX];
309 uint32_t ignore_error_nr[ERROR_TYPE_CNT];
314 uint32_t file_lock_mode;
318 uint32_t invalidate_cache;
319 uint32_t create_serialize;
320 uint32_t create_fsync;
321 uint32_t create_on_open;
322 uint32_t create_only;
329 uint32_t verifysort_nr;
330 uint32_t verify_interval;
331 uint32_t verify_offset;
332 uint8_t verify_pattern[MAX_PATTERN_SIZE];
333 uint32_t verify_pattern_bytes;
334 uint32_t verify_fatal;
335 uint32_t verify_dump;
336 uint32_t verify_async;
337 uint64_t verify_backlog;
338 uint32_t verify_batch;
339 uint32_t experimental_verify;
340 uint32_t verify_state;
341 uint32_t verify_state_save;
345 uint32_t do_disk_util;
346 uint32_t override_sync;
347 uint32_t rand_repeatable;
348 uint32_t allrand_repeatable;
350 uint32_t dep_use_os_rand;
351 uint32_t log_avg_msec;
354 uint32_t log_gz_store;
355 uint32_t norandommap;
356 uint32_t softrandommap;
357 uint32_t bs_unaligned;
358 uint32_t fsync_on_close;
359 uint32_t bs_is_seq_rand;
361 uint32_t random_distribution;
362 fio_fp64_t zipf_theta;
365 uint32_t random_generator;
367 uint32_t perc_rand[DDIR_RWDIR_CNT];
369 uint32_t hugepage_size;
372 uint32_t thinktime_spin;
373 uint32_t thinktime_blocks;
374 uint32_t fsync_blocks;
375 uint32_t fdatasync_blocks;
376 uint32_t barrier_blocks;
377 uint64_t start_delay;
378 uint64_t start_delay_high;
382 uint32_t bw_avg_time;
383 uint32_t iops_avg_time;
392 uint32_t max_latency;
397 uint8_t cpumask[FIO_TOP_STR_MAX];
398 uint32_t cpumask_set;
399 uint8_t verify_cpumask[FIO_TOP_STR_MAX];
400 uint32_t verify_cpumask_set;
401 uint32_t cpus_allowed_policy;
404 uint32_t rwmix[DDIR_RWDIR_CNT];
407 uint32_t ioprio_class;
408 uint32_t file_service_type;
409 uint32_t group_reporting;
410 uint32_t fadvise_hint;
411 uint32_t fallocate_mode;
412 uint32_t zero_buffers;
413 uint32_t refill_buffers;
414 uint32_t scramble_buffers;
415 uint8_t buffer_pattern[MAX_PATTERN_SIZE];
416 uint32_t buffer_pattern_bytes;
417 uint32_t compress_percentage;
418 uint32_t compress_chunk;
419 uint32_t dedupe_percentage;
421 uint32_t disable_lat;
422 uint32_t disable_clat;
423 uint32_t disable_slat;
425 uint32_t unified_rw_rep;
426 uint32_t gtod_reduce;
428 uint32_t gtod_offload;
429 uint32_t clocksource;
431 uint32_t trim_percentage;
434 uint64_t trim_backlog;
435 uint32_t clat_percentiles;
436 uint32_t percentile_precision;
437 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
439 uint8_t read_iolog_file[FIO_TOP_STR_MAX];
440 uint8_t write_iolog_file[FIO_TOP_STR_MAX];
441 uint8_t bw_log_file[FIO_TOP_STR_MAX];
442 uint8_t lat_log_file[FIO_TOP_STR_MAX];
443 uint8_t iops_log_file[FIO_TOP_STR_MAX];
444 uint8_t replay_redirect[FIO_TOP_STR_MAX];
447 * Pre-run and post-run shell
449 uint8_t exec_prerun[FIO_TOP_STR_MAX];
450 uint8_t exec_postrun[FIO_TOP_STR_MAX];
452 uint32_t rate[DDIR_RWDIR_CNT];
453 uint32_t ratemin[DDIR_RWDIR_CNT];
455 uint32_t rate_iops[DDIR_RWDIR_CNT];
456 uint32_t rate_iops_min[DDIR_RWDIR_CNT];
458 uint8_t ioscheduler[FIO_TOP_STR_MAX];
463 uint32_t continue_on_error;
466 * Benchmark profile type
468 uint8_t profile[FIO_TOP_STR_MAX];
471 * blkio cgroup support
473 uint8_t cgroup[FIO_TOP_STR_MAX];
474 uint32_t cgroup_weight;
475 uint32_t cgroup_nodelete;
482 int32_t flow_watermark;
485 uint64_t offset_increment;
488 uint32_t sync_file_range;
491 uint64_t latency_target;
492 uint64_t latency_window;
493 fio_fp64_t latency_percentile;
494 } __attribute__((packed));
496 extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
497 extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
498 extern int fio_test_cconv(struct thread_options *);
499 extern void options_default_fill(struct thread_options *o);