1 #ifndef FIO_THREAD_OPTIONS_H
2 #define FIO_THREAD_OPTIONS_H
8 #include "lib/ieee754.h"
12 * What type of allocation to use for io buffers
15 MEM_MALLOC = 0, /* ordinary malloc */
16 MEM_SHM, /* use shared memory segments */
17 MEM_SHMHUGE, /* use shared memory segments with huge pages */
18 MEM_MMAP, /* use anonynomous mmap */
19 MEM_MMAPHUGE, /* memory mapped huge file */
22 #define ERROR_STR_MAX 128
24 #define BSSPLIT_MAX 64
31 struct thread_options {
37 char *filename_format;
44 unsigned int unit_base;
45 unsigned int ddir_seq_nr;
48 unsigned int iodepth_low;
49 unsigned int iodepth_batch;
50 unsigned int iodepth_batch_complete;
52 unsigned long long size;
53 unsigned int size_percent;
54 unsigned int fill_device;
55 unsigned long long file_size_low;
56 unsigned long long file_size_high;
57 unsigned long long start_offset;
59 unsigned int bs[DDIR_RWDIR_CNT];
60 unsigned int ba[DDIR_RWDIR_CNT];
61 unsigned int min_bs[DDIR_RWDIR_CNT];
62 unsigned int max_bs[DDIR_RWDIR_CNT];
63 struct bssplit *bssplit[DDIR_RWDIR_CNT];
64 unsigned int bssplit_nr[DDIR_RWDIR_CNT];
66 int *ignore_error[ERROR_TYPE_CNT];
67 unsigned int ignore_error_nr[ERROR_TYPE_CNT];
68 unsigned int error_dump;
70 unsigned int nr_files;
71 unsigned int open_files;
72 enum file_lock_mode file_lock_mode;
76 unsigned int invalidate_cache;
77 unsigned int create_serialize;
78 unsigned int create_fsync;
79 unsigned int create_on_open;
80 unsigned int create_only;
81 unsigned int end_fsync;
82 unsigned int pre_read;
85 unsigned int do_verify;
86 unsigned int verifysort;
87 unsigned int verifysort_nr;
88 unsigned int verify_interval;
89 unsigned int verify_offset;
90 char verify_pattern[MAX_PATTERN_SIZE];
91 unsigned int verify_pattern_bytes;
92 unsigned int verify_fatal;
93 unsigned int verify_dump;
94 unsigned int verify_async;
95 unsigned long long verify_backlog;
96 unsigned int verify_batch;
97 unsigned int experimental_verify;
98 unsigned int use_thread;
100 unsigned int do_disk_util;
101 unsigned int override_sync;
102 unsigned int rand_repeatable;
103 unsigned int rand_seed;
104 unsigned int use_os_rand;
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 unsigned int bs_is_seq_rand;
112 unsigned int random_distribution;
114 fio_fp64_t zipf_theta;
117 unsigned int random_generator;
119 unsigned int perc_rand[DDIR_RWDIR_CNT];
121 unsigned int hugepage_size;
122 unsigned int rw_min_bs;
123 unsigned int thinktime;
124 unsigned int thinktime_spin;
125 unsigned int thinktime_blocks;
126 unsigned int fsync_blocks;
127 unsigned int fdatasync_blocks;
128 unsigned int barrier_blocks;
129 unsigned long long start_delay;
130 unsigned long long timeout;
131 unsigned long long ramp_time;
132 unsigned int overwrite;
133 unsigned int bw_avg_time;
134 unsigned int iops_avg_time;
136 unsigned long long zone_range;
137 unsigned long long zone_size;
138 unsigned long long zone_skip;
139 unsigned long long lockmem;
140 enum fio_memtype mem_type;
141 unsigned int mem_align;
143 unsigned int max_latency;
145 unsigned int stonewall;
146 unsigned int new_group;
147 unsigned int numjobs;
148 os_cpu_mask_t cpumask;
149 unsigned int cpumask_set;
150 os_cpu_mask_t verify_cpumask;
151 unsigned int verify_cpumask_set;
152 #ifdef CONFIG_LIBNUMA
153 struct bitmask *numa_cpunodesmask;
154 unsigned int numa_cpumask_set;
155 unsigned short numa_mem_mode;
156 unsigned int numa_mem_prefer_node;
157 struct bitmask *numa_memnodesmask;
158 unsigned int numa_memmask_set;
161 unsigned int rwmixcycle;
162 unsigned int rwmix[DDIR_RWDIR_CNT];
165 unsigned int ioprio_class;
166 unsigned int file_service_type;
167 unsigned int group_reporting;
168 unsigned int fadvise_hint;
169 enum fio_fallocate_mode fallocate_mode;
170 unsigned int zero_buffers;
171 unsigned int refill_buffers;
172 unsigned int scramble_buffers;
173 char buffer_pattern[MAX_PATTERN_SIZE];
174 unsigned int buffer_pattern_bytes;
175 unsigned int compress_percentage;
176 unsigned int compress_chunk;
177 unsigned int time_based;
178 unsigned int disable_lat;
179 unsigned int disable_clat;
180 unsigned int disable_slat;
181 unsigned int disable_bw;
182 unsigned int unified_rw_rep;
183 unsigned int gtod_reduce;
184 unsigned int gtod_cpu;
185 unsigned int gtod_offload;
186 enum fio_cs clocksource;
187 unsigned int no_stall;
188 unsigned int trim_percentage;
189 unsigned int trim_batch;
190 unsigned int trim_zero;
191 unsigned long long trim_backlog;
192 unsigned int clat_percentiles;
193 unsigned int percentile_precision; /* digits after decimal for percentiles */
194 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
196 char *read_iolog_file;
197 char *write_iolog_file;
201 char *replay_redirect;
204 * Pre-run and post-run shell
209 unsigned int rate[DDIR_RWDIR_CNT];
210 unsigned int ratemin[DDIR_RWDIR_CNT];
211 unsigned int ratecycle;
212 unsigned int rate_iops[DDIR_RWDIR_CNT];
213 unsigned int rate_iops_min[DDIR_RWDIR_CNT];
220 enum error_type continue_on_error;
223 * Benchmark profile type
228 * blkio cgroup support
231 unsigned int cgroup_weight;
232 unsigned int cgroup_nodelete;
240 unsigned int flow_sleep;
242 unsigned long long offset_increment;
243 unsigned long long number_ios;
245 unsigned int sync_file_range;
247 unsigned long long latency_target;
248 unsigned long long latency_window;
249 fio_fp64_t latency_percentile;
252 #define FIO_TOP_STR_MAX 256
254 struct thread_options_pack {
255 uint8_t description[FIO_TOP_STR_MAX];
256 uint8_t name[FIO_TOP_STR_MAX];
257 uint8_t directory[FIO_TOP_STR_MAX];
258 uint8_t filename[FIO_TOP_STR_MAX];
259 uint8_t filename_format[FIO_TOP_STR_MAX];
260 uint8_t opendir[FIO_TOP_STR_MAX];
261 uint8_t ioengine[FIO_TOP_STR_MAX];
262 uint8_t mmapfile[FIO_TOP_STR_MAX];
267 uint32_t ddir_seq_nr;
268 uint64_t ddir_seq_add;
270 uint32_t iodepth_low;
271 uint32_t iodepth_batch;
272 uint32_t iodepth_batch_complete;
275 uint32_t size_percent;
276 uint32_t fill_device;
277 uint64_t file_size_low;
278 uint64_t file_size_high;
279 uint64_t start_offset;
281 uint32_t bs[DDIR_RWDIR_CNT];
282 uint32_t ba[DDIR_RWDIR_CNT];
283 uint32_t min_bs[DDIR_RWDIR_CNT];
284 uint32_t max_bs[DDIR_RWDIR_CNT];
285 struct bssplit bssplit[DDIR_RWDIR_CNT][BSSPLIT_MAX];
286 uint32_t bssplit_nr[DDIR_RWDIR_CNT];
288 uint32_t ignore_error[ERROR_TYPE_CNT][ERROR_STR_MAX];
289 uint32_t ignore_error_nr[ERROR_TYPE_CNT];
294 uint32_t file_lock_mode;
298 uint32_t invalidate_cache;
299 uint32_t create_serialize;
300 uint32_t create_fsync;
301 uint32_t create_on_open;
302 uint32_t create_only;
309 uint32_t verifysort_nr;
310 uint32_t verify_interval;
311 uint32_t verify_offset;
312 uint8_t verify_pattern[MAX_PATTERN_SIZE];
313 uint32_t verify_pattern_bytes;
314 uint32_t verify_fatal;
315 uint32_t verify_dump;
316 uint32_t verify_async;
317 uint64_t verify_backlog;
318 uint32_t verify_batch;
319 uint32_t experimental_verify;
322 uint32_t do_disk_util;
323 uint32_t override_sync;
324 uint32_t rand_repeatable;
326 uint32_t use_os_rand;
327 uint32_t log_avg_msec;
328 uint32_t norandommap;
329 uint32_t softrandommap;
330 uint32_t bs_unaligned;
331 uint32_t fsync_on_close;
332 uint32_t bs_is_seq_rand;
334 uint32_t random_distribution;
335 fio_fp64_t zipf_theta;
338 uint32_t random_generator;
340 uint32_t perc_rand[DDIR_RWDIR_CNT];
342 uint32_t hugepage_size;
345 uint32_t thinktime_spin;
346 uint32_t thinktime_blocks;
347 uint32_t fsync_blocks;
348 uint32_t fdatasync_blocks;
349 uint32_t barrier_blocks;
350 uint64_t start_delay;
354 uint32_t bw_avg_time;
355 uint32_t iops_avg_time;
364 uint32_t max_latency;
369 uint8_t cpumask[FIO_TOP_STR_MAX];
370 uint32_t cpumask_set;
371 uint8_t verify_cpumask[FIO_TOP_STR_MAX];
372 uint32_t verify_cpumask_set;
375 uint32_t rwmix[DDIR_RWDIR_CNT];
378 uint32_t ioprio_class;
379 uint32_t file_service_type;
380 uint32_t group_reporting;
381 uint32_t fadvise_hint;
382 uint32_t fallocate_mode;
383 uint32_t zero_buffers;
384 uint32_t refill_buffers;
385 uint32_t scramble_buffers;
386 uint8_t buffer_pattern[MAX_PATTERN_SIZE];
387 uint32_t buffer_pattern_bytes;
388 unsigned int compress_percentage;
389 unsigned int compress_chunk;
391 uint32_t disable_lat;
392 uint32_t disable_clat;
393 uint32_t disable_slat;
395 uint32_t unified_rw_rep;
396 uint32_t gtod_reduce;
398 uint32_t gtod_offload;
399 uint32_t clocksource;
401 uint32_t trim_percentage;
404 uint64_t trim_backlog;
405 uint32_t clat_percentiles;
406 uint32_t percentile_precision;
407 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
409 uint8_t read_iolog_file[FIO_TOP_STR_MAX];
410 uint8_t write_iolog_file[FIO_TOP_STR_MAX];
411 uint8_t bw_log_file[FIO_TOP_STR_MAX];
412 uint8_t lat_log_file[FIO_TOP_STR_MAX];
413 uint8_t iops_log_file[FIO_TOP_STR_MAX];
414 uint8_t replay_redirect[FIO_TOP_STR_MAX];
417 * Pre-run and post-run shell
419 uint8_t exec_prerun[FIO_TOP_STR_MAX];
420 uint8_t exec_postrun[FIO_TOP_STR_MAX];
422 uint32_t rate[DDIR_RWDIR_CNT];
423 uint32_t ratemin[DDIR_RWDIR_CNT];
425 uint32_t rate_iops[DDIR_RWDIR_CNT];
426 uint32_t rate_iops_min[DDIR_RWDIR_CNT];
428 uint8_t ioscheduler[FIO_TOP_STR_MAX];
433 uint32_t continue_on_error;
436 * Benchmark profile type
438 uint8_t profile[FIO_TOP_STR_MAX];
441 * blkio cgroup support
443 uint8_t cgroup[FIO_TOP_STR_MAX];
444 uint32_t cgroup_weight;
445 uint32_t cgroup_nodelete;
452 int32_t flow_watermark;
455 uint64_t offset_increment;
458 uint32_t sync_file_range;
460 uint64_t latency_target;
461 uint64_t latency_window;
462 fio_fp64_t latency_percentile;
463 } __attribute__((packed));
465 extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
466 extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
467 extern int fio_test_cconv(struct thread_options *);
468 extern void options_default_fill(struct thread_options *o);