Unify options with gfio
[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"
8
9/*
10 * What type of allocation to use for io buffers
11 */
12enum fio_memtype {
13 MEM_MALLOC = 0, /* ordinary malloc */
14 MEM_SHM, /* use shared memory segments */
15 MEM_SHMHUGE, /* use shared memory segments with huge pages */
16 MEM_MMAP, /* use anonynomous mmap */
17 MEM_MMAPHUGE, /* memory mapped huge file */
18};
19
20/*
21 * What type of errors to continue on when continue_on_error is used
22 */
23enum error_type_bit {
24 ERROR_TYPE_READ_BIT = 0,
25 ERROR_TYPE_WRITE_BIT = 1,
26 ERROR_TYPE_VERIFY_BIT = 2,
27 ERROR_TYPE_CNT = 3,
28};
29
30#define ERROR_STR_MAX 128
31
32enum error_type {
33 ERROR_TYPE_NONE = 0,
34 ERROR_TYPE_READ = 1 << ERROR_TYPE_READ_BIT,
35 ERROR_TYPE_WRITE = 1 << ERROR_TYPE_WRITE_BIT,
36 ERROR_TYPE_VERIFY = 1 << ERROR_TYPE_VERIFY_BIT,
37 ERROR_TYPE_ANY = 0xffff,
38};
39
40#define BSSPLIT_MAX 64
41
42struct bssplit {
43 uint32_t bs;
44 uint32_t perc;
45};
46
47struct thread_options {
48 int pad;
49 char *description;
50 char *name;
51 char *directory;
52 char *filename;
53 char *filename_format;
54 char *opendir;
55 char *ioengine;
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 ddir_seq_add;
62 unsigned int iodepth;
63 unsigned int iodepth_low;
64 unsigned int iodepth_batch;
65 unsigned int iodepth_batch_complete;
66
67 unsigned long long size;
68 unsigned int size_percent;
69 unsigned int fill_device;
70 unsigned long long file_size_low;
71 unsigned long long file_size_high;
72 unsigned long long start_offset;
73
74 unsigned int bs[DDIR_RWDIR_CNT];
75 unsigned int ba[DDIR_RWDIR_CNT];
76 unsigned int min_bs[DDIR_RWDIR_CNT];
77 unsigned int max_bs[DDIR_RWDIR_CNT];
78 struct bssplit *bssplit[DDIR_RWDIR_CNT];
79 unsigned int bssplit_nr[DDIR_RWDIR_CNT];
80
81 int *ignore_error[ERROR_TYPE_CNT];
82 unsigned int ignore_error_nr[ERROR_TYPE_CNT];
83 unsigned int error_dump;
84
85 unsigned int nr_files;
86 unsigned int open_files;
87 enum file_lock_mode file_lock_mode;
88
89 unsigned int odirect;
90 unsigned int invalidate_cache;
91 unsigned int create_serialize;
92 unsigned int create_fsync;
93 unsigned int create_on_open;
94 unsigned int create_only;
95 unsigned int end_fsync;
96 unsigned int pre_read;
97 unsigned int sync_io;
98 unsigned int verify;
99 unsigned int do_verify;
100 unsigned int verifysort;
101 unsigned int verifysort_nr;
102 unsigned int verify_interval;
103 unsigned int verify_offset;
104 char verify_pattern[MAX_PATTERN_SIZE];
105 unsigned int verify_pattern_bytes;
106 unsigned int verify_fatal;
107 unsigned int verify_dump;
108 unsigned int verify_async;
109 unsigned long long verify_backlog;
110 unsigned int verify_batch;
111 unsigned int experimental_verify;
112 unsigned int use_thread;
113 unsigned int unlink;
114 unsigned int do_disk_util;
115 unsigned int override_sync;
116 unsigned int rand_repeatable;
117 unsigned int use_os_rand;
118 unsigned int write_lat_log;
119 unsigned int write_bw_log;
120 unsigned int write_iops_log;
121 unsigned int log_avg_msec;
122 unsigned int norandommap;
123 unsigned int softrandommap;
124 unsigned int bs_unaligned;
125 unsigned int fsync_on_close;
126
127 unsigned int random_distribution;
128 double zipf_theta;
129 double pareto_h;
130
131 unsigned int random_generator;
132
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;
147 unsigned int loops;
148 unsigned long long zone_range;
149 unsigned long long zone_size;
150 unsigned long long zone_skip;
81c6b6cd 151 unsigned long long lockmem;
8062f527
JA
152 enum fio_memtype mem_type;
153 unsigned int mem_align;
154
155 unsigned int max_latency;
156
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;
171#endif
172 unsigned int iolog;
173 unsigned int rwmixcycle;
174 unsigned int rwmix[2];
175 unsigned int nice;
81c6b6cd
JA
176 unsigned int ioprio;
177 unsigned int ioprio_class;
8062f527
JA
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];
205
206 char *read_iolog_file;
207 char *write_iolog_file;
208 char *bw_log_file;
209 char *lat_log_file;
210 char *iops_log_file;
211 char *replay_redirect;
212
213 /*
214 * Pre-run and post-run shell
215 */
216 char *exec_prerun;
217 char *exec_postrun;
218
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];
224
225 char *ioscheduler;
226
227 /*
228 * CPU "io" cycle burner
229 */
230 unsigned int cpuload;
231 unsigned int cpucycle;
232
233 /*
234 * I/O Error handling
235 */
236 enum error_type continue_on_error;
237
238 /*
239 * Benchmark profile type
240 */
241 char *profile;
242
243 /*
244 * blkio cgroup support
245 */
246 char *cgroup;
247 unsigned int cgroup_weight;
248 unsigned int cgroup_nodelete;
249
250 unsigned int uid;
251 unsigned int gid;
252
253 int flow_id;
254 int flow;
255 int flow_watermark;
256 unsigned int flow_sleep;
257
258 unsigned long long offset_increment;
259
260 unsigned int sync_file_range;
261};
262
263#endif