Add local TODO for steady-state work
[fio.git] / thread_options.h
... / ...
CommitLineData
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 "options.h"
7#include "stat.h"
8#include "gettime.h"
9#include "lib/ieee754.h"
10#include "lib/pattern.h"
11#include "td_error.h"
12
13/*
14 * What type of allocation to use for io buffers
15 */
16enum fio_memtype {
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 */
23};
24
25#define ERROR_STR_MAX 128
26
27#define BSSPLIT_MAX 64
28#define ZONESPLIT_MAX 64
29
30struct bssplit {
31 uint32_t bs;
32 uint32_t perc;
33};
34
35struct zone_split {
36 uint8_t access_perc;
37 uint8_t size_perc;
38};
39
40#define NR_OPTS_SZ (FIO_MAX_OPTS / (8 * sizeof(uint64_t)))
41
42#define OPT_MAGIC 0x4f50544e
43
44struct thread_options {
45 int magic;
46 uint64_t set_options[NR_OPTS_SZ];
47 char *description;
48 char *name;
49 char *wait_for;
50 char *directory;
51 char *filename;
52 char *filename_format;
53 char *opendir;
54 char *ioengine;
55 char *mmapfile;
56 enum td_ddir td_ddir;
57 unsigned int rw_seq;
58 unsigned int kb_base;
59 unsigned int unit_base;
60 unsigned int ddir_seq_nr;
61 long long ddir_seq_add;
62 unsigned int iodepth;
63 unsigned int iodepth_low;
64 unsigned int iodepth_batch;
65 unsigned int iodepth_batch_complete_min;
66 unsigned int iodepth_batch_complete_max;
67
68 unsigned int unique_filename;
69
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;
78
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];
85
86 int *ignore_error[ERROR_TYPE_CNT];
87 unsigned int ignore_error_nr[ERROR_TYPE_CNT];
88 unsigned int error_dump;
89
90 unsigned int nr_files;
91 unsigned int open_files;
92 enum file_lock_mode file_lock_mode;
93
94 unsigned int odirect;
95 unsigned int oatomic;
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;
104 unsigned int verify;
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;
123 unsigned int unlink;
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;
136 unsigned int log_gz;
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;
143
144 unsigned int verify_only;
145
146 unsigned int random_distribution;
147 unsigned int exitall_error;
148
149 struct zone_split *zone_split[DDIR_RWDIR_CNT];
150 unsigned int zone_split_nr[DDIR_RWDIR_CNT];
151
152 fio_fp64_t zipf_theta;
153 fio_fp64_t pareto_h;
154 fio_fp64_t gauss_dev;
155
156 unsigned int random_generator;
157
158 unsigned int perc_rand[DDIR_RWDIR_CNT];
159
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;
172 unsigned int ss; /* TODO add to thread_options_pack */
173 bool ss_pct;
174 fio_fp64_t ss_limit;
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;
180 unsigned int loops;
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;
187
188 unsigned int max_latency;
189
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;
197 char *numa_cpunodes;
198 unsigned short numa_mem_mode;
199 unsigned int numa_mem_prefer_node;
200 char *numa_memnodes;
201 unsigned int iolog;
202 unsigned int rwmixcycle;
203 unsigned int rwmix[DDIR_RWDIR_CNT];
204 unsigned int nice;
205 unsigned int ioprio;
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];
237
238 char *read_iolog_file;
239 char *write_iolog_file;
240 char *bw_log_file;
241 char *lat_log_file;
242 char *iops_log_file;
243 char *hist_log_file;
244 char *replay_redirect;
245
246 /*
247 * Pre-run and post-run shell
248 */
249 char *exec_prerun;
250 char *exec_postrun;
251
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;
259
260 char *ioscheduler;
261
262 /*
263 * I/O Error handling
264 */
265 enum error_type continue_on_error;
266
267 /*
268 * Benchmark profile type
269 */
270 char *profile;
271
272 /*
273 * blkio cgroup support
274 */
275 char *cgroup;
276 unsigned int cgroup_weight;
277 unsigned int cgroup_nodelete;
278
279 unsigned int uid;
280 unsigned int gid;
281
282 int flow_id;
283 int flow;
284 int flow_watermark;
285 unsigned int flow_sleep;
286
287 unsigned long long offset_increment;
288 unsigned long long number_ios;
289
290 unsigned int sync_file_range;
291
292 unsigned long long latency_target;
293 unsigned long long latency_window;
294 fio_fp64_t latency_percentile;
295
296 unsigned block_error_hist;
297 unsigned int skip_bad;
298
299 unsigned int replay_align;
300 unsigned int replay_scale;
301
302 unsigned int per_job_logs;
303
304 unsigned int allow_create;
305 unsigned int allow_mounted_write;
306};
307
308#define FIO_TOP_STR_MAX 256
309
310struct 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];
321 uint32_t td_ddir;
322 uint32_t rw_seq;
323 uint32_t kb_base;
324 uint32_t unit_base;
325 uint32_t ddir_seq_nr;
326 uint64_t ddir_seq_add;
327 uint32_t iodepth;
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;
333
334 uint64_t size;
335 uint64_t io_limit;
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;
343
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];
350
351 uint32_t ignore_error[ERROR_TYPE_CNT][ERROR_STR_MAX];
352 uint32_t ignore_error_nr[ERROR_TYPE_CNT];
353 uint32_t error_dump;
354
355 uint32_t nr_files;
356 uint32_t open_files;
357 uint32_t file_lock_mode;
358
359 uint32_t odirect;
360 uint32_t oatomic;
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;
366 uint32_t end_fsync;
367 uint32_t pre_read;
368 uint32_t sync_io;
369 uint32_t verify;
370 uint32_t do_verify;
371 uint32_t verifysort;
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;
385 uint32_t use_thread;
386 uint32_t unlink;
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;
392 uint64_t rand_seed;
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;
397 uint32_t log_max;
398 uint32_t log_offset;
399 uint32_t log_gz;
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;
406
407 uint32_t random_distribution;
408 uint32_t exitall_error;
409
410 struct zone_split zone_split[DDIR_RWDIR_CNT][ZONESPLIT_MAX];
411 uint32_t zone_split_nr[DDIR_RWDIR_CNT];
412
413 fio_fp64_t zipf_theta;
414 fio_fp64_t pareto_h;
415 fio_fp64_t gauss_dev;
416
417 uint32_t random_generator;
418
419 uint32_t perc_rand[DDIR_RWDIR_CNT];
420
421 uint32_t hugepage_size;
422 uint32_t rw_min_bs;
423 uint32_t thinktime;
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;
431 uint64_t timeout;
432 uint64_t ramp_time;
433 uint32_t overwrite;
434 uint32_t bw_avg_time;
435 uint32_t iops_avg_time;
436 uint32_t loops;
437 uint64_t zone_range;
438 uint64_t zone_size;
439 uint64_t zone_skip;
440 uint64_t lockmem;
441 uint32_t mem_type;
442 uint32_t mem_align;
443
444 uint32_t max_latency;
445
446 uint32_t stonewall;
447 uint32_t new_group;
448 uint32_t numjobs;
449 /*
450 * We currently can't convert these, so don't enable them
451 */
452#if 0
453 uint8_t cpumask[FIO_TOP_STR_MAX];
454 uint8_t verify_cpumask[FIO_TOP_STR_MAX];
455 uint8_t log_gz_cpumask[FIO_TOP_STR_MAX];
456#endif
457 uint32_t cpus_allowed_policy;
458 uint32_t iolog;
459 uint32_t rwmixcycle;
460 uint32_t rwmix[DDIR_RWDIR_CNT];
461 uint32_t nice;
462 uint32_t ioprio;
463 uint32_t ioprio_class;
464 uint32_t file_service_type;
465 uint32_t group_reporting;
466 uint32_t fadvise_hint;
467 uint32_t fadvise_stream;
468 uint32_t fallocate_mode;
469 uint32_t zero_buffers;
470 uint32_t refill_buffers;
471 uint32_t scramble_buffers;
472 uint8_t buffer_pattern[MAX_PATTERN_SIZE];
473 uint32_t buffer_pattern_bytes;
474 uint32_t compress_percentage;
475 uint32_t compress_chunk;
476 uint32_t dedupe_percentage;
477 uint32_t time_based;
478 uint32_t disable_lat;
479 uint32_t disable_clat;
480 uint32_t disable_slat;
481 uint32_t disable_bw;
482 uint32_t unified_rw_rep;
483 uint32_t gtod_reduce;
484 uint32_t gtod_cpu;
485 uint32_t clocksource;
486 uint32_t no_stall;
487 uint32_t trim_percentage;
488 uint32_t trim_batch;
489 uint32_t trim_zero;
490 uint64_t trim_backlog;
491 uint32_t clat_percentiles;
492 uint32_t percentile_precision;
493 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
494
495 uint8_t read_iolog_file[FIO_TOP_STR_MAX];
496 uint8_t write_iolog_file[FIO_TOP_STR_MAX];
497 uint8_t bw_log_file[FIO_TOP_STR_MAX];
498 uint8_t lat_log_file[FIO_TOP_STR_MAX];
499 uint8_t iops_log_file[FIO_TOP_STR_MAX];
500 uint8_t hist_log_file[FIO_TOP_STR_MAX];
501 uint8_t replay_redirect[FIO_TOP_STR_MAX];
502
503 /*
504 * Pre-run and post-run shell
505 */
506 uint8_t exec_prerun[FIO_TOP_STR_MAX];
507 uint8_t exec_postrun[FIO_TOP_STR_MAX];
508
509 uint32_t rate[DDIR_RWDIR_CNT];
510 uint32_t ratemin[DDIR_RWDIR_CNT];
511 uint32_t ratecycle;
512 uint32_t io_submit_mode;
513 uint32_t rate_iops[DDIR_RWDIR_CNT];
514 uint32_t rate_iops_min[DDIR_RWDIR_CNT];
515 uint32_t rate_process;
516
517 uint8_t ioscheduler[FIO_TOP_STR_MAX];
518
519 /*
520 * I/O Error handling
521 */
522 uint32_t continue_on_error;
523
524 /*
525 * Benchmark profile type
526 */
527 uint8_t profile[FIO_TOP_STR_MAX];
528
529 /*
530 * blkio cgroup support
531 */
532 uint8_t cgroup[FIO_TOP_STR_MAX];
533 uint32_t cgroup_weight;
534 uint32_t cgroup_nodelete;
535
536 uint32_t uid;
537 uint32_t gid;
538
539 int32_t flow_id;
540 int32_t flow;
541 int32_t flow_watermark;
542 uint32_t flow_sleep;
543
544 uint64_t offset_increment;
545 uint64_t number_ios;
546
547 uint32_t sync_file_range;
548 uint32_t pad2;
549
550 uint64_t latency_target;
551 uint64_t latency_window;
552 fio_fp64_t latency_percentile;
553
554 uint32_t block_error_hist;
555 uint32_t skip_bad;
556
557 uint32_t replay_align;
558 uint32_t replay_scale;
559
560 uint32_t per_job_logs;
561
562 uint32_t allow_create;
563 uint32_t allow_mounted_write;
564} __attribute__((packed));
565
566extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
567extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
568extern int fio_test_cconv(struct thread_options *);
569extern void options_default_fill(struct thread_options *o);
570
571#endif