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