1 #ifndef FIO_THREAD_OPTIONS_H
2 #define FIO_THREAD_OPTIONS_H
8 #include "lib/ieee754.h"
11 * What type of allocation to use for io buffers
14 MEM_MALLOC = 0, /* ordinary malloc */
15 MEM_SHM, /* use shared memory segments */
16 MEM_SHMHUGE, /* use shared memory segments with huge pages */
17 MEM_MMAP, /* use anonynomous mmap */
18 MEM_MMAPHUGE, /* memory mapped huge file */
22 * What type of errors to continue on when continue_on_error is used
25 ERROR_TYPE_READ_BIT = 0,
26 ERROR_TYPE_WRITE_BIT = 1,
27 ERROR_TYPE_VERIFY_BIT = 2,
31 #define ERROR_STR_MAX 128
35 ERROR_TYPE_READ = 1 << ERROR_TYPE_READ_BIT,
36 ERROR_TYPE_WRITE = 1 << ERROR_TYPE_WRITE_BIT,
37 ERROR_TYPE_VERIFY = 1 << ERROR_TYPE_VERIFY_BIT,
38 ERROR_TYPE_ANY = 0xffff,
41 #define BSSPLIT_MAX 64
48 struct thread_options {
54 char *filename_format;
61 unsigned int unit_base;
62 unsigned int ddir_seq_nr;
65 unsigned int iodepth_low;
66 unsigned int iodepth_batch;
67 unsigned int iodepth_batch_complete;
69 unsigned long long size;
70 unsigned int size_percent;
71 unsigned int fill_device;
72 unsigned long long file_size_low;
73 unsigned long long file_size_high;
74 unsigned long long start_offset;
76 unsigned int bs[DDIR_RWDIR_CNT];
77 unsigned int ba[DDIR_RWDIR_CNT];
78 unsigned int min_bs[DDIR_RWDIR_CNT];
79 unsigned int max_bs[DDIR_RWDIR_CNT];
80 struct bssplit *bssplit[DDIR_RWDIR_CNT];
81 unsigned int bssplit_nr[DDIR_RWDIR_CNT];
83 int *ignore_error[ERROR_TYPE_CNT];
84 unsigned int ignore_error_nr[ERROR_TYPE_CNT];
85 unsigned int error_dump;
87 unsigned int nr_files;
88 unsigned int open_files;
89 enum file_lock_mode file_lock_mode;
92 unsigned int invalidate_cache;
93 unsigned int create_serialize;
94 unsigned int create_fsync;
95 unsigned int create_on_open;
96 unsigned int create_only;
97 unsigned int end_fsync;
98 unsigned int pre_read;
101 unsigned int do_verify;
102 unsigned int verifysort;
103 unsigned int verifysort_nr;
104 unsigned int verify_interval;
105 unsigned int verify_offset;
106 char verify_pattern[MAX_PATTERN_SIZE];
107 unsigned int verify_pattern_bytes;
108 unsigned int verify_fatal;
109 unsigned int verify_dump;
110 unsigned int verify_async;
111 unsigned long long verify_backlog;
112 unsigned int verify_batch;
113 unsigned int experimental_verify;
114 unsigned int use_thread;
116 unsigned int do_disk_util;
117 unsigned int override_sync;
118 unsigned int rand_repeatable;
119 unsigned int use_os_rand;
120 unsigned int log_avg_msec;
121 unsigned int norandommap;
122 unsigned int softrandommap;
123 unsigned int bs_unaligned;
124 unsigned int fsync_on_close;
126 unsigned int random_distribution;
128 fio_fp64_t zipf_theta;
131 unsigned int random_generator;
133 unsigned int hugepage_size;
134 unsigned int rw_min_bs;
135 unsigned int thinktime;
136 unsigned int thinktime_spin;
137 unsigned int thinktime_blocks;
138 unsigned int fsync_blocks;
139 unsigned int fdatasync_blocks;
140 unsigned int barrier_blocks;
141 unsigned long long start_delay;
142 unsigned long long timeout;
143 unsigned long long ramp_time;
144 unsigned int overwrite;
145 unsigned int bw_avg_time;
146 unsigned int iops_avg_time;
148 unsigned long long zone_range;
149 unsigned long long zone_size;
150 unsigned long long zone_skip;
151 unsigned long long lockmem;
152 enum fio_memtype mem_type;
153 unsigned int mem_align;
155 unsigned int max_latency;
157 unsigned int stonewall;
158 unsigned int new_group;
159 unsigned int numjobs;
160 os_cpu_mask_t cpumask;
161 unsigned int cpumask_set;
162 os_cpu_mask_t verify_cpumask;
163 unsigned int verify_cpumask_set;
164 #ifdef CONFIG_LIBNUMA
165 struct bitmask *numa_cpunodesmask;
166 unsigned int numa_cpumask_set;
167 unsigned short numa_mem_mode;
168 unsigned int numa_mem_prefer_node;
169 struct bitmask *numa_memnodesmask;
170 unsigned int numa_memmask_set;
173 unsigned int rwmixcycle;
174 unsigned int rwmix[2];
177 unsigned int ioprio_class;
178 unsigned int file_service_type;
179 unsigned int group_reporting;
180 unsigned int fadvise_hint;
181 enum fio_fallocate_mode fallocate_mode;
182 unsigned int zero_buffers;
183 unsigned int refill_buffers;
184 unsigned int scramble_buffers;
185 unsigned int compress_percentage;
186 unsigned int compress_chunk;
187 unsigned int time_based;
188 unsigned int disable_lat;
189 unsigned int disable_clat;
190 unsigned int disable_slat;
191 unsigned int disable_bw;
192 unsigned int unified_rw_rep;
193 unsigned int gtod_reduce;
194 unsigned int gtod_cpu;
195 unsigned int gtod_offload;
196 enum fio_cs clocksource;
197 unsigned int no_stall;
198 unsigned int trim_percentage;
199 unsigned int trim_batch;
200 unsigned int trim_zero;
201 unsigned long long trim_backlog;
202 unsigned int clat_percentiles;
203 unsigned int percentile_precision; /* digits after decimal for percentiles */
204 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
206 char *read_iolog_file;
207 char *write_iolog_file;
211 char *replay_redirect;
214 * Pre-run and post-run shell
219 unsigned int rate[DDIR_RWDIR_CNT];
220 unsigned int ratemin[DDIR_RWDIR_CNT];
221 unsigned int ratecycle;
222 unsigned int rate_iops[DDIR_RWDIR_CNT];
223 unsigned int rate_iops_min[DDIR_RWDIR_CNT];
230 enum error_type continue_on_error;
233 * Benchmark profile type
238 * blkio cgroup support
241 unsigned int cgroup_weight;
242 unsigned int cgroup_nodelete;
250 unsigned int flow_sleep;
252 unsigned long long offset_increment;
254 unsigned int sync_file_range;
257 #define FIO_TOP_STR_MAX 256
259 struct thread_options_pack {
260 uint8_t description[FIO_TOP_STR_MAX];
261 uint8_t name[FIO_TOP_STR_MAX];
262 uint8_t directory[FIO_TOP_STR_MAX];
263 uint8_t filename[FIO_TOP_STR_MAX];
264 uint8_t filename_format[FIO_TOP_STR_MAX];
265 uint8_t opendir[FIO_TOP_STR_MAX];
266 uint8_t ioengine[FIO_TOP_STR_MAX];
267 uint8_t mmapfile[FIO_TOP_STR_MAX];
272 uint32_t ddir_seq_nr;
273 uint64_t ddir_seq_add;
275 uint32_t iodepth_low;
276 uint32_t iodepth_batch;
277 uint32_t iodepth_batch_complete;
280 uint32_t size_percent;
281 uint32_t fill_device;
282 uint64_t file_size_low;
283 uint64_t file_size_high;
284 uint64_t start_offset;
286 uint32_t bs[DDIR_RWDIR_CNT];
287 uint32_t ba[DDIR_RWDIR_CNT];
288 uint32_t min_bs[DDIR_RWDIR_CNT];
289 uint32_t max_bs[DDIR_RWDIR_CNT];
290 struct bssplit bssplit[DDIR_RWDIR_CNT][BSSPLIT_MAX];
291 uint32_t bssplit_nr[DDIR_RWDIR_CNT];
293 uint32_t ignore_error[ERROR_TYPE_CNT][ERROR_STR_MAX];
294 uint32_t ignore_error_nr[ERROR_TYPE_CNT];
299 uint32_t file_lock_mode;
302 uint32_t invalidate_cache;
303 uint32_t create_serialize;
304 uint32_t create_fsync;
305 uint32_t create_on_open;
306 uint32_t create_only;
313 uint32_t verifysort_nr;
314 uint32_t verify_interval;
315 uint32_t verify_offset;
316 uint8_t verify_pattern[MAX_PATTERN_SIZE];
317 uint32_t verify_pattern_bytes;
318 uint32_t verify_fatal;
319 uint32_t verify_dump;
320 uint32_t verify_async;
321 uint64_t verify_backlog;
322 uint32_t verify_batch;
323 uint32_t experimental_verify;
326 uint32_t do_disk_util;
327 uint32_t override_sync;
328 uint32_t rand_repeatable;
329 uint32_t use_os_rand;
330 uint32_t log_avg_msec;
331 uint32_t norandommap;
332 uint32_t softrandommap;
333 uint32_t bs_unaligned;
334 uint32_t fsync_on_close;
336 uint32_t random_distribution;
337 fio_fp64_t zipf_theta;
340 uint32_t random_generator;
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;
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 unsigned int compress_percentage;
387 unsigned int compress_chunk;
389 uint32_t disable_lat;
390 uint32_t disable_clat;
391 uint32_t disable_slat;
393 uint32_t unified_rw_rep;
394 uint32_t gtod_reduce;
396 uint32_t gtod_offload;
397 uint32_t clocksource;
399 uint32_t trim_percentage;
402 uint64_t trim_backlog;
403 uint32_t clat_percentiles;
404 uint32_t percentile_precision;
405 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
407 uint8_t read_iolog_file[FIO_TOP_STR_MAX];
408 uint8_t write_iolog_file[FIO_TOP_STR_MAX];
409 uint8_t bw_log_file[FIO_TOP_STR_MAX];
410 uint8_t lat_log_file[FIO_TOP_STR_MAX];
411 uint8_t iops_log_file[FIO_TOP_STR_MAX];
412 uint8_t replay_redirect[FIO_TOP_STR_MAX];
415 * Pre-run and post-run shell
417 uint8_t exec_prerun[FIO_TOP_STR_MAX];
418 uint8_t exec_postrun[FIO_TOP_STR_MAX];
420 uint32_t rate[DDIR_RWDIR_CNT];
421 uint32_t ratemin[DDIR_RWDIR_CNT];
423 uint32_t rate_iops[DDIR_RWDIR_CNT];
424 uint32_t rate_iops_min[DDIR_RWDIR_CNT];
426 uint8_t ioscheduler[FIO_TOP_STR_MAX];
431 uint32_t continue_on_error;
434 * Benchmark profile type
436 uint8_t profile[FIO_TOP_STR_MAX];
439 * blkio cgroup support
441 uint8_t cgroup[FIO_TOP_STR_MAX];
442 uint32_t cgroup_weight;
443 uint32_t cgroup_nodelete;
450 int32_t flow_watermark;
453 uint64_t offset_increment;
455 uint32_t sync_file_range;
456 } __attribute__((packed));
458 extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
459 extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
460 extern int fio_test_cconv(struct thread_options *);
461 extern void options_default_fill(struct thread_options *o);