1 #ifndef FIO_THREAD_OPTIONS_H
2 #define FIO_THREAD_OPTIONS_H
9 #include "lib/ieee754.h"
10 #include "lib/pattern.h"
14 * What type of allocation to use for io buffers
17 MEM_MALLOC = 0, /* ordinary malloc */
18 MEM_SHM, /* use shared memory segments */
19 MEM_SHMHUGE, /* use shared memory segments with huge pages */
20 MEM_MMAP, /* use anonynomous mmap */
21 MEM_MMAPHUGE, /* memory mapped huge file */
22 MEM_MMAPSHARED, /* use mmap with shared flag */
25 #define ERROR_STR_MAX 128
27 #define BSSPLIT_MAX 64
28 #define ZONESPLIT_MAX 64
40 #define NR_OPTS_SZ (FIO_MAX_OPTS / (8 * sizeof(uint64_t)))
42 #define OPT_MAGIC 0x4f50544e
44 struct thread_options {
46 uint64_t set_options[NR_OPTS_SZ];
52 char *filename_format;
59 unsigned int unit_base;
60 unsigned int ddir_seq_nr;
61 long long ddir_seq_add;
63 unsigned int iodepth_low;
64 unsigned int iodepth_batch;
65 unsigned int iodepth_batch_complete_min;
66 unsigned int iodepth_batch_complete_max;
68 unsigned int unique_filename;
70 unsigned long long size;
71 unsigned long long io_limit;
72 unsigned int size_percent;
73 unsigned int fill_device;
74 unsigned int file_append;
75 unsigned long long file_size_low;
76 unsigned long long file_size_high;
77 unsigned long long start_offset;
79 unsigned int bs[DDIR_RWDIR_CNT];
80 unsigned int ba[DDIR_RWDIR_CNT];
81 unsigned int min_bs[DDIR_RWDIR_CNT];
82 unsigned int max_bs[DDIR_RWDIR_CNT];
83 struct bssplit *bssplit[DDIR_RWDIR_CNT];
84 unsigned int bssplit_nr[DDIR_RWDIR_CNT];
86 int *ignore_error[ERROR_TYPE_CNT];
87 unsigned int ignore_error_nr[ERROR_TYPE_CNT];
88 unsigned int error_dump;
90 unsigned int nr_files;
91 unsigned int open_files;
92 enum file_lock_mode file_lock_mode;
96 unsigned int invalidate_cache;
97 unsigned int create_serialize;
98 unsigned int create_fsync;
99 unsigned int create_on_open;
100 unsigned int create_only;
101 unsigned int end_fsync;
102 unsigned int pre_read;
103 unsigned int sync_io;
105 unsigned int do_verify;
106 unsigned int verifysort;
107 unsigned int verifysort_nr;
108 unsigned int verify_interval;
109 unsigned int verify_offset;
110 char verify_pattern[MAX_PATTERN_SIZE];
111 unsigned int verify_pattern_bytes;
112 struct pattern_fmt verify_fmt[8];
113 unsigned int verify_fmt_sz;
114 unsigned int verify_fatal;
115 unsigned int verify_dump;
116 unsigned int verify_async;
117 unsigned long long verify_backlog;
118 unsigned int verify_batch;
119 unsigned int experimental_verify;
120 unsigned int verify_state;
121 unsigned int verify_state_save;
122 unsigned int use_thread;
124 unsigned int unlink_each_loop;
125 unsigned int do_disk_util;
126 unsigned int override_sync;
127 unsigned int rand_repeatable;
128 unsigned int allrand_repeatable;
129 unsigned long long rand_seed;
130 unsigned int dep_use_os_rand;
131 unsigned int log_avg_msec;
132 unsigned int log_hist_msec;
133 unsigned int log_hist_coarseness;
134 unsigned int log_max;
135 unsigned int log_offset;
137 unsigned int log_gz_store;
138 unsigned int norandommap;
139 unsigned int softrandommap;
140 unsigned int bs_unaligned;
141 unsigned int fsync_on_close;
142 unsigned int bs_is_seq_rand;
144 unsigned int verify_only;
146 unsigned int random_distribution;
147 unsigned int exitall_error;
149 struct zone_split *zone_split[DDIR_RWDIR_CNT];
150 unsigned int zone_split_nr[DDIR_RWDIR_CNT];
152 fio_fp64_t zipf_theta;
154 fio_fp64_t gauss_dev;
156 unsigned int random_generator;
158 unsigned int perc_rand[DDIR_RWDIR_CNT];
160 unsigned int hugepage_size;
161 unsigned int rw_min_bs;
162 unsigned int thinktime;
163 unsigned int thinktime_spin;
164 unsigned int thinktime_blocks;
165 unsigned int fsync_blocks;
166 unsigned int fdatasync_blocks;
167 unsigned int barrier_blocks;
168 unsigned long long start_delay;
169 unsigned long long start_delay_high;
170 unsigned long long timeout;
171 unsigned long long ramp_time;
175 unsigned long long ss_dur;
176 unsigned long long ss_ramp_time;
177 unsigned int overwrite;
178 unsigned int bw_avg_time;
179 unsigned int iops_avg_time;
181 unsigned long long zone_range;
182 unsigned long long zone_size;
183 unsigned long long zone_skip;
184 unsigned long long lockmem;
185 enum fio_memtype mem_type;
186 unsigned int mem_align;
188 unsigned int max_latency;
190 unsigned int stonewall;
191 unsigned int new_group;
192 unsigned int numjobs;
193 os_cpu_mask_t cpumask;
194 os_cpu_mask_t verify_cpumask;
195 os_cpu_mask_t log_gz_cpumask;
196 unsigned int cpus_allowed_policy;
198 unsigned short numa_mem_mode;
199 unsigned int numa_mem_prefer_node;
202 unsigned int rwmixcycle;
203 unsigned int rwmix[DDIR_RWDIR_CNT];
206 unsigned int ioprio_class;
207 unsigned int file_service_type;
208 unsigned int group_reporting;
209 unsigned int fadvise_hint;
210 unsigned int fadvise_stream;
211 enum fio_fallocate_mode fallocate_mode;
212 unsigned int zero_buffers;
213 unsigned int refill_buffers;
214 unsigned int scramble_buffers;
215 char buffer_pattern[MAX_PATTERN_SIZE];
216 unsigned int buffer_pattern_bytes;
217 unsigned int compress_percentage;
218 unsigned int compress_chunk;
219 unsigned int dedupe_percentage;
220 unsigned int time_based;
221 unsigned int disable_lat;
222 unsigned int disable_clat;
223 unsigned int disable_slat;
224 unsigned int disable_bw;
225 unsigned int unified_rw_rep;
226 unsigned int gtod_reduce;
227 unsigned int gtod_cpu;
228 enum fio_cs clocksource;
229 unsigned int no_stall;
230 unsigned int trim_percentage;
231 unsigned int trim_batch;
232 unsigned int trim_zero;
233 unsigned long long trim_backlog;
234 unsigned int clat_percentiles;
235 unsigned int percentile_precision; /* digits after decimal for percentiles */
236 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
238 char *read_iolog_file;
239 char *write_iolog_file;
244 char *replay_redirect;
247 * Pre-run and post-run shell
252 unsigned int rate[DDIR_RWDIR_CNT];
253 unsigned int ratemin[DDIR_RWDIR_CNT];
254 unsigned int ratecycle;
255 unsigned int io_submit_mode;
256 unsigned int rate_iops[DDIR_RWDIR_CNT];
257 unsigned int rate_iops_min[DDIR_RWDIR_CNT];
258 unsigned int rate_process;
265 enum error_type continue_on_error;
268 * Benchmark profile type
273 * blkio cgroup support
276 unsigned int cgroup_weight;
277 unsigned int cgroup_nodelete;
285 unsigned int flow_sleep;
287 unsigned long long offset_increment;
288 unsigned long long number_ios;
290 unsigned int sync_file_range;
292 unsigned long long latency_target;
293 unsigned long long latency_window;
294 fio_fp64_t latency_percentile;
296 unsigned block_error_hist;
297 unsigned int skip_bad;
299 unsigned int replay_align;
300 unsigned int replay_scale;
302 unsigned int per_job_logs;
304 unsigned int allow_create;
305 unsigned int allow_mounted_write;
308 #define FIO_TOP_STR_MAX 256
310 struct thread_options_pack {
311 uint64_t set_options[NR_OPTS_SZ];
312 uint8_t description[FIO_TOP_STR_MAX];
313 uint8_t name[FIO_TOP_STR_MAX];
314 uint8_t wait_for[FIO_TOP_STR_MAX];
315 uint8_t directory[FIO_TOP_STR_MAX];
316 uint8_t filename[FIO_TOP_STR_MAX];
317 uint8_t filename_format[FIO_TOP_STR_MAX];
318 uint8_t opendir[FIO_TOP_STR_MAX];
319 uint8_t ioengine[FIO_TOP_STR_MAX];
320 uint8_t mmapfile[FIO_TOP_STR_MAX];
325 uint32_t ddir_seq_nr;
326 uint64_t ddir_seq_add;
328 uint32_t iodepth_low;
329 uint32_t iodepth_batch;
330 uint32_t iodepth_batch_complete_min;
331 uint32_t iodepth_batch_complete_max;
332 uint32_t __proper_alignment_for_64b;
336 uint32_t size_percent;
337 uint32_t fill_device;
338 uint32_t file_append;
339 uint32_t unique_filename;
340 uint64_t file_size_low;
341 uint64_t file_size_high;
342 uint64_t start_offset;
344 uint32_t bs[DDIR_RWDIR_CNT];
345 uint32_t ba[DDIR_RWDIR_CNT];
346 uint32_t min_bs[DDIR_RWDIR_CNT];
347 uint32_t max_bs[DDIR_RWDIR_CNT];
348 struct bssplit bssplit[DDIR_RWDIR_CNT][BSSPLIT_MAX];
349 uint32_t bssplit_nr[DDIR_RWDIR_CNT];
351 uint32_t ignore_error[ERROR_TYPE_CNT][ERROR_STR_MAX];
352 uint32_t ignore_error_nr[ERROR_TYPE_CNT];
357 uint32_t file_lock_mode;
361 uint32_t invalidate_cache;
362 uint32_t create_serialize;
363 uint32_t create_fsync;
364 uint32_t create_on_open;
365 uint32_t create_only;
372 uint32_t verifysort_nr;
373 uint32_t verify_interval;
374 uint32_t verify_offset;
375 uint8_t verify_pattern[MAX_PATTERN_SIZE];
376 uint32_t verify_pattern_bytes;
377 uint32_t verify_fatal;
378 uint32_t verify_dump;
379 uint32_t verify_async;
380 uint64_t verify_backlog;
381 uint32_t verify_batch;
382 uint32_t experimental_verify;
383 uint32_t verify_state;
384 uint32_t verify_state_save;
387 uint32_t unlink_each_loop;
388 uint32_t do_disk_util;
389 uint32_t override_sync;
390 uint32_t rand_repeatable;
391 uint32_t allrand_repeatable;
393 uint32_t dep_use_os_rand;
394 uint32_t log_avg_msec;
395 uint32_t log_hist_msec;
396 uint32_t log_hist_coarseness;
400 uint32_t log_gz_store;
401 uint32_t norandommap;
402 uint32_t softrandommap;
403 uint32_t bs_unaligned;
404 uint32_t fsync_on_close;
405 uint32_t bs_is_seq_rand;
407 uint32_t random_distribution;
408 uint32_t exitall_error;
410 struct zone_split zone_split[DDIR_RWDIR_CNT][ZONESPLIT_MAX];
411 uint32_t zone_split_nr[DDIR_RWDIR_CNT];
413 fio_fp64_t zipf_theta;
415 fio_fp64_t gauss_dev;
417 uint32_t random_generator;
419 uint32_t perc_rand[DDIR_RWDIR_CNT];
421 uint32_t hugepage_size;
424 uint32_t thinktime_spin;
425 uint32_t thinktime_blocks;
426 uint32_t fsync_blocks;
427 uint32_t fdatasync_blocks;
428 uint32_t barrier_blocks;
429 uint64_t start_delay;
430 uint64_t start_delay_high;
434 uint64_t ss_ramp_time;
439 uint32_t bw_avg_time;
440 uint32_t iops_avg_time;
449 uint32_t max_latency;
455 * We currently can't convert these, so don't enable them
458 uint8_t cpumask[FIO_TOP_STR_MAX];
459 uint8_t verify_cpumask[FIO_TOP_STR_MAX];
460 uint8_t log_gz_cpumask[FIO_TOP_STR_MAX];
462 uint32_t cpus_allowed_policy;
465 uint32_t rwmix[DDIR_RWDIR_CNT];
468 uint32_t ioprio_class;
469 uint32_t file_service_type;
470 uint32_t group_reporting;
471 uint32_t fadvise_hint;
472 uint32_t fadvise_stream;
473 uint32_t fallocate_mode;
474 uint32_t zero_buffers;
475 uint32_t refill_buffers;
476 uint32_t scramble_buffers;
477 uint8_t buffer_pattern[MAX_PATTERN_SIZE];
478 uint32_t buffer_pattern_bytes;
479 uint32_t compress_percentage;
480 uint32_t compress_chunk;
481 uint32_t dedupe_percentage;
483 uint32_t disable_lat;
484 uint32_t disable_clat;
485 uint32_t disable_slat;
487 uint32_t unified_rw_rep;
488 uint32_t gtod_reduce;
490 uint32_t clocksource;
492 uint32_t trim_percentage;
495 uint64_t trim_backlog;
496 uint32_t clat_percentiles;
497 uint32_t percentile_precision;
498 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
500 uint8_t read_iolog_file[FIO_TOP_STR_MAX];
501 uint8_t write_iolog_file[FIO_TOP_STR_MAX];
502 uint8_t bw_log_file[FIO_TOP_STR_MAX];
503 uint8_t lat_log_file[FIO_TOP_STR_MAX];
504 uint8_t iops_log_file[FIO_TOP_STR_MAX];
505 uint8_t hist_log_file[FIO_TOP_STR_MAX];
506 uint8_t replay_redirect[FIO_TOP_STR_MAX];
509 * Pre-run and post-run shell
511 uint8_t exec_prerun[FIO_TOP_STR_MAX];
512 uint8_t exec_postrun[FIO_TOP_STR_MAX];
514 uint32_t rate[DDIR_RWDIR_CNT];
515 uint32_t ratemin[DDIR_RWDIR_CNT];
517 uint32_t io_submit_mode;
518 uint32_t rate_iops[DDIR_RWDIR_CNT];
519 uint32_t rate_iops_min[DDIR_RWDIR_CNT];
520 uint32_t rate_process;
522 uint8_t ioscheduler[FIO_TOP_STR_MAX];
527 uint32_t continue_on_error;
530 * Benchmark profile type
532 uint8_t profile[FIO_TOP_STR_MAX];
535 * blkio cgroup support
537 uint8_t cgroup[FIO_TOP_STR_MAX];
538 uint32_t cgroup_weight;
539 uint32_t cgroup_nodelete;
546 int32_t flow_watermark;
549 uint64_t offset_increment;
552 uint32_t sync_file_range;
555 uint64_t latency_target;
556 uint64_t latency_window;
557 fio_fp64_t latency_percentile;
559 uint32_t block_error_hist;
562 uint32_t replay_align;
563 uint32_t replay_scale;
565 uint32_t per_job_logs;
567 uint32_t allow_create;
568 uint32_t allow_mounted_write;
569 } __attribute__((packed));
571 extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
572 extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
573 extern int fio_test_cconv(struct thread_options *);
574 extern void options_default_fill(struct thread_options *o);