Adds verify_only option
[fio.git] / thread_options.h
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 "stat.h"
7 #include "gettime.h"
8 #include "lib/ieee754.h"
9 #include "td_error.h"
10
11 /*
12  * What type of allocation to use for io buffers
13  */
14 enum fio_memtype {
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 */
20 };
21
22 #define ERROR_STR_MAX   128
23
24 #define BSSPLIT_MAX     64
25
26 struct bssplit {
27         uint32_t bs;
28         uint32_t perc;
29 };
30
31 struct thread_options {
32         int pad;
33         char *description;
34         char *name;
35         char *directory;
36         char *filename;
37         char *filename_format;
38         char *opendir;
39         char *ioengine;
40         char *mmapfile;
41         enum td_ddir td_ddir;
42         unsigned int rw_seq;
43         unsigned int kb_base;
44         unsigned int unit_base;
45         unsigned int ddir_seq_nr;
46         long ddir_seq_add;
47         unsigned int iodepth;
48         unsigned int iodepth_low;
49         unsigned int iodepth_batch;
50         unsigned int iodepth_batch_complete;
51
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;
58
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];
65
66         int *ignore_error[ERROR_TYPE_CNT];
67         unsigned int ignore_error_nr[ERROR_TYPE_CNT];
68         unsigned int error_dump;
69
70         unsigned int nr_files;
71         unsigned int open_files;
72         enum file_lock_mode file_lock_mode;
73
74         unsigned int odirect;
75         unsigned int oatomic;
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;
83         unsigned int sync_io;
84         unsigned int verify;
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;
99         unsigned int unlink;
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;
111
112         unsigned int verify_only;
113
114         unsigned int random_distribution;
115
116         fio_fp64_t zipf_theta;
117         fio_fp64_t pareto_h;
118
119         unsigned int random_generator;
120
121         unsigned int perc_rand[DDIR_RWDIR_CNT];
122
123         unsigned int hugepage_size;
124         unsigned int rw_min_bs;
125         unsigned int thinktime;
126         unsigned int thinktime_spin;
127         unsigned int thinktime_blocks;
128         unsigned int fsync_blocks;
129         unsigned int fdatasync_blocks;
130         unsigned int barrier_blocks;
131         unsigned long long start_delay;
132         unsigned long long timeout;
133         unsigned long long ramp_time;
134         unsigned int overwrite;
135         unsigned int bw_avg_time;
136         unsigned int iops_avg_time;
137         unsigned int loops;
138         unsigned long long zone_range;
139         unsigned long long zone_size;
140         unsigned long long zone_skip;
141         unsigned long long lockmem;
142         enum fio_memtype mem_type;
143         unsigned int mem_align;
144
145         unsigned int max_latency;
146
147         unsigned int stonewall;
148         unsigned int new_group;
149         unsigned int numjobs;
150         os_cpu_mask_t cpumask;
151         unsigned int cpumask_set;
152         os_cpu_mask_t verify_cpumask;
153         unsigned int verify_cpumask_set;
154 #ifdef CONFIG_LIBNUMA
155         struct bitmask *numa_cpunodesmask;
156         unsigned int numa_cpumask_set;
157         unsigned short numa_mem_mode;
158         unsigned int numa_mem_prefer_node;
159         struct bitmask *numa_memnodesmask;
160         unsigned int numa_memmask_set;
161 #endif
162         unsigned int iolog;
163         unsigned int rwmixcycle;
164         unsigned int rwmix[DDIR_RWDIR_CNT];
165         unsigned int nice;
166         unsigned int ioprio;
167         unsigned int ioprio_class;
168         unsigned int file_service_type;
169         unsigned int group_reporting;
170         unsigned int fadvise_hint;
171         enum fio_fallocate_mode fallocate_mode;
172         unsigned int zero_buffers;
173         unsigned int refill_buffers;
174         unsigned int scramble_buffers;
175         char buffer_pattern[MAX_PATTERN_SIZE];
176         unsigned int buffer_pattern_bytes;
177         unsigned int compress_percentage;
178         unsigned int compress_chunk;
179         unsigned int time_based;
180         unsigned int disable_lat;
181         unsigned int disable_clat;
182         unsigned int disable_slat;
183         unsigned int disable_bw;
184         unsigned int unified_rw_rep;
185         unsigned int gtod_reduce;
186         unsigned int gtod_cpu;
187         unsigned int gtod_offload;
188         enum fio_cs clocksource;
189         unsigned int no_stall;
190         unsigned int trim_percentage;
191         unsigned int trim_batch;
192         unsigned int trim_zero;
193         unsigned long long trim_backlog;
194         unsigned int clat_percentiles;
195         unsigned int percentile_precision;      /* digits after decimal for percentiles */
196         fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
197
198         char *read_iolog_file;
199         char *write_iolog_file;
200         char *bw_log_file;
201         char *lat_log_file;
202         char *iops_log_file;
203         char *replay_redirect;
204
205         /*
206          * Pre-run and post-run shell
207          */
208         char *exec_prerun;
209         char *exec_postrun;
210
211         unsigned int rate[DDIR_RWDIR_CNT];
212         unsigned int ratemin[DDIR_RWDIR_CNT];
213         unsigned int ratecycle;
214         unsigned int rate_iops[DDIR_RWDIR_CNT];
215         unsigned int rate_iops_min[DDIR_RWDIR_CNT];
216
217         char *ioscheduler;
218
219         /*
220          * I/O Error handling
221          */
222         enum error_type continue_on_error;
223
224         /*
225          * Benchmark profile type
226          */
227         char *profile;
228
229         /*
230          * blkio cgroup support
231          */
232         char *cgroup;
233         unsigned int cgroup_weight;
234         unsigned int cgroup_nodelete;
235
236         unsigned int uid;
237         unsigned int gid;
238
239         int flow_id;
240         int flow;
241         int flow_watermark;
242         unsigned int flow_sleep;
243
244         unsigned long long offset_increment;
245         unsigned long long number_ios;
246
247         unsigned int sync_file_range;
248
249         unsigned long long latency_target;
250         unsigned long long latency_window;
251         fio_fp64_t latency_percentile;
252 };
253
254 #define FIO_TOP_STR_MAX         256
255
256 struct thread_options_pack {
257         uint8_t description[FIO_TOP_STR_MAX];
258         uint8_t name[FIO_TOP_STR_MAX];
259         uint8_t directory[FIO_TOP_STR_MAX];
260         uint8_t filename[FIO_TOP_STR_MAX];
261         uint8_t filename_format[FIO_TOP_STR_MAX];
262         uint8_t opendir[FIO_TOP_STR_MAX];
263         uint8_t ioengine[FIO_TOP_STR_MAX];
264         uint8_t mmapfile[FIO_TOP_STR_MAX];
265         uint32_t td_ddir;
266         uint32_t rw_seq;
267         uint32_t kb_base;
268         uint32_t unit_base;
269         uint32_t ddir_seq_nr;
270         uint64_t ddir_seq_add;
271         uint32_t iodepth;
272         uint32_t iodepth_low;
273         uint32_t iodepth_batch;
274         uint32_t iodepth_batch_complete;
275
276         uint64_t size;
277         uint32_t size_percent;
278         uint32_t fill_device;
279         uint64_t file_size_low;
280         uint64_t file_size_high;
281         uint64_t start_offset;
282
283         uint32_t bs[DDIR_RWDIR_CNT];
284         uint32_t ba[DDIR_RWDIR_CNT];
285         uint32_t min_bs[DDIR_RWDIR_CNT];
286         uint32_t max_bs[DDIR_RWDIR_CNT];
287         struct bssplit bssplit[DDIR_RWDIR_CNT][BSSPLIT_MAX];
288         uint32_t bssplit_nr[DDIR_RWDIR_CNT];
289
290         uint32_t ignore_error[ERROR_TYPE_CNT][ERROR_STR_MAX];
291         uint32_t ignore_error_nr[ERROR_TYPE_CNT];
292         uint32_t error_dump;
293
294         uint32_t nr_files;
295         uint32_t open_files;
296         uint32_t file_lock_mode;
297
298         uint32_t odirect;
299         uint32_t oatomic;
300         uint32_t invalidate_cache;
301         uint32_t create_serialize;
302         uint32_t create_fsync;
303         uint32_t create_on_open;
304         uint32_t create_only;
305         uint32_t end_fsync;
306         uint32_t pre_read;
307         uint32_t sync_io;
308         uint32_t verify;
309         uint32_t do_verify;
310         uint32_t verifysort;
311         uint32_t verifysort_nr;
312         uint32_t verify_interval;
313         uint32_t verify_offset;
314         uint8_t verify_pattern[MAX_PATTERN_SIZE];
315         uint32_t verify_pattern_bytes;
316         uint32_t verify_fatal;
317         uint32_t verify_dump;
318         uint32_t verify_async;
319         uint64_t verify_backlog;
320         uint32_t verify_batch;
321         uint32_t experimental_verify;
322         uint32_t use_thread;
323         uint32_t unlink;
324         uint32_t do_disk_util;
325         uint32_t override_sync;
326         uint32_t rand_repeatable;
327         uint32_t rand_seed;
328         uint32_t use_os_rand;
329         uint32_t log_avg_msec;
330         uint32_t norandommap;
331         uint32_t softrandommap;
332         uint32_t bs_unaligned;
333         uint32_t fsync_on_close;
334         uint32_t bs_is_seq_rand;
335
336         uint32_t random_distribution;
337         fio_fp64_t zipf_theta;
338         fio_fp64_t pareto_h;
339
340         uint32_t random_generator;
341
342         uint32_t perc_rand[DDIR_RWDIR_CNT];
343
344         uint32_t hugepage_size;
345         uint32_t rw_min_bs;
346         uint32_t thinktime;
347         uint32_t thinktime_spin;
348         uint32_t thinktime_blocks;
349         uint32_t fsync_blocks;
350         uint32_t fdatasync_blocks;
351         uint32_t barrier_blocks;
352         uint64_t start_delay;
353         uint64_t timeout;
354         uint64_t ramp_time;
355         uint32_t overwrite;
356         uint32_t bw_avg_time;
357         uint32_t iops_avg_time;
358         uint32_t loops;
359         uint64_t zone_range;
360         uint64_t zone_size;
361         uint64_t zone_skip;
362         uint64_t lockmem;
363         uint32_t mem_type;
364         uint32_t mem_align;
365
366         uint32_t max_latency;
367
368         uint32_t stonewall;
369         uint32_t new_group;
370         uint32_t numjobs;
371         uint8_t cpumask[FIO_TOP_STR_MAX];
372         uint32_t cpumask_set;
373         uint8_t verify_cpumask[FIO_TOP_STR_MAX];
374         uint32_t verify_cpumask_set;
375         uint32_t iolog;
376         uint32_t rwmixcycle;
377         uint32_t rwmix[DDIR_RWDIR_CNT];
378         uint32_t nice;
379         uint32_t ioprio;
380         uint32_t ioprio_class;
381         uint32_t file_service_type;
382         uint32_t group_reporting;
383         uint32_t fadvise_hint;
384         uint32_t fallocate_mode;
385         uint32_t zero_buffers;
386         uint32_t refill_buffers;
387         uint32_t scramble_buffers;
388         uint8_t buffer_pattern[MAX_PATTERN_SIZE];
389         uint32_t buffer_pattern_bytes;
390         unsigned int compress_percentage;
391         unsigned int compress_chunk;
392         uint32_t time_based;
393         uint32_t disable_lat;
394         uint32_t disable_clat;
395         uint32_t disable_slat;
396         uint32_t disable_bw;
397         uint32_t unified_rw_rep;
398         uint32_t gtod_reduce;
399         uint32_t gtod_cpu;
400         uint32_t gtod_offload;
401         uint32_t clocksource;
402         uint32_t no_stall;
403         uint32_t trim_percentage;
404         uint32_t trim_batch;
405         uint32_t trim_zero;
406         uint64_t trim_backlog;
407         uint32_t clat_percentiles;
408         uint32_t percentile_precision;
409         fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
410
411         uint8_t read_iolog_file[FIO_TOP_STR_MAX];
412         uint8_t write_iolog_file[FIO_TOP_STR_MAX];
413         uint8_t bw_log_file[FIO_TOP_STR_MAX];
414         uint8_t lat_log_file[FIO_TOP_STR_MAX];
415         uint8_t iops_log_file[FIO_TOP_STR_MAX];
416         uint8_t replay_redirect[FIO_TOP_STR_MAX];
417
418         /*
419          * Pre-run and post-run shell
420          */
421         uint8_t exec_prerun[FIO_TOP_STR_MAX];
422         uint8_t exec_postrun[FIO_TOP_STR_MAX];
423
424         uint32_t rate[DDIR_RWDIR_CNT];
425         uint32_t ratemin[DDIR_RWDIR_CNT];
426         uint32_t ratecycle;
427         uint32_t rate_iops[DDIR_RWDIR_CNT];
428         uint32_t rate_iops_min[DDIR_RWDIR_CNT];
429
430         uint8_t ioscheduler[FIO_TOP_STR_MAX];
431
432         /*
433          * I/O Error handling
434          */
435         uint32_t continue_on_error;
436
437         /*
438          * Benchmark profile type
439          */
440         uint8_t profile[FIO_TOP_STR_MAX];
441
442         /*
443          * blkio cgroup support
444          */
445         uint8_t cgroup[FIO_TOP_STR_MAX];
446         uint32_t cgroup_weight;
447         uint32_t cgroup_nodelete;
448
449         uint32_t uid;
450         uint32_t gid;
451
452         int32_t flow_id;
453         int32_t flow;
454         int32_t flow_watermark;
455         uint32_t flow_sleep;
456
457         uint64_t offset_increment;
458         uint64_t number_ios;
459
460         uint32_t sync_file_range;
461
462         uint64_t latency_target;
463         uint64_t latency_window;
464         fio_fp64_t latency_percentile;
465 } __attribute__((packed));
466
467 extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
468 extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
469 extern int fio_test_cconv(struct thread_options *);
470 extern void options_default_fill(struct thread_options *o);
471
472 #endif