Make lockmem a per job option
[fio.git] / thread_options.h
CommitLineData
ec41265e
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 {
24 ERROR_TYPE_NONE = 0,
25 ERROR_TYPE_READ = 1 << 0,
26 ERROR_TYPE_WRITE = 1 << 1,
27 ERROR_TYPE_VERIFY = 1 << 2,
28 ERROR_TYPE_ANY = 0xffff,
29};
30
2dc1cbb5
JA
31#define BSSPLIT_MAX 64
32
ec41265e 33struct bssplit {
2dc1cbb5
JA
34 uint32_t bs;
35 uint32_t perc;
ec41265e
JA
36};
37
38struct thread_options {
39 int pad;
40 char *description;
41 char *name;
42 char *directory;
43 char *filename;
44 char *opendir;
45 char *ioengine;
83ea422a 46 char *mmapfile;
ec41265e
JA
47 enum td_ddir td_ddir;
48 unsigned int rw_seq;
49 unsigned int kb_base;
50 unsigned int ddir_seq_nr;
51 long ddir_seq_add;
52 unsigned int iodepth;
53 unsigned int iodepth_low;
54 unsigned int iodepth_batch;
55 unsigned int iodepth_batch_complete;
56
57 unsigned long long size;
58 unsigned int size_percent;
59 unsigned int fill_device;
60 unsigned long long file_size_low;
61 unsigned long long file_size_high;
62 unsigned long long start_offset;
63
64 unsigned int bs[2];
65 unsigned int ba[2];
66 unsigned int min_bs[2];
67 unsigned int max_bs[2];
68 struct bssplit *bssplit[2];
69 unsigned int bssplit_nr[2];
70
71 unsigned int nr_files;
72 unsigned int open_files;
73 enum file_lock_mode file_lock_mode;
74 unsigned int lockfile_batch;
75
76 unsigned int odirect;
77 unsigned int invalidate_cache;
78 unsigned int create_serialize;
79 unsigned int create_fsync;
80 unsigned int create_on_open;
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 verify_interval;
88 unsigned int verify_offset;
89 char verify_pattern[MAX_PATTERN_SIZE];
90 unsigned int verify_pattern_bytes;
91 unsigned int verify_fatal;
92 unsigned int verify_dump;
93 unsigned int verify_async;
94 unsigned long long verify_backlog;
95 unsigned int verify_batch;
96 unsigned int use_thread;
97 unsigned int unlink;
98 unsigned int do_disk_util;
99 unsigned int override_sync;
100 unsigned int rand_repeatable;
101 unsigned int use_os_rand;
102 unsigned int write_lat_log;
103 unsigned int write_bw_log;
104 unsigned int write_iops_log;
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
111 unsigned int hugepage_size;
112 unsigned int rw_min_bs;
113 unsigned int thinktime;
114 unsigned int thinktime_spin;
115 unsigned int thinktime_blocks;
116 unsigned int fsync_blocks;
117 unsigned int fdatasync_blocks;
118 unsigned int barrier_blocks;
119 unsigned long long start_delay;
120 unsigned long long timeout;
121 unsigned long long ramp_time;
122 unsigned int overwrite;
123 unsigned int bw_avg_time;
124 unsigned int iops_avg_time;
125 unsigned int loops;
126 unsigned long long zone_range;
127 unsigned long long zone_size;
128 unsigned long long zone_skip;
1b79a070 129 unsigned long long lockmem;
ec41265e
JA
130 enum fio_memtype mem_type;
131 unsigned int mem_align;
132
133 unsigned int stonewall;
134 unsigned int new_group;
135 unsigned int numjobs;
136 os_cpu_mask_t cpumask;
137 unsigned int cpumask_set;
138 os_cpu_mask_t verify_cpumask;
139 unsigned int verify_cpumask_set;
140 unsigned int iolog;
141 unsigned int rwmixcycle;
142 unsigned int rwmix[2];
143 unsigned int nice;
144 unsigned int file_service_type;
145 unsigned int group_reporting;
146 unsigned int fadvise_hint;
147 enum fio_fallocate_mode fallocate_mode;
148 unsigned int zero_buffers;
149 unsigned int refill_buffers;
150 unsigned int scramble_buffers;
e476994e
JA
151 unsigned int compress_percentage;
152 unsigned int compress_chunk;
ec41265e
JA
153 unsigned int time_based;
154 unsigned int disable_lat;
155 unsigned int disable_clat;
156 unsigned int disable_slat;
157 unsigned int disable_bw;
158 unsigned int gtod_reduce;
159 unsigned int gtod_cpu;
160 unsigned int gtod_offload;
161 enum fio_cs clocksource;
162 unsigned int no_stall;
163 unsigned int trim_percentage;
164 unsigned int trim_batch;
165 unsigned int trim_zero;
166 unsigned long long trim_backlog;
167 unsigned int clat_percentiles;
168 unsigned int overwrite_plist;
169 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
170
171 char *read_iolog_file;
172 char *write_iolog_file;
173 char *bw_log_file;
174 char *lat_log_file;
175 char *iops_log_file;
176 char *replay_redirect;
177
178 /*
179 * Pre-run and post-run shell
180 */
181 char *exec_prerun;
182 char *exec_postrun;
183
184 unsigned int rate[2];
185 unsigned int ratemin[2];
186 unsigned int ratecycle;
187 unsigned int rate_iops[2];
188 unsigned int rate_iops_min[2];
189
190 char *ioscheduler;
191
ec41265e
JA
192 /*
193 * I/O Error handling
194 */
195 enum error_type continue_on_error;
196
197 /*
198 * Benchmark profile type
199 */
200 char *profile;
201
202 /*
203 * blkio cgroup support
204 */
205 char *cgroup;
206 unsigned int cgroup_weight;
207 unsigned int cgroup_nodelete;
208
209 unsigned int uid;
210 unsigned int gid;
211
212 int flow_id;
213 int flow;
214 int flow_watermark;
215 unsigned int flow_sleep;
216
6a4cf74f
JA
217 unsigned long long offset_increment;
218
ec41265e
JA
219 unsigned int sync_file_range;
220};
221
2dc1cbb5
JA
222#define FIO_TOP_STR_MAX 256
223
224struct thread_options_pack {
225 uint8_t description[FIO_TOP_STR_MAX];
226 uint8_t name[FIO_TOP_STR_MAX];
227 uint8_t directory[FIO_TOP_STR_MAX];
228 uint8_t filename[FIO_TOP_STR_MAX];
229 uint8_t opendir[FIO_TOP_STR_MAX];
230 uint8_t ioengine[FIO_TOP_STR_MAX];
83ea422a 231 uint8_t mmapfile[FIO_TOP_STR_MAX];
2dc1cbb5
JA
232 uint32_t td_ddir;
233 uint32_t rw_seq;
234 uint32_t kb_base;
235 uint32_t ddir_seq_nr;
236 uint64_t ddir_seq_add;
237 uint32_t iodepth;
238 uint32_t iodepth_low;
239 uint32_t iodepth_batch;
240 uint32_t iodepth_batch_complete;
241
242 uint64_t size;
243 uint32_t size_percent;
244 uint32_t fill_device;
245 uint64_t file_size_low;
246 uint64_t file_size_high;
247 uint64_t start_offset;
248
249 uint32_t bs[2];
250 uint32_t ba[2];
251 uint32_t min_bs[2];
252 uint32_t max_bs[2];
253 struct bssplit bssplit[2][BSSPLIT_MAX];
254 uint32_t bssplit_nr[2];
255
256 uint32_t nr_files;
257 uint32_t open_files;
258 uint32_t file_lock_mode;
259 uint32_t lockfile_batch;
260
261 uint32_t odirect;
262 uint32_t invalidate_cache;
263 uint32_t create_serialize;
264 uint32_t create_fsync;
265 uint32_t create_on_open;
266 uint32_t end_fsync;
267 uint32_t pre_read;
268 uint32_t sync_io;
269 uint32_t verify;
270 uint32_t do_verify;
271 uint32_t verifysort;
272 uint32_t verify_interval;
273 uint32_t verify_offset;
274 uint8_t verify_pattern[MAX_PATTERN_SIZE];
275 uint32_t verify_pattern_bytes;
276 uint32_t verify_fatal;
277 uint32_t verify_dump;
278 uint32_t verify_async;
279 uint64_t verify_backlog;
280 uint32_t verify_batch;
281 uint32_t use_thread;
282 uint32_t unlink;
283 uint32_t do_disk_util;
284 uint32_t override_sync;
285 uint32_t rand_repeatable;
286 uint32_t use_os_rand;
287 uint32_t write_lat_log;
288 uint32_t write_bw_log;
289 uint32_t write_iops_log;
290 uint32_t log_avg_msec;
291 uint32_t norandommap;
292 uint32_t softrandommap;
293 uint32_t bs_unaligned;
294 uint32_t fsync_on_close;
295
296 uint32_t hugepage_size;
297 uint32_t rw_min_bs;
298 uint32_t thinktime;
299 uint32_t thinktime_spin;
300 uint32_t thinktime_blocks;
301 uint32_t fsync_blocks;
302 uint32_t fdatasync_blocks;
303 uint32_t barrier_blocks;
304 uint64_t start_delay;
305 uint64_t timeout;
306 uint64_t ramp_time;
307 uint32_t overwrite;
308 uint32_t bw_avg_time;
309 uint32_t iops_avg_time;
310 uint32_t loops;
311 uint64_t zone_range;
312 uint64_t zone_size;
313 uint64_t zone_skip;
314 uint32_t mem_type;
315 uint32_t mem_align;
316
317 uint32_t stonewall;
318 uint32_t new_group;
319 uint32_t numjobs;
320 uint8_t cpumask[FIO_TOP_STR_MAX];
321 uint32_t cpumask_set;
322 uint8_t verify_cpumask[FIO_TOP_STR_MAX];
323 uint32_t verify_cpumask_set;
324 uint32_t iolog;
325 uint32_t rwmixcycle;
326 uint32_t rwmix[2];
327 uint32_t nice;
328 uint32_t file_service_type;
329 uint32_t group_reporting;
330 uint32_t fadvise_hint;
331 uint32_t fallocate_mode;
332 uint32_t zero_buffers;
333 uint32_t refill_buffers;
334 uint32_t scramble_buffers;
e476994e
JA
335 unsigned int compress_percentage;
336 unsigned int compress_chunk;
2dc1cbb5
JA
337 uint32_t time_based;
338 uint32_t disable_lat;
339 uint32_t disable_clat;
340 uint32_t disable_slat;
341 uint32_t disable_bw;
342 uint32_t gtod_reduce;
343 uint32_t gtod_cpu;
344 uint32_t gtod_offload;
345 uint32_t clocksource;
346 uint32_t no_stall;
347 uint32_t trim_percentage;
348 uint32_t trim_batch;
349 uint32_t trim_zero;
350 uint64_t trim_backlog;
351 uint32_t clat_percentiles;
352 uint32_t overwrite_plist;
353 fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
354
355 uint8_t read_iolog_file[FIO_TOP_STR_MAX];
356 uint8_t write_iolog_file[FIO_TOP_STR_MAX];
357 uint8_t bw_log_file[FIO_TOP_STR_MAX];
358 uint8_t lat_log_file[FIO_TOP_STR_MAX];
359 uint8_t iops_log_file[FIO_TOP_STR_MAX];
360 uint8_t replay_redirect[FIO_TOP_STR_MAX];
361
362 /*
363 * Pre-run and post-run shell
364 */
365 uint8_t exec_prerun[FIO_TOP_STR_MAX];
366 uint8_t exec_postrun[FIO_TOP_STR_MAX];
367
368 uint32_t rate[2];
369 uint32_t ratemin[2];
370 uint32_t ratecycle;
371 uint32_t rate_iops[2];
372 uint32_t rate_iops_min[2];
373
374 uint8_t ioscheduler[FIO_TOP_STR_MAX];
375
2dc1cbb5
JA
376 /*
377 * I/O Error handling
378 */
379 uint32_t continue_on_error;
380
381 /*
382 * Benchmark profile type
383 */
384 uint8_t profile[FIO_TOP_STR_MAX];
385
386 /*
387 * blkio cgroup support
388 */
389 uint8_t cgroup[FIO_TOP_STR_MAX];
390 uint32_t cgroup_weight;
391 uint32_t cgroup_nodelete;
392
393 uint32_t uid;
394 uint32_t gid;
395
396 int32_t flow_id;
397 int32_t flow;
398 int32_t flow_watermark;
399 uint32_t flow_sleep;
400
6a4cf74f
JA
401 uint64_t offset_increment;
402
2dc1cbb5
JA
403 uint32_t sync_file_range;
404} __attribute__((packed));
405
406extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
407extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
51167799 408extern int fio_test_cconv(struct thread_options *);
588b7f09 409extern void options_default_fill(struct thread_options *o);
2dc1cbb5 410
ec41265e 411#endif