Commit | Line | Data |
---|---|---|
214e1eca JA |
1 | #include <stdio.h> |
2 | #include <stdlib.h> | |
3 | #include <unistd.h> | |
4 | #include <ctype.h> | |
5 | #include <string.h> | |
214e1eca | 6 | #include <assert.h> |
921c766f | 7 | #include <libgen.h> |
5921e80c JA |
8 | #include <fcntl.h> |
9 | #include <sys/types.h> | |
10 | #include <sys/stat.h> | |
e13c3b50 | 11 | #include <netinet/in.h> |
214e1eca JA |
12 | |
13 | #include "fio.h" | |
4f5af7b2 | 14 | #include "verify.h" |
214e1eca | 15 | #include "parse.h" |
eef32359 | 16 | #include "lib/fls.h" |
61b9861d | 17 | #include "lib/pattern.h" |
9f988e2e | 18 | #include "options.h" |
d220c761 | 19 | #include "optgroup.h" |
214e1eca | 20 | |
e13c3b50 | 21 | char client_sockaddr_str[INET6_ADDRSTRLEN] = { 0 }; |
72a703da | 22 | |
a609f12a JA |
23 | #define cb_data_to_td(data) container_of(data, struct thread_data, o) |
24 | ||
fc8d6d05 | 25 | static struct pattern_fmt_desc fmt_desc[] = { |
4205998f JA |
26 | { |
27 | .fmt = "%o", | |
28 | .len = FIELD_SIZE(struct io_u *, offset), | |
29 | .paste = paste_blockoff | |
30 | } | |
31 | }; | |
32 | ||
214e1eca JA |
33 | /* |
34 | * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that. | |
35 | */ | |
36 | static char *get_opt_postfix(const char *str) | |
37 | { | |
38 | char *p = strstr(str, ":"); | |
39 | ||
40 | if (!p) | |
41 | return NULL; | |
42 | ||
43 | p++; | |
44 | strip_blank_front(&p); | |
45 | strip_blank_end(p); | |
46 | return strdup(p); | |
47 | } | |
48 | ||
564ca972 JA |
49 | static int bs_cmp(const void *p1, const void *p2) |
50 | { | |
51 | const struct bssplit *bsp1 = p1; | |
52 | const struct bssplit *bsp2 = p2; | |
53 | ||
a7cd478d | 54 | return (int) bsp1->perc - (int) bsp2->perc; |
564ca972 JA |
55 | } |
56 | ||
d2835319 JA |
57 | struct split { |
58 | unsigned int nr; | |
59 | unsigned int val1[100]; | |
60 | unsigned int val2[100]; | |
61 | }; | |
62 | ||
63 | static int split_parse_ddir(struct thread_options *o, struct split *split, | |
64 | enum fio_ddir ddir, char *str) | |
564ca972 | 65 | { |
d2835319 | 66 | unsigned int i, perc; |
564ca972 | 67 | long long val; |
720e84ad | 68 | char *fname; |
564ca972 | 69 | |
d2835319 | 70 | split->nr = 0; |
564ca972 JA |
71 | |
72 | i = 0; | |
564ca972 JA |
73 | while ((fname = strsep(&str, ":")) != NULL) { |
74 | char *perc_str; | |
75 | ||
76 | if (!strlen(fname)) | |
77 | break; | |
78 | ||
564ca972 JA |
79 | perc_str = strstr(fname, "/"); |
80 | if (perc_str) { | |
81 | *perc_str = '\0'; | |
82 | perc_str++; | |
83 | perc = atoi(perc_str); | |
84 | if (perc > 100) | |
85 | perc = 100; | |
86 | else if (!perc) | |
d711cce5 | 87 | perc = -1U; |
564ca972 | 88 | } else |
d711cce5 | 89 | perc = -1U; |
564ca972 | 90 | |
88038bc7 | 91 | if (str_to_decimal(fname, &val, 1, o, 0, 0)) { |
564ca972 | 92 | log_err("fio: bssplit conversion failed\n"); |
564ca972 JA |
93 | return 1; |
94 | } | |
95 | ||
d2835319 JA |
96 | split->val1[i] = val; |
97 | split->val2[i] = perc; | |
564ca972 | 98 | i++; |
d2835319 JA |
99 | if (i == 100) |
100 | break; | |
564ca972 JA |
101 | } |
102 | ||
d2835319 JA |
103 | split->nr = i; |
104 | return 0; | |
105 | } | |
106 | ||
107 | static int bssplit_ddir(struct thread_options *o, enum fio_ddir ddir, char *str) | |
108 | { | |
109 | unsigned int i, perc, perc_missing; | |
110 | unsigned int max_bs, min_bs; | |
111 | struct split split; | |
112 | ||
113 | memset(&split, 0, sizeof(split)); | |
114 | ||
115 | if (split_parse_ddir(o, &split, ddir, str)) | |
116 | return 1; | |
117 | if (!split.nr) | |
118 | return 0; | |
119 | ||
120 | max_bs = 0; | |
121 | min_bs = -1; | |
122 | o->bssplit[ddir] = malloc(split.nr * sizeof(struct bssplit)); | |
123 | o->bssplit_nr[ddir] = split.nr; | |
124 | for (i = 0; i < split.nr; i++) { | |
125 | if (split.val1[i] > max_bs) | |
126 | max_bs = split.val1[i]; | |
127 | if (split.val1[i] < min_bs) | |
128 | min_bs = split.val1[i]; | |
129 | ||
130 | o->bssplit[ddir][i].bs = split.val1[i]; | |
131 | o->bssplit[ddir][i].perc =split.val2[i]; | |
132 | } | |
564ca972 JA |
133 | |
134 | /* | |
135 | * Now check if the percentages add up, and how much is missing | |
136 | */ | |
137 | perc = perc_missing = 0; | |
83ea422a | 138 | for (i = 0; i < o->bssplit_nr[ddir]; i++) { |
d2835319 | 139 | struct bssplit *bsp = &o->bssplit[ddir][i]; |
564ca972 | 140 | |
d711cce5 | 141 | if (bsp->perc == -1U) |
564ca972 JA |
142 | perc_missing++; |
143 | else | |
144 | perc += bsp->perc; | |
145 | } | |
146 | ||
40bafa33 | 147 | if (perc > 100 && perc_missing > 1) { |
564ca972 | 148 | log_err("fio: bssplit percentages add to more than 100%%\n"); |
d2835319 JA |
149 | free(o->bssplit[ddir]); |
150 | o->bssplit[ddir] = NULL; | |
564ca972 JA |
151 | return 1; |
152 | } | |
d711cce5 | 153 | |
564ca972 JA |
154 | /* |
155 | * If values didn't have a percentage set, divide the remains between | |
156 | * them. | |
157 | */ | |
158 | if (perc_missing) { | |
d711cce5 | 159 | if (perc_missing == 1 && o->bssplit_nr[ddir] == 1) |
40bafa33 | 160 | perc = 100; |
83ea422a | 161 | for (i = 0; i < o->bssplit_nr[ddir]; i++) { |
d2835319 | 162 | struct bssplit *bsp = &o->bssplit[ddir][i]; |
564ca972 | 163 | |
d711cce5 | 164 | if (bsp->perc == -1U) |
564ca972 JA |
165 | bsp->perc = (100 - perc) / perc_missing; |
166 | } | |
167 | } | |
168 | ||
83ea422a JA |
169 | o->min_bs[ddir] = min_bs; |
170 | o->max_bs[ddir] = max_bs; | |
564ca972 JA |
171 | |
172 | /* | |
173 | * now sort based on percentages, for ease of lookup | |
174 | */ | |
d2835319 | 175 | qsort(o->bssplit[ddir], o->bssplit_nr[ddir], sizeof(struct bssplit), bs_cmp); |
720e84ad | 176 | return 0; |
720e84ad JA |
177 | } |
178 | ||
764593c0 JA |
179 | typedef int (split_parse_fn)(struct thread_options *, enum fio_ddir, char *); |
180 | ||
181 | static int str_split_parse(struct thread_data *td, char *str, split_parse_fn *fn) | |
720e84ad | 182 | { |
764593c0 | 183 | char *odir, *ddir; |
720e84ad JA |
184 | int ret = 0; |
185 | ||
720e84ad JA |
186 | odir = strchr(str, ','); |
187 | if (odir) { | |
6eaf09d6 SL |
188 | ddir = strchr(odir + 1, ','); |
189 | if (ddir) { | |
764593c0 | 190 | ret = fn(&td->o, DDIR_TRIM, ddir + 1); |
6eaf09d6 SL |
191 | if (!ret) |
192 | *ddir = '\0'; | |
193 | } else { | |
194 | char *op; | |
195 | ||
196 | op = strdup(odir + 1); | |
764593c0 | 197 | ret = fn(&td->o, DDIR_TRIM, op); |
6eaf09d6 SL |
198 | |
199 | free(op); | |
200 | } | |
d79db122 | 201 | if (!ret) |
764593c0 | 202 | ret = fn(&td->o, DDIR_WRITE, odir + 1); |
720e84ad JA |
203 | if (!ret) { |
204 | *odir = '\0'; | |
764593c0 | 205 | ret = fn(&td->o, DDIR_READ, str); |
720e84ad JA |
206 | } |
207 | } else { | |
208 | char *op; | |
209 | ||
210 | op = strdup(str); | |
764593c0 | 211 | ret = fn(&td->o, DDIR_WRITE, op); |
6eaf09d6 | 212 | free(op); |
720e84ad | 213 | |
6eaf09d6 SL |
214 | if (!ret) { |
215 | op = strdup(str); | |
764593c0 | 216 | ret = fn(&td->o, DDIR_TRIM, op); |
6eaf09d6 SL |
217 | free(op); |
218 | } | |
f0c9c217 | 219 | if (!ret) |
764593c0 | 220 | ret = fn(&td->o, DDIR_READ, str); |
720e84ad | 221 | } |
564ca972 | 222 | |
764593c0 JA |
223 | return ret; |
224 | } | |
225 | ||
226 | static int str_bssplit_cb(void *data, const char *input) | |
227 | { | |
a609f12a | 228 | struct thread_data *td = cb_data_to_td(data); |
764593c0 JA |
229 | char *str, *p; |
230 | int ret = 0; | |
231 | ||
764593c0 JA |
232 | p = str = strdup(input); |
233 | ||
234 | strip_blank_front(&str); | |
235 | strip_blank_end(str); | |
236 | ||
237 | ret = str_split_parse(td, str, bssplit_ddir); | |
238 | ||
55baca06 JA |
239 | if (parse_dryrun()) { |
240 | int i; | |
241 | ||
242 | for (i = 0; i < DDIR_RWDIR_CNT; i++) { | |
243 | free(td->o.bssplit[i]); | |
244 | td->o.bssplit[i] = NULL; | |
245 | td->o.bssplit_nr[i] = 0; | |
246 | } | |
247 | } | |
248 | ||
564ca972 | 249 | free(p); |
720e84ad | 250 | return ret; |
564ca972 JA |
251 | } |
252 | ||
8b28bd41 DM |
253 | static int str2error(char *str) |
254 | { | |
a94eb99a | 255 | const char *err[] = { "EPERM", "ENOENT", "ESRCH", "EINTR", "EIO", |
8b28bd41 DM |
256 | "ENXIO", "E2BIG", "ENOEXEC", "EBADF", |
257 | "ECHILD", "EAGAIN", "ENOMEM", "EACCES", | |
258 | "EFAULT", "ENOTBLK", "EBUSY", "EEXIST", | |
259 | "EXDEV", "ENODEV", "ENOTDIR", "EISDIR", | |
260 | "EINVAL", "ENFILE", "EMFILE", "ENOTTY", | |
261 | "ETXTBSY","EFBIG", "ENOSPC", "ESPIPE", | |
a94eb99a | 262 | "EROFS","EMLINK", "EPIPE", "EDOM", "ERANGE" }; |
7fe481b4 | 263 | int i = 0, num = sizeof(err) / sizeof(char *); |
8b28bd41 | 264 | |
a94eb99a | 265 | while (i < num) { |
8b28bd41 DM |
266 | if (!strcmp(err[i], str)) |
267 | return i + 1; | |
268 | i++; | |
269 | } | |
270 | return 0; | |
271 | } | |
272 | ||
273 | static int ignore_error_type(struct thread_data *td, int etype, char *str) | |
274 | { | |
275 | unsigned int i; | |
276 | int *error; | |
277 | char *fname; | |
278 | ||
279 | if (etype >= ERROR_TYPE_CNT) { | |
280 | log_err("Illegal error type\n"); | |
281 | return 1; | |
282 | } | |
283 | ||
284 | td->o.ignore_error_nr[etype] = 4; | |
285 | error = malloc(4 * sizeof(struct bssplit)); | |
286 | ||
287 | i = 0; | |
288 | while ((fname = strsep(&str, ":")) != NULL) { | |
289 | ||
290 | if (!strlen(fname)) | |
291 | break; | |
292 | ||
293 | /* | |
294 | * grow struct buffer, if needed | |
295 | */ | |
296 | if (i == td->o.ignore_error_nr[etype]) { | |
297 | td->o.ignore_error_nr[etype] <<= 1; | |
298 | error = realloc(error, td->o.ignore_error_nr[etype] | |
299 | * sizeof(int)); | |
300 | } | |
301 | if (fname[0] == 'E') { | |
302 | error[i] = str2error(fname); | |
303 | } else { | |
304 | error[i] = atoi(fname); | |
305 | if (error[i] < 0) | |
1616e025 | 306 | error[i] = -error[i]; |
8b28bd41 DM |
307 | } |
308 | if (!error[i]) { | |
309 | log_err("Unknown error %s, please use number value \n", | |
310 | fname); | |
0fddbf7a | 311 | free(error); |
8b28bd41 DM |
312 | return 1; |
313 | } | |
314 | i++; | |
315 | } | |
316 | if (i) { | |
317 | td->o.continue_on_error |= 1 << etype; | |
318 | td->o.ignore_error_nr[etype] = i; | |
319 | td->o.ignore_error[etype] = error; | |
c7b086be JA |
320 | } else |
321 | free(error); | |
322 | ||
8b28bd41 DM |
323 | return 0; |
324 | ||
325 | } | |
326 | ||
327 | static int str_ignore_error_cb(void *data, const char *input) | |
328 | { | |
a609f12a | 329 | struct thread_data *td = cb_data_to_td(data); |
8b28bd41 DM |
330 | char *str, *p, *n; |
331 | int type = 0, ret = 1; | |
52c0cea3 JA |
332 | |
333 | if (parse_dryrun()) | |
334 | return 0; | |
335 | ||
8b28bd41 DM |
336 | p = str = strdup(input); |
337 | ||
338 | strip_blank_front(&str); | |
339 | strip_blank_end(str); | |
340 | ||
341 | while (p) { | |
342 | n = strchr(p, ','); | |
343 | if (n) | |
344 | *n++ = '\0'; | |
345 | ret = ignore_error_type(td, type, p); | |
346 | if (ret) | |
347 | break; | |
348 | p = n; | |
349 | type++; | |
350 | } | |
351 | free(str); | |
352 | return ret; | |
353 | } | |
354 | ||
211097b2 JA |
355 | static int str_rw_cb(void *data, const char *str) |
356 | { | |
a609f12a | 357 | struct thread_data *td = cb_data_to_td(data); |
83ea422a | 358 | struct thread_options *o = &td->o; |
27ca949f | 359 | char *nr; |
211097b2 | 360 | |
52c0cea3 JA |
361 | if (parse_dryrun()) |
362 | return 0; | |
363 | ||
83ea422a JA |
364 | o->ddir_seq_nr = 1; |
365 | o->ddir_seq_add = 0; | |
059b0802 | 366 | |
27ca949f | 367 | nr = get_opt_postfix(str); |
059b0802 JA |
368 | if (!nr) |
369 | return 0; | |
370 | ||
371 | if (td_random(td)) | |
83ea422a | 372 | o->ddir_seq_nr = atoi(nr); |
059b0802 JA |
373 | else { |
374 | long long val; | |
375 | ||
88038bc7 | 376 | if (str_to_decimal(nr, &val, 1, o, 0, 0)) { |
059b0802 JA |
377 | log_err("fio: rw postfix parsing failed\n"); |
378 | free(nr); | |
379 | return 1; | |
380 | } | |
381 | ||
83ea422a | 382 | o->ddir_seq_add = val; |
182ec6ee | 383 | } |
211097b2 | 384 | |
059b0802 | 385 | free(nr); |
211097b2 JA |
386 | return 0; |
387 | } | |
388 | ||
214e1eca JA |
389 | static int str_mem_cb(void *data, const char *mem) |
390 | { | |
a609f12a | 391 | struct thread_data *td = cb_data_to_td(data); |
214e1eca | 392 | |
217b0f1d LG |
393 | if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP || |
394 | td->o.mem_type == MEM_MMAPSHARED) | |
836fcc0f | 395 | td->o.mmapfile = get_opt_postfix(mem); |
214e1eca JA |
396 | |
397 | return 0; | |
398 | } | |
399 | ||
c223da83 JA |
400 | static int fio_clock_source_cb(void *data, const char *str) |
401 | { | |
a609f12a | 402 | struct thread_data *td = cb_data_to_td(data); |
c223da83 JA |
403 | |
404 | fio_clock_source = td->o.clocksource; | |
fa80feae | 405 | fio_clock_source_set = 1; |
01423eae | 406 | fio_clock_init(); |
c223da83 JA |
407 | return 0; |
408 | } | |
409 | ||
85bc833b | 410 | static int str_rwmix_read_cb(void *data, unsigned long long *val) |
cb499fc4 | 411 | { |
a609f12a | 412 | struct thread_data *td = cb_data_to_td(data); |
cb499fc4 JA |
413 | |
414 | td->o.rwmix[DDIR_READ] = *val; | |
415 | td->o.rwmix[DDIR_WRITE] = 100 - *val; | |
416 | return 0; | |
417 | } | |
418 | ||
85bc833b | 419 | static int str_rwmix_write_cb(void *data, unsigned long long *val) |
cb499fc4 | 420 | { |
a609f12a | 421 | struct thread_data *td = cb_data_to_td(data); |
cb499fc4 JA |
422 | |
423 | td->o.rwmix[DDIR_WRITE] = *val; | |
424 | td->o.rwmix[DDIR_READ] = 100 - *val; | |
425 | return 0; | |
426 | } | |
427 | ||
214e1eca JA |
428 | static int str_exitall_cb(void) |
429 | { | |
430 | exitall_on_terminate = 1; | |
431 | return 0; | |
432 | } | |
433 | ||
214e1eca | 434 | #ifdef FIO_HAVE_CPU_AFFINITY |
50b5860b | 435 | int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index) |
c2acfbac | 436 | { |
50b5860b | 437 | unsigned int i, index, cpus_in_mask; |
c2acfbac | 438 | const long max_cpu = cpus_online(); |
c2acfbac | 439 | |
50b5860b JA |
440 | cpus_in_mask = fio_cpu_count(mask); |
441 | cpu_index = cpu_index % cpus_in_mask; | |
442 | ||
443 | index = 0; | |
c2acfbac | 444 | for (i = 0; i < max_cpu; i++) { |
50b5860b | 445 | if (!fio_cpu_isset(mask, i)) |
c2acfbac | 446 | continue; |
50b5860b JA |
447 | |
448 | if (cpu_index != index) | |
449 | fio_cpu_clear(mask, i); | |
450 | ||
451 | index++; | |
c2acfbac JA |
452 | } |
453 | ||
454 | return fio_cpu_count(mask); | |
455 | } | |
456 | ||
85bc833b | 457 | static int str_cpumask_cb(void *data, unsigned long long *val) |
d2e268b0 | 458 | { |
a609f12a | 459 | struct thread_data *td = cb_data_to_td(data); |
214e1eca | 460 | unsigned int i; |
b03daafb | 461 | long max_cpu; |
d2ce18b5 JA |
462 | int ret; |
463 | ||
52c0cea3 JA |
464 | if (parse_dryrun()) |
465 | return 0; | |
466 | ||
d2ce18b5 JA |
467 | ret = fio_cpuset_init(&td->o.cpumask); |
468 | if (ret < 0) { | |
469 | log_err("fio: cpuset_init failed\n"); | |
470 | td_verror(td, ret, "fio_cpuset_init"); | |
471 | return 1; | |
472 | } | |
214e1eca | 473 | |
c00a2289 | 474 | max_cpu = cpus_online(); |
214e1eca | 475 | |
62a7273d JA |
476 | for (i = 0; i < sizeof(int) * 8; i++) { |
477 | if ((1 << i) & *val) { | |
b8411399 | 478 | if (i >= max_cpu) { |
b03daafb | 479 | log_err("fio: CPU %d too large (max=%ld)\n", i, |
b8411399 | 480 | max_cpu - 1); |
b03daafb JA |
481 | return 1; |
482 | } | |
62a7273d | 483 | dprint(FD_PARSE, "set cpu allowed %d\n", i); |
6d459ee7 | 484 | fio_cpu_set(&td->o.cpumask, i); |
62a7273d JA |
485 | } |
486 | } | |
d2e268b0 | 487 | |
d2e268b0 | 488 | return 0; |
214e1eca JA |
489 | } |
490 | ||
e8462bd8 JA |
491 | static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask, |
492 | const char *input) | |
214e1eca | 493 | { |
d2e268b0 | 494 | char *cpu, *str, *p; |
b03daafb | 495 | long max_cpu; |
19608d6c | 496 | int ret = 0; |
d2e268b0 | 497 | |
e8462bd8 | 498 | ret = fio_cpuset_init(mask); |
d2ce18b5 JA |
499 | if (ret < 0) { |
500 | log_err("fio: cpuset_init failed\n"); | |
501 | td_verror(td, ret, "fio_cpuset_init"); | |
502 | return 1; | |
503 | } | |
d2e268b0 JA |
504 | |
505 | p = str = strdup(input); | |
214e1eca | 506 | |
d2e268b0 JA |
507 | strip_blank_front(&str); |
508 | strip_blank_end(str); | |
509 | ||
c00a2289 | 510 | max_cpu = cpus_online(); |
b03daafb | 511 | |
d2e268b0 | 512 | while ((cpu = strsep(&str, ",")) != NULL) { |
62a7273d JA |
513 | char *str2, *cpu2; |
514 | int icpu, icpu2; | |
515 | ||
d2e268b0 JA |
516 | if (!strlen(cpu)) |
517 | break; | |
62a7273d JA |
518 | |
519 | str2 = cpu; | |
520 | icpu2 = -1; | |
521 | while ((cpu2 = strsep(&str2, "-")) != NULL) { | |
522 | if (!strlen(cpu2)) | |
523 | break; | |
524 | ||
525 | icpu2 = atoi(cpu2); | |
526 | } | |
527 | ||
528 | icpu = atoi(cpu); | |
529 | if (icpu2 == -1) | |
530 | icpu2 = icpu; | |
531 | while (icpu <= icpu2) { | |
6d459ee7 | 532 | if (icpu >= FIO_MAX_CPUS) { |
19608d6c | 533 | log_err("fio: your OS only supports up to" |
6d459ee7 | 534 | " %d CPUs\n", (int) FIO_MAX_CPUS); |
19608d6c JA |
535 | ret = 1; |
536 | break; | |
537 | } | |
9e986889 | 538 | if (icpu >= max_cpu) { |
b03daafb | 539 | log_err("fio: CPU %d too large (max=%ld)\n", |
9e986889 | 540 | icpu, max_cpu - 1); |
b03daafb JA |
541 | ret = 1; |
542 | break; | |
543 | } | |
0b9d69ec | 544 | |
62a7273d | 545 | dprint(FD_PARSE, "set cpu allowed %d\n", icpu); |
e8462bd8 | 546 | fio_cpu_set(mask, icpu); |
62a7273d JA |
547 | icpu++; |
548 | } | |
19608d6c JA |
549 | if (ret) |
550 | break; | |
d2e268b0 JA |
551 | } |
552 | ||
553 | free(p); | |
19608d6c | 554 | return ret; |
214e1eca | 555 | } |
e8462bd8 JA |
556 | |
557 | static int str_cpus_allowed_cb(void *data, const char *input) | |
558 | { | |
a609f12a | 559 | struct thread_data *td = cb_data_to_td(data); |
e8462bd8 | 560 | |
52c0cea3 JA |
561 | if (parse_dryrun()) |
562 | return 0; | |
563 | ||
b2a9e649 | 564 | return set_cpus_allowed(td, &td->o.cpumask, input); |
e8462bd8 JA |
565 | } |
566 | ||
567 | static int str_verify_cpus_allowed_cb(void *data, const char *input) | |
568 | { | |
a609f12a | 569 | struct thread_data *td = cb_data_to_td(data); |
e8462bd8 | 570 | |
466155e2 JA |
571 | if (parse_dryrun()) |
572 | return 0; | |
573 | ||
b2a9e649 | 574 | return set_cpus_allowed(td, &td->o.verify_cpumask, input); |
e8462bd8 | 575 | } |
c08f9fe2 | 576 | |
105157ad | 577 | #ifdef CONFIG_ZLIB |
c08f9fe2 JA |
578 | static int str_log_cpus_allowed_cb(void *data, const char *input) |
579 | { | |
a609f12a | 580 | struct thread_data *td = cb_data_to_td(data); |
c08f9fe2 JA |
581 | |
582 | if (parse_dryrun()) | |
583 | return 0; | |
584 | ||
585 | return set_cpus_allowed(td, &td->o.log_gz_cpumask, input); | |
586 | } | |
105157ad | 587 | #endif /* CONFIG_ZLIB */ |
c08f9fe2 | 588 | |
105157ad | 589 | #endif /* FIO_HAVE_CPU_AFFINITY */ |
214e1eca | 590 | |
67bf9823 | 591 | #ifdef CONFIG_LIBNUMA |
d0b937ed YR |
592 | static int str_numa_cpunodes_cb(void *data, char *input) |
593 | { | |
a609f12a | 594 | struct thread_data *td = cb_data_to_td(data); |
43522848 | 595 | struct bitmask *verify_bitmask; |
d0b937ed | 596 | |
52c0cea3 JA |
597 | if (parse_dryrun()) |
598 | return 0; | |
599 | ||
d0b937ed YR |
600 | /* numa_parse_nodestring() parses a character string list |
601 | * of nodes into a bit mask. The bit mask is allocated by | |
602 | * numa_allocate_nodemask(), so it should be freed by | |
603 | * numa_free_nodemask(). | |
604 | */ | |
43522848 DG |
605 | verify_bitmask = numa_parse_nodestring(input); |
606 | if (verify_bitmask == NULL) { | |
d0b937ed YR |
607 | log_err("fio: numa_parse_nodestring failed\n"); |
608 | td_verror(td, 1, "str_numa_cpunodes_cb"); | |
609 | return 1; | |
610 | } | |
43522848 | 611 | numa_free_nodemask(verify_bitmask); |
d0b937ed | 612 | |
43522848 | 613 | td->o.numa_cpunodes = strdup(input); |
d0b937ed YR |
614 | return 0; |
615 | } | |
616 | ||
617 | static int str_numa_mpol_cb(void *data, char *input) | |
618 | { | |
a609f12a | 619 | struct thread_data *td = cb_data_to_td(data); |
d0b937ed | 620 | const char * const policy_types[] = |
05d6f44b | 621 | { "default", "prefer", "bind", "interleave", "local", NULL }; |
d0b937ed | 622 | int i; |
52c0cea3 | 623 | char *nodelist; |
43522848 | 624 | struct bitmask *verify_bitmask; |
52c0cea3 JA |
625 | |
626 | if (parse_dryrun()) | |
627 | return 0; | |
d0b937ed | 628 | |
52c0cea3 | 629 | nodelist = strchr(input, ':'); |
d0b937ed YR |
630 | if (nodelist) { |
631 | /* NUL-terminate mode */ | |
632 | *nodelist++ = '\0'; | |
633 | } | |
634 | ||
635 | for (i = 0; i <= MPOL_LOCAL; i++) { | |
636 | if (!strcmp(input, policy_types[i])) { | |
637 | td->o.numa_mem_mode = i; | |
638 | break; | |
639 | } | |
640 | } | |
641 | if (i > MPOL_LOCAL) { | |
642 | log_err("fio: memory policy should be: default, prefer, bind, interleave, local\n"); | |
643 | goto out; | |
644 | } | |
645 | ||
646 | switch (td->o.numa_mem_mode) { | |
647 | case MPOL_PREFERRED: | |
648 | /* | |
649 | * Insist on a nodelist of one node only | |
650 | */ | |
651 | if (nodelist) { | |
652 | char *rest = nodelist; | |
653 | while (isdigit(*rest)) | |
654 | rest++; | |
655 | if (*rest) { | |
656 | log_err("fio: one node only for \'prefer\'\n"); | |
657 | goto out; | |
658 | } | |
659 | } else { | |
660 | log_err("fio: one node is needed for \'prefer\'\n"); | |
661 | goto out; | |
662 | } | |
663 | break; | |
664 | case MPOL_INTERLEAVE: | |
665 | /* | |
666 | * Default to online nodes with memory if no nodelist | |
667 | */ | |
668 | if (!nodelist) | |
669 | nodelist = strdup("all"); | |
670 | break; | |
671 | case MPOL_LOCAL: | |
672 | case MPOL_DEFAULT: | |
673 | /* | |
674 | * Don't allow a nodelist | |
675 | */ | |
676 | if (nodelist) { | |
677 | log_err("fio: NO nodelist for \'local\'\n"); | |
678 | goto out; | |
679 | } | |
680 | break; | |
681 | case MPOL_BIND: | |
682 | /* | |
683 | * Insist on a nodelist | |
684 | */ | |
685 | if (!nodelist) { | |
686 | log_err("fio: a nodelist is needed for \'bind\'\n"); | |
687 | goto out; | |
688 | } | |
689 | break; | |
690 | } | |
691 | ||
692 | ||
693 | /* numa_parse_nodestring() parses a character string list | |
694 | * of nodes into a bit mask. The bit mask is allocated by | |
695 | * numa_allocate_nodemask(), so it should be freed by | |
696 | * numa_free_nodemask(). | |
697 | */ | |
698 | switch (td->o.numa_mem_mode) { | |
699 | case MPOL_PREFERRED: | |
700 | td->o.numa_mem_prefer_node = atoi(nodelist); | |
701 | break; | |
702 | case MPOL_INTERLEAVE: | |
703 | case MPOL_BIND: | |
43522848 DG |
704 | verify_bitmask = numa_parse_nodestring(nodelist); |
705 | if (verify_bitmask == NULL) { | |
d0b937ed YR |
706 | log_err("fio: numa_parse_nodestring failed\n"); |
707 | td_verror(td, 1, "str_numa_memnodes_cb"); | |
708 | return 1; | |
709 | } | |
43522848 DG |
710 | td->o.numa_memnodes = strdup(nodelist); |
711 | numa_free_nodemask(verify_bitmask); | |
b74e419e | 712 | |
d0b937ed YR |
713 | break; |
714 | case MPOL_LOCAL: | |
715 | case MPOL_DEFAULT: | |
716 | default: | |
717 | break; | |
718 | } | |
719 | ||
d0b937ed | 720 | return 0; |
d0b937ed YR |
721 | out: |
722 | return 1; | |
723 | } | |
724 | #endif | |
725 | ||
214e1eca JA |
726 | static int str_fst_cb(void *data, const char *str) |
727 | { | |
a609f12a | 728 | struct thread_data *td = cb_data_to_td(data); |
8c07860d JA |
729 | double val; |
730 | bool done = false; | |
731 | char *nr; | |
214e1eca JA |
732 | |
733 | td->file_service_nr = 1; | |
8c07860d JA |
734 | |
735 | switch (td->o.file_service_type) { | |
736 | case FIO_FSERVICE_RANDOM: | |
737 | case FIO_FSERVICE_RR: | |
738 | case FIO_FSERVICE_SEQ: | |
739 | nr = get_opt_postfix(str); | |
740 | if (nr) { | |
741 | td->file_service_nr = atoi(nr); | |
742 | free(nr); | |
743 | } | |
744 | done = true; | |
745 | break; | |
746 | case FIO_FSERVICE_ZIPF: | |
747 | val = FIO_DEF_ZIPF; | |
748 | break; | |
749 | case FIO_FSERVICE_PARETO: | |
750 | val = FIO_DEF_PARETO; | |
751 | break; | |
752 | case FIO_FSERVICE_GAUSS: | |
753 | val = 0.0; | |
754 | break; | |
755 | default: | |
756 | log_err("fio: bad file service type: %d\n", td->o.file_service_type); | |
757 | return 1; | |
758 | } | |
759 | ||
760 | if (done) | |
761 | return 0; | |
762 | ||
763 | nr = get_opt_postfix(str); | |
764 | if (nr && !str_to_float(nr, &val, 0)) { | |
765 | log_err("fio: file service type random postfix parsing failed\n"); | |
182ec6ee | 766 | free(nr); |
8c07860d JA |
767 | return 1; |
768 | } | |
769 | ||
770 | free(nr); | |
771 | ||
772 | switch (td->o.file_service_type) { | |
773 | case FIO_FSERVICE_ZIPF: | |
774 | if (val == 1.00) { | |
775 | log_err("fio: zipf theta must be different than 1.0\n"); | |
776 | return 1; | |
777 | } | |
778 | if (parse_dryrun()) | |
779 | return 0; | |
780 | td->zipf_theta = val; | |
781 | break; | |
782 | case FIO_FSERVICE_PARETO: | |
783 | if (val <= 0.00 || val >= 1.00) { | |
784 | log_err("fio: pareto input out of range (0 < input < 1.0)\n"); | |
785 | return 1; | |
786 | } | |
787 | if (parse_dryrun()) | |
788 | return 0; | |
789 | td->pareto_h = val; | |
790 | break; | |
791 | case FIO_FSERVICE_GAUSS: | |
792 | if (val < 0.00 || val >= 100.00) { | |
99c94a6b | 793 | log_err("fio: normal deviation out of range (0 <= input < 100.0)\n"); |
8c07860d JA |
794 | return 1; |
795 | } | |
796 | if (parse_dryrun()) | |
797 | return 0; | |
798 | td->gauss_dev = val; | |
799 | break; | |
182ec6ee | 800 | } |
214e1eca JA |
801 | |
802 | return 0; | |
803 | } | |
804 | ||
67bf9823 | 805 | #ifdef CONFIG_SYNC_FILE_RANGE |
44f29692 JA |
806 | static int str_sfr_cb(void *data, const char *str) |
807 | { | |
a609f12a | 808 | struct thread_data *td = cb_data_to_td(data); |
44f29692 JA |
809 | char *nr = get_opt_postfix(str); |
810 | ||
811 | td->sync_file_range_nr = 1; | |
812 | if (nr) { | |
813 | td->sync_file_range_nr = atoi(nr); | |
814 | free(nr); | |
815 | } | |
816 | ||
817 | return 0; | |
818 | } | |
3ae06371 | 819 | #endif |
44f29692 | 820 | |
e0a04ac1 JA |
821 | static int zone_cmp(const void *p1, const void *p2) |
822 | { | |
823 | const struct zone_split *zsp1 = p1; | |
824 | const struct zone_split *zsp2 = p2; | |
825 | ||
826 | return (int) zsp2->access_perc - (int) zsp1->access_perc; | |
827 | } | |
828 | ||
764593c0 JA |
829 | static int zone_split_ddir(struct thread_options *o, enum fio_ddir ddir, |
830 | char *str) | |
e0a04ac1 | 831 | { |
e0a04ac1 | 832 | unsigned int i, perc, perc_missing, sperc, sperc_missing; |
d2835319 | 833 | struct split split; |
e0a04ac1 | 834 | |
d2835319 | 835 | memset(&split, 0, sizeof(split)); |
e0a04ac1 | 836 | |
d2835319 JA |
837 | if (split_parse_ddir(o, &split, ddir, str)) |
838 | return 1; | |
839 | if (!split.nr) | |
840 | return 0; | |
e0a04ac1 | 841 | |
d2835319 JA |
842 | o->zone_split[ddir] = malloc(split.nr * sizeof(struct zone_split)); |
843 | o->zone_split_nr[ddir] = split.nr; | |
844 | for (i = 0; i < split.nr; i++) { | |
845 | o->zone_split[ddir][i].access_perc = split.val1[i]; | |
846 | o->zone_split[ddir][i].size_perc = split.val2[i]; | |
e0a04ac1 JA |
847 | } |
848 | ||
e0a04ac1 JA |
849 | /* |
850 | * Now check if the percentages add up, and how much is missing | |
851 | */ | |
852 | perc = perc_missing = 0; | |
853 | sperc = sperc_missing = 0; | |
854 | for (i = 0; i < o->zone_split_nr[ddir]; i++) { | |
d2835319 | 855 | struct zone_split *zsp = &o->zone_split[ddir][i]; |
e0a04ac1 JA |
856 | |
857 | if (zsp->access_perc == (uint8_t) -1U) | |
858 | perc_missing++; | |
859 | else | |
860 | perc += zsp->access_perc; | |
861 | ||
862 | if (zsp->size_perc == (uint8_t) -1U) | |
863 | sperc_missing++; | |
864 | else | |
865 | sperc += zsp->size_perc; | |
866 | ||
867 | } | |
868 | ||
869 | if (perc > 100 || sperc > 100) { | |
870 | log_err("fio: zone_split percentages add to more than 100%%\n"); | |
d2835319 JA |
871 | free(o->zone_split[ddir]); |
872 | o->zone_split[ddir] = NULL; | |
e0a04ac1 JA |
873 | return 1; |
874 | } | |
875 | if (perc < 100) { | |
876 | log_err("fio: access percentage don't add up to 100 for zoned " | |
877 | "random distribution (got=%u)\n", perc); | |
d2835319 JA |
878 | free(o->zone_split[ddir]); |
879 | o->zone_split[ddir] = NULL; | |
e0a04ac1 JA |
880 | return 1; |
881 | } | |
882 | ||
883 | /* | |
884 | * If values didn't have a percentage set, divide the remains between | |
885 | * them. | |
886 | */ | |
887 | if (perc_missing) { | |
888 | if (perc_missing == 1 && o->zone_split_nr[ddir] == 1) | |
889 | perc = 100; | |
890 | for (i = 0; i < o->zone_split_nr[ddir]; i++) { | |
d2835319 | 891 | struct zone_split *zsp = &o->zone_split[ddir][i]; |
e0a04ac1 JA |
892 | |
893 | if (zsp->access_perc == (uint8_t) -1U) | |
894 | zsp->access_perc = (100 - perc) / perc_missing; | |
895 | } | |
896 | } | |
897 | if (sperc_missing) { | |
898 | if (sperc_missing == 1 && o->zone_split_nr[ddir] == 1) | |
899 | sperc = 100; | |
900 | for (i = 0; i < o->zone_split_nr[ddir]; i++) { | |
d2835319 | 901 | struct zone_split *zsp = &o->zone_split[ddir][i]; |
e0a04ac1 JA |
902 | |
903 | if (zsp->size_perc == (uint8_t) -1U) | |
904 | zsp->size_perc = (100 - sperc) / sperc_missing; | |
905 | } | |
906 | } | |
907 | ||
908 | /* | |
909 | * now sort based on percentages, for ease of lookup | |
910 | */ | |
d2835319 | 911 | qsort(o->zone_split[ddir], o->zone_split_nr[ddir], sizeof(struct zone_split), zone_cmp); |
e0a04ac1 JA |
912 | return 0; |
913 | } | |
914 | ||
915 | static void __td_zone_gen_index(struct thread_data *td, enum fio_ddir ddir) | |
916 | { | |
917 | unsigned int i, j, sprev, aprev; | |
918 | ||
919 | td->zone_state_index[ddir] = malloc(sizeof(struct zone_split_index) * 100); | |
920 | ||
921 | sprev = aprev = 0; | |
922 | for (i = 0; i < td->o.zone_split_nr[ddir]; i++) { | |
923 | struct zone_split *zsp = &td->o.zone_split[ddir][i]; | |
924 | ||
925 | for (j = aprev; j < aprev + zsp->access_perc; j++) { | |
926 | struct zone_split_index *zsi = &td->zone_state_index[ddir][j]; | |
927 | ||
928 | zsi->size_perc = sprev + zsp->size_perc; | |
929 | zsi->size_perc_prev = sprev; | |
930 | } | |
931 | ||
932 | aprev += zsp->access_perc; | |
933 | sprev += zsp->size_perc; | |
934 | } | |
935 | } | |
936 | ||
937 | /* | |
938 | * Generate state table for indexes, so we don't have to do it inline from | |
939 | * the hot IO path | |
940 | */ | |
941 | static void td_zone_gen_index(struct thread_data *td) | |
942 | { | |
943 | int i; | |
944 | ||
945 | td->zone_state_index = malloc(DDIR_RWDIR_CNT * | |
946 | sizeof(struct zone_split_index *)); | |
947 | ||
948 | for (i = 0; i < DDIR_RWDIR_CNT; i++) | |
949 | __td_zone_gen_index(td, i); | |
950 | } | |
951 | ||
e0a04ac1 JA |
952 | static int parse_zoned_distribution(struct thread_data *td, const char *input) |
953 | { | |
764593c0 | 954 | char *str, *p; |
e0a04ac1 JA |
955 | int i, ret = 0; |
956 | ||
957 | p = str = strdup(input); | |
958 | ||
959 | strip_blank_front(&str); | |
960 | strip_blank_end(str); | |
961 | ||
962 | /* We expect it to start like that, bail if not */ | |
963 | if (strncmp(str, "zoned:", 6)) { | |
964 | log_err("fio: mismatch in zoned input <%s>\n", str); | |
965 | free(p); | |
966 | return 1; | |
967 | } | |
968 | str += strlen("zoned:"); | |
969 | ||
764593c0 | 970 | ret = str_split_parse(td, str, zone_split_ddir); |
e0a04ac1 JA |
971 | |
972 | free(p); | |
973 | ||
974 | for (i = 0; i < DDIR_RWDIR_CNT; i++) { | |
975 | int j; | |
976 | ||
977 | dprint(FD_PARSE, "zone ddir %d (nr=%u): \n", i, td->o.zone_split_nr[i]); | |
978 | ||
979 | for (j = 0; j < td->o.zone_split_nr[i]; j++) { | |
980 | struct zone_split *zsp = &td->o.zone_split[i][j]; | |
981 | ||
982 | dprint(FD_PARSE, "\t%d: %u/%u\n", j, zsp->access_perc, | |
983 | zsp->size_perc); | |
984 | } | |
985 | } | |
986 | ||
55baca06 JA |
987 | if (parse_dryrun()) { |
988 | int i; | |
989 | ||
990 | for (i = 0; i < DDIR_RWDIR_CNT; i++) { | |
991 | free(td->o.zone_split[i]); | |
992 | td->o.zone_split[i] = NULL; | |
993 | td->o.zone_split_nr[i] = 0; | |
994 | } | |
995 | ||
996 | return ret; | |
997 | } | |
998 | ||
e0a04ac1 JA |
999 | if (!ret) |
1000 | td_zone_gen_index(td); | |
dc4bffb8 JA |
1001 | else { |
1002 | for (i = 0; i < DDIR_RWDIR_CNT; i++) | |
1003 | td->o.zone_split_nr[i] = 0; | |
1004 | } | |
e0a04ac1 JA |
1005 | |
1006 | return ret; | |
1007 | } | |
1008 | ||
e25839d4 JA |
1009 | static int str_random_distribution_cb(void *data, const char *str) |
1010 | { | |
a609f12a | 1011 | struct thread_data *td = cb_data_to_td(data); |
e25839d4 JA |
1012 | double val; |
1013 | char *nr; | |
1014 | ||
925fee33 | 1015 | if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) |
c95f9404 | 1016 | val = FIO_DEF_ZIPF; |
925fee33 | 1017 | else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) |
c95f9404 | 1018 | val = FIO_DEF_PARETO; |
56d9fa4b JA |
1019 | else if (td->o.random_distribution == FIO_RAND_DIST_GAUSS) |
1020 | val = 0.0; | |
e0a04ac1 JA |
1021 | else if (td->o.random_distribution == FIO_RAND_DIST_ZONED) |
1022 | return parse_zoned_distribution(td, str); | |
925fee33 | 1023 | else |
e25839d4 JA |
1024 | return 0; |
1025 | ||
1026 | nr = get_opt_postfix(str); | |
88038bc7 | 1027 | if (nr && !str_to_float(nr, &val, 0)) { |
e25839d4 JA |
1028 | log_err("fio: random postfix parsing failed\n"); |
1029 | free(nr); | |
1030 | return 1; | |
1031 | } | |
1032 | ||
078189c1 JA |
1033 | free(nr); |
1034 | ||
18ded917 JA |
1035 | if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) { |
1036 | if (val == 1.00) { | |
1037 | log_err("fio: zipf theta must different than 1.0\n"); | |
1038 | return 1; | |
1039 | } | |
55baca06 JA |
1040 | if (parse_dryrun()) |
1041 | return 0; | |
1e5324e7 | 1042 | td->o.zipf_theta.u.f = val; |
56d9fa4b | 1043 | } else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) { |
078189c1 JA |
1044 | if (val <= 0.00 || val >= 1.00) { |
1045 | log_err("fio: pareto input out of range (0 < input < 1.0)\n"); | |
1046 | return 1; | |
1047 | } | |
55baca06 JA |
1048 | if (parse_dryrun()) |
1049 | return 0; | |
1e5324e7 | 1050 | td->o.pareto_h.u.f = val; |
3cdb8cf3 | 1051 | } else { |
76527b19 | 1052 | if (val < 0.00 || val >= 100.0) { |
99c94a6b | 1053 | log_err("fio: normal deviation out of range (0 <= input < 100.0)\n"); |
3cdb8cf3 JA |
1054 | return 1; |
1055 | } | |
55baca06 JA |
1056 | if (parse_dryrun()) |
1057 | return 0; | |
f88cd222 | 1058 | td->o.gauss_dev.u.f = val; |
3cdb8cf3 | 1059 | } |
921c766f JA |
1060 | |
1061 | return 0; | |
1062 | } | |
1063 | ||
16e56d25 VF |
1064 | static int str_steadystate_cb(void *data, const char *str) |
1065 | { | |
94f218f6 | 1066 | struct thread_data *td = cb_data_to_td(data); |
16e56d25 VF |
1067 | double val; |
1068 | char *nr; | |
1069 | char *pct; | |
1070 | long long ll; | |
1071 | ||
2c5d94bc VF |
1072 | if (td->o.ss_state != FIO_SS_IOPS && td->o.ss_state != FIO_SS_IOPS_SLOPE && |
1073 | td->o.ss_state != FIO_SS_BW && td->o.ss_state != FIO_SS_BW_SLOPE) { | |
16e56d25 VF |
1074 | /* should be impossible to get here */ |
1075 | log_err("fio: unknown steady state criterion\n"); | |
1076 | return 1; | |
1077 | } | |
1078 | ||
1079 | nr = get_opt_postfix(str); | |
1080 | if (!nr) { | |
1081 | log_err("fio: steadystate threshold must be specified in addition to criterion\n"); | |
1082 | free(nr); | |
1083 | return 1; | |
1084 | } | |
1085 | ||
1086 | /* ENHANCEMENT Allow fio to understand size=10.2% and use here */ | |
1087 | pct = strstr(nr, "%"); | |
1088 | if (pct) { | |
1089 | *pct = '\0'; | |
1090 | strip_blank_end(nr); | |
1091 | if (!str_to_float(nr, &val, 0)) { | |
1092 | log_err("fio: could not parse steadystate threshold percentage\n"); | |
1093 | free(nr); | |
1094 | return 1; | |
1095 | } | |
1096 | ||
1097 | dprint(FD_PARSE, "set steady state threshold to %f%%\n", val); | |
1098 | free(nr); | |
1099 | if (parse_dryrun()) | |
1100 | return 0; | |
1101 | ||
2c5d94bc | 1102 | td->o.ss_state |= __FIO_SS_PCT; |
16e56d25 | 1103 | td->o.ss_limit.u.f = val; |
2c5d94bc | 1104 | } else if (td->o.ss_state & __FIO_SS_IOPS) { |
16e56d25 VF |
1105 | if (!str_to_float(nr, &val, 0)) { |
1106 | log_err("fio: steadystate IOPS threshold postfix parsing failed\n"); | |
1107 | free(nr); | |
1108 | return 1; | |
1109 | } | |
1110 | ||
1111 | dprint(FD_PARSE, "set steady state IOPS threshold to %f\n", val); | |
1112 | free(nr); | |
1113 | if (parse_dryrun()) | |
1114 | return 0; | |
1115 | ||
16e56d25 | 1116 | td->o.ss_limit.u.f = val; |
16e56d25 VF |
1117 | } else { /* bandwidth criterion */ |
1118 | if (str_to_decimal(nr, &ll, 1, td, 0, 0)) { | |
1119 | log_err("fio: steadystate BW threshold postfix parsing failed\n"); | |
1120 | free(nr); | |
1121 | return 1; | |
1122 | } | |
1123 | ||
1124 | dprint(FD_PARSE, "set steady state BW threshold to %lld\n", ll); | |
1125 | free(nr); | |
1126 | if (parse_dryrun()) | |
1127 | return 0; | |
1128 | ||
16e56d25 | 1129 | td->o.ss_limit.u.f = (double) ll; |
16e56d25 VF |
1130 | } |
1131 | ||
2c5d94bc | 1132 | td->ss.state = td->o.ss_state; |
16e56d25 VF |
1133 | return 0; |
1134 | } | |
1135 | ||
8e827d35 | 1136 | /* |
bcbfeefa | 1137 | * Return next name in the string. Files are separated with ':'. If the ':' |
8e827d35 JA |
1138 | * is escaped with a '\', then that ':' is part of the filename and does not |
1139 | * indicate a new file. | |
1140 | */ | |
bcbfeefa | 1141 | static char *get_next_name(char **ptr) |
8e827d35 JA |
1142 | { |
1143 | char *str = *ptr; | |
1144 | char *p, *start; | |
1145 | ||
1146 | if (!str || !strlen(str)) | |
1147 | return NULL; | |
1148 | ||
1149 | start = str; | |
1150 | do { | |
1151 | /* | |
1152 | * No colon, we are done | |
1153 | */ | |
1154 | p = strchr(str, ':'); | |
1155 | if (!p) { | |
1156 | *ptr = NULL; | |
1157 | break; | |
1158 | } | |
1159 | ||
1160 | /* | |
1161 | * We got a colon, but it's the first character. Skip and | |
1162 | * continue | |
1163 | */ | |
1164 | if (p == start) { | |
1165 | str = ++start; | |
1166 | continue; | |
1167 | } | |
1168 | ||
1169 | if (*(p - 1) != '\\') { | |
1170 | *p = '\0'; | |
1171 | *ptr = p + 1; | |
1172 | break; | |
1173 | } | |
1174 | ||
1175 | memmove(p - 1, p, strlen(p) + 1); | |
1176 | str = p; | |
1177 | } while (1); | |
1178 | ||
1179 | return start; | |
1180 | } | |
1181 | ||
bcbfeefa CE |
1182 | |
1183 | static int get_max_name_idx(char *input) | |
1184 | { | |
1185 | unsigned int cur_idx; | |
1186 | char *str, *p; | |
1187 | ||
1188 | p = str = strdup(input); | |
1189 | for (cur_idx = 0; ; cur_idx++) | |
1190 | if (get_next_name(&str) == NULL) | |
1191 | break; | |
1192 | ||
1193 | free(p); | |
1194 | return cur_idx; | |
1195 | } | |
1196 | ||
1197 | /* | |
1198 | * Returns the directory at the index, indexes > entires will be | |
1199 | * assigned via modulo division of the index | |
1200 | */ | |
922a5be8 JA |
1201 | int set_name_idx(char *target, size_t tlen, char *input, int index, |
1202 | bool unique_filename) | |
bcbfeefa CE |
1203 | { |
1204 | unsigned int cur_idx; | |
1205 | int len; | |
1206 | char *fname, *str, *p; | |
1207 | ||
1208 | p = str = strdup(input); | |
1209 | ||
1210 | index %= get_max_name_idx(input); | |
1211 | for (cur_idx = 0; cur_idx <= index; cur_idx++) | |
1212 | fname = get_next_name(&str); | |
1213 | ||
922a5be8 | 1214 | if (client_sockaddr_str[0] && unique_filename) { |
e13c3b50 JA |
1215 | len = snprintf(target, tlen, "%s/%s.", fname, |
1216 | client_sockaddr_str); | |
1217 | } else | |
1218 | len = snprintf(target, tlen, "%s/", fname); | |
72a703da | 1219 | |
e13c3b50 | 1220 | target[tlen - 1] = '\0'; |
bcbfeefa CE |
1221 | free(p); |
1222 | ||
1223 | return len; | |
1224 | } | |
1225 | ||
214e1eca JA |
1226 | static int str_filename_cb(void *data, const char *input) |
1227 | { | |
a609f12a | 1228 | struct thread_data *td = cb_data_to_td(data); |
214e1eca JA |
1229 | char *fname, *str, *p; |
1230 | ||
1231 | p = str = strdup(input); | |
1232 | ||
1233 | strip_blank_front(&str); | |
1234 | strip_blank_end(str); | |
1235 | ||
79591fa9 TK |
1236 | /* |
1237 | * Ignore what we may already have from nrfiles option. | |
1238 | */ | |
214e1eca | 1239 | if (!td->files_index) |
2dc1bbeb | 1240 | td->o.nr_files = 0; |
214e1eca | 1241 | |
bcbfeefa | 1242 | while ((fname = get_next_name(&str)) != NULL) { |
214e1eca JA |
1243 | if (!strlen(fname)) |
1244 | break; | |
5903e7b7 | 1245 | add_file(td, fname, 0, 1); |
214e1eca JA |
1246 | } |
1247 | ||
1248 | free(p); | |
1249 | return 0; | |
1250 | } | |
1251 | ||
bcbfeefa | 1252 | static int str_directory_cb(void *data, const char fio_unused *unused) |
214e1eca | 1253 | { |
a609f12a | 1254 | struct thread_data *td = cb_data_to_td(data); |
214e1eca | 1255 | struct stat sb; |
bcbfeefa CE |
1256 | char *dirname, *str, *p; |
1257 | int ret = 0; | |
214e1eca | 1258 | |
f9633d72 JA |
1259 | if (parse_dryrun()) |
1260 | return 0; | |
1261 | ||
bcbfeefa CE |
1262 | p = str = strdup(td->o.directory); |
1263 | while ((dirname = get_next_name(&str)) != NULL) { | |
1264 | if (lstat(dirname, &sb) < 0) { | |
1265 | ret = errno; | |
921c766f | 1266 | |
bcbfeefa CE |
1267 | log_err("fio: %s is not a directory\n", dirname); |
1268 | td_verror(td, ret, "lstat"); | |
1269 | goto out; | |
1270 | } | |
1271 | if (!S_ISDIR(sb.st_mode)) { | |
1272 | log_err("fio: %s is not a directory\n", dirname); | |
1273 | ret = 1; | |
1274 | goto out; | |
1275 | } | |
214e1eca JA |
1276 | } |
1277 | ||
bcbfeefa CE |
1278 | out: |
1279 | free(p); | |
1280 | return ret; | |
214e1eca JA |
1281 | } |
1282 | ||
1283 | static int str_opendir_cb(void *data, const char fio_unused *str) | |
1284 | { | |
a609f12a | 1285 | struct thread_data *td = cb_data_to_td(data); |
214e1eca | 1286 | |
52c0cea3 JA |
1287 | if (parse_dryrun()) |
1288 | return 0; | |
1289 | ||
214e1eca | 1290 | if (!td->files_index) |
2dc1bbeb | 1291 | td->o.nr_files = 0; |
214e1eca | 1292 | |
2dc1bbeb | 1293 | return add_dir_files(td, td->o.opendir); |
214e1eca JA |
1294 | } |
1295 | ||
ce35b1ec JA |
1296 | static int str_buffer_pattern_cb(void *data, const char *input) |
1297 | { | |
a609f12a | 1298 | struct thread_data *td = cb_data_to_td(data); |
ce35b1ec JA |
1299 | int ret; |
1300 | ||
61b9861d RP |
1301 | /* FIXME: for now buffer pattern does not support formats */ |
1302 | ret = parse_and_fill_pattern(input, strlen(input), td->o.buffer_pattern, | |
1303 | MAX_PATTERN_SIZE, NULL, 0, NULL, NULL); | |
1304 | if (ret < 0) | |
1305 | return 1; | |
ce35b1ec | 1306 | |
61b9861d RP |
1307 | assert(ret != 0); |
1308 | td->o.buffer_pattern_bytes = ret; | |
1309 | if (!td->o.compress_percentage) | |
1310 | td->o.refill_buffers = 0; | |
1311 | td->o.scramble_buffers = 0; | |
1312 | td->o.zero_buffers = 0; | |
efcd9dcc | 1313 | |
61b9861d | 1314 | return 0; |
ce35b1ec JA |
1315 | } |
1316 | ||
bedc9dc2 JA |
1317 | static int str_buffer_compress_cb(void *data, unsigned long long *il) |
1318 | { | |
a609f12a | 1319 | struct thread_data *td = cb_data_to_td(data); |
bedc9dc2 JA |
1320 | |
1321 | td->flags |= TD_F_COMPRESS; | |
1322 | td->o.compress_percentage = *il; | |
1323 | return 0; | |
1324 | } | |
1325 | ||
5c94b008 JA |
1326 | static int str_dedupe_cb(void *data, unsigned long long *il) |
1327 | { | |
a609f12a | 1328 | struct thread_data *td = cb_data_to_td(data); |
5c94b008 JA |
1329 | |
1330 | td->flags |= TD_F_COMPRESS; | |
1331 | td->o.dedupe_percentage = *il; | |
1332 | td->o.refill_buffers = 1; | |
1333 | return 0; | |
1334 | } | |
1335 | ||
ce35b1ec JA |
1336 | static int str_verify_pattern_cb(void *data, const char *input) |
1337 | { | |
a609f12a | 1338 | struct thread_data *td = cb_data_to_td(data); |
ce35b1ec JA |
1339 | int ret; |
1340 | ||
61b9861d RP |
1341 | td->o.verify_fmt_sz = ARRAY_SIZE(td->o.verify_fmt); |
1342 | ret = parse_and_fill_pattern(input, strlen(input), td->o.verify_pattern, | |
4205998f JA |
1343 | MAX_PATTERN_SIZE, fmt_desc, sizeof(fmt_desc), |
1344 | td->o.verify_fmt, &td->o.verify_fmt_sz); | |
61b9861d RP |
1345 | if (ret < 0) |
1346 | return 1; | |
efcd9dcc | 1347 | |
61b9861d RP |
1348 | assert(ret != 0); |
1349 | td->o.verify_pattern_bytes = ret; | |
92bf48d5 | 1350 | /* |
b638d82f | 1351 | * VERIFY_* could already be set |
92bf48d5 | 1352 | */ |
61b9861d | 1353 | if (!fio_option_is_set(&td->o, verify)) |
92bf48d5 | 1354 | td->o.verify = VERIFY_PATTERN; |
efcd9dcc | 1355 | |
61b9861d | 1356 | return 0; |
90059d65 | 1357 | } |
214e1eca | 1358 | |
993bf48b JA |
1359 | static int str_gtod_reduce_cb(void *data, int *il) |
1360 | { | |
a609f12a | 1361 | struct thread_data *td = cb_data_to_td(data); |
993bf48b JA |
1362 | int val = *il; |
1363 | ||
02af0988 | 1364 | td->o.disable_lat = !!val; |
993bf48b JA |
1365 | td->o.disable_clat = !!val; |
1366 | td->o.disable_slat = !!val; | |
1367 | td->o.disable_bw = !!val; | |
0dc1bc03 | 1368 | td->o.clat_percentiles = !val; |
993bf48b JA |
1369 | if (val) |
1370 | td->tv_cache_mask = 63; | |
1371 | ||
1372 | return 0; | |
1373 | } | |
1374 | ||
7bb59102 JA |
1375 | static int str_size_cb(void *data, unsigned long long *__val) |
1376 | { | |
a609f12a | 1377 | struct thread_data *td = cb_data_to_td(data); |
7bb59102 JA |
1378 | unsigned long long v = *__val; |
1379 | ||
1380 | if (parse_is_percent(v)) { | |
1381 | td->o.size = 0; | |
1382 | td->o.size_percent = -1ULL - v; | |
1383 | } else | |
1384 | td->o.size = v; | |
1385 | ||
1386 | return 0; | |
1387 | } | |
1388 | ||
dded427c OS |
1389 | static int str_write_bw_log_cb(void *data, const char *str) |
1390 | { | |
1391 | struct thread_data *td = cb_data_to_td(data); | |
1392 | ||
1393 | if (str) | |
1394 | td->o.bw_log_file = strdup(str); | |
1395 | ||
1396 | td->o.write_bw_log = 1; | |
1397 | return 0; | |
1398 | } | |
1399 | ||
1400 | static int str_write_lat_log_cb(void *data, const char *str) | |
1401 | { | |
1402 | struct thread_data *td = cb_data_to_td(data); | |
1403 | ||
1404 | if (str) | |
1405 | td->o.lat_log_file = strdup(str); | |
1406 | ||
1407 | td->o.write_lat_log = 1; | |
1408 | return 0; | |
1409 | } | |
1410 | ||
1411 | static int str_write_iops_log_cb(void *data, const char *str) | |
1412 | { | |
1413 | struct thread_data *td = cb_data_to_td(data); | |
1414 | ||
1415 | if (str) | |
1416 | td->o.iops_log_file = strdup(str); | |
1417 | ||
1418 | td->o.write_iops_log = 1; | |
1419 | return 0; | |
1420 | } | |
1421 | ||
1422 | static int str_write_hist_log_cb(void *data, const char *str) | |
1423 | { | |
1424 | struct thread_data *td = cb_data_to_td(data); | |
1425 | ||
1426 | if (str) | |
1427 | td->o.hist_log_file = strdup(str); | |
1428 | ||
1429 | td->o.write_hist_log = 1; | |
1430 | return 0; | |
1431 | } | |
1432 | ||
896cac2a JA |
1433 | static int rw_verify(struct fio_option *o, void *data) |
1434 | { | |
a609f12a | 1435 | struct thread_data *td = cb_data_to_td(data); |
896cac2a JA |
1436 | |
1437 | if (read_only && td_write(td)) { | |
1438 | log_err("fio: job <%s> has write bit set, but fio is in" | |
1439 | " read-only mode\n", td->o.name); | |
1440 | return 1; | |
1441 | } | |
1442 | ||
1443 | return 0; | |
1444 | } | |
1445 | ||
276ca4f7 | 1446 | static int gtod_cpu_verify(struct fio_option *o, void *data) |
29d43ff9 | 1447 | { |
276ca4f7 | 1448 | #ifndef FIO_HAVE_CPU_AFFINITY |
a609f12a | 1449 | struct thread_data *td = cb_data_to_td(data); |
29d43ff9 | 1450 | |
29d43ff9 JA |
1451 | if (td->o.gtod_cpu) { |
1452 | log_err("fio: platform must support CPU affinity for" | |
1453 | "gettimeofday() offloading\n"); | |
1454 | return 1; | |
1455 | } | |
1456 | #endif | |
1457 | ||
1458 | return 0; | |
1459 | } | |
1460 | ||
214e1eca JA |
1461 | /* |
1462 | * Map of job/command line options | |
1463 | */ | |
9af4a244 | 1464 | struct fio_option fio_options[FIO_MAX_OPTS] = { |
214e1eca JA |
1465 | { |
1466 | .name = "description", | |
e8b0e958 | 1467 | .lname = "Description of job", |
214e1eca | 1468 | .type = FIO_OPT_STR_STORE, |
a609f12a | 1469 | .off1 = offsetof(struct thread_options, description), |
214e1eca | 1470 | .help = "Text job description", |
e8b0e958 | 1471 | .category = FIO_OPT_C_GENERAL, |
0626037e | 1472 | .group = FIO_OPT_G_DESC, |
214e1eca JA |
1473 | }, |
1474 | { | |
1475 | .name = "name", | |
e8b0e958 | 1476 | .lname = "Job name", |
214e1eca | 1477 | .type = FIO_OPT_STR_STORE, |
a609f12a | 1478 | .off1 = offsetof(struct thread_options, name), |
214e1eca | 1479 | .help = "Name of this job", |
e8b0e958 | 1480 | .category = FIO_OPT_C_GENERAL, |
0626037e | 1481 | .group = FIO_OPT_G_DESC, |
214e1eca | 1482 | }, |
9cc8cb91 AK |
1483 | { |
1484 | .name = "wait_for", | |
1485 | .lname = "Waitee name", | |
1486 | .type = FIO_OPT_STR_STORE, | |
a609f12a | 1487 | .off1 = offsetof(struct thread_options, wait_for), |
9cc8cb91 AK |
1488 | .help = "Name of the job this one wants to wait for before starting", |
1489 | .category = FIO_OPT_C_GENERAL, | |
1490 | .group = FIO_OPT_G_DESC, | |
1491 | }, | |
214e1eca JA |
1492 | { |
1493 | .name = "filename", | |
e8b0e958 | 1494 | .lname = "Filename(s)", |
214e1eca | 1495 | .type = FIO_OPT_STR_STORE, |
a609f12a | 1496 | .off1 = offsetof(struct thread_options, filename), |
214e1eca | 1497 | .cb = str_filename_cb, |
f0d524b0 | 1498 | .prio = -1, /* must come after "directory" */ |
214e1eca | 1499 | .help = "File(s) to use for the workload", |
e8b0e958 | 1500 | .category = FIO_OPT_C_FILE, |
0626037e | 1501 | .group = FIO_OPT_G_FILENAME, |
214e1eca | 1502 | }, |
90fef2d1 | 1503 | { |
e8b0e958 JA |
1504 | .name = "directory", |
1505 | .lname = "Directory", | |
1506 | .type = FIO_OPT_STR_STORE, | |
a609f12a | 1507 | .off1 = offsetof(struct thread_options, directory), |
e8b0e958 JA |
1508 | .cb = str_directory_cb, |
1509 | .help = "Directory to store files in", | |
1510 | .category = FIO_OPT_C_FILE, | |
0626037e | 1511 | .group = FIO_OPT_G_FILENAME, |
90fef2d1 | 1512 | }, |
de98bd30 JA |
1513 | { |
1514 | .name = "filename_format", | |
922a5be8 | 1515 | .lname = "Filename Format", |
de98bd30 | 1516 | .type = FIO_OPT_STR_STORE, |
a609f12a | 1517 | .off1 = offsetof(struct thread_options, filename_format), |
de98bd30 JA |
1518 | .prio = -1, /* must come after "directory" */ |
1519 | .help = "Override default $jobname.$jobnum.$filenum naming", | |
1520 | .def = "$jobname.$jobnum.$filenum", | |
93bb626a JA |
1521 | .category = FIO_OPT_C_FILE, |
1522 | .group = FIO_OPT_G_FILENAME, | |
ad705bcb | 1523 | }, |
922a5be8 JA |
1524 | { |
1525 | .name = "unique_filename", | |
1526 | .lname = "Unique Filename", | |
1527 | .type = FIO_OPT_BOOL, | |
a609f12a | 1528 | .off1 = offsetof(struct thread_options, unique_filename), |
922a5be8 JA |
1529 | .help = "For network clients, prefix file with source IP", |
1530 | .def = "1", | |
1531 | .category = FIO_OPT_C_FILE, | |
1532 | .group = FIO_OPT_G_FILENAME, | |
1533 | }, | |
29c1349f JA |
1534 | { |
1535 | .name = "lockfile", | |
e8b0e958 | 1536 | .lname = "Lockfile", |
4d4e80f2 | 1537 | .type = FIO_OPT_STR, |
a609f12a | 1538 | .off1 = offsetof(struct thread_options, file_lock_mode), |
29c1349f | 1539 | .help = "Lock file when doing IO to it", |
bc6a0a5d | 1540 | .prio = 1, |
29c1349f | 1541 | .parent = "filename", |
d71c154c | 1542 | .hide = 0, |
4d4e80f2 | 1543 | .def = "none", |
e8b0e958 | 1544 | .category = FIO_OPT_C_FILE, |
0626037e | 1545 | .group = FIO_OPT_G_FILENAME, |
4d4e80f2 JA |
1546 | .posval = { |
1547 | { .ival = "none", | |
1548 | .oval = FILE_LOCK_NONE, | |
1549 | .help = "No file locking", | |
1550 | }, | |
1551 | { .ival = "exclusive", | |
1552 | .oval = FILE_LOCK_EXCLUSIVE, | |
1553 | .help = "Exclusive file lock", | |
1554 | }, | |
1555 | { | |
1556 | .ival = "readwrite", | |
1557 | .oval = FILE_LOCK_READWRITE, | |
1558 | .help = "Read vs write lock", | |
1559 | }, | |
1560 | }, | |
29c1349f | 1561 | }, |
214e1eca JA |
1562 | { |
1563 | .name = "opendir", | |
e8b0e958 | 1564 | .lname = "Open directory", |
214e1eca | 1565 | .type = FIO_OPT_STR_STORE, |
a609f12a | 1566 | .off1 = offsetof(struct thread_options, opendir), |
214e1eca JA |
1567 | .cb = str_opendir_cb, |
1568 | .help = "Recursively add files from this directory and down", | |
e8b0e958 | 1569 | .category = FIO_OPT_C_FILE, |
0626037e | 1570 | .group = FIO_OPT_G_FILENAME, |
214e1eca JA |
1571 | }, |
1572 | { | |
1573 | .name = "rw", | |
e8b0e958 | 1574 | .lname = "Read/write", |
d3aad8f2 | 1575 | .alias = "readwrite", |
214e1eca | 1576 | .type = FIO_OPT_STR, |
211097b2 | 1577 | .cb = str_rw_cb, |
a609f12a | 1578 | .off1 = offsetof(struct thread_options, td_ddir), |
214e1eca JA |
1579 | .help = "IO direction", |
1580 | .def = "read", | |
896cac2a | 1581 | .verify = rw_verify, |
e8b0e958 | 1582 | .category = FIO_OPT_C_IO, |
0626037e | 1583 | .group = FIO_OPT_G_IO_BASIC, |
214e1eca JA |
1584 | .posval = { |
1585 | { .ival = "read", | |
1586 | .oval = TD_DDIR_READ, | |
1587 | .help = "Sequential read", | |
1588 | }, | |
1589 | { .ival = "write", | |
1590 | .oval = TD_DDIR_WRITE, | |
1591 | .help = "Sequential write", | |
1592 | }, | |
6eaf09d6 SL |
1593 | { .ival = "trim", |
1594 | .oval = TD_DDIR_TRIM, | |
1595 | .help = "Sequential trim", | |
1596 | }, | |
214e1eca JA |
1597 | { .ival = "randread", |
1598 | .oval = TD_DDIR_RANDREAD, | |
1599 | .help = "Random read", | |
1600 | }, | |
1601 | { .ival = "randwrite", | |
1602 | .oval = TD_DDIR_RANDWRITE, | |
1603 | .help = "Random write", | |
1604 | }, | |
6eaf09d6 SL |
1605 | { .ival = "randtrim", |
1606 | .oval = TD_DDIR_RANDTRIM, | |
1607 | .help = "Random trim", | |
1608 | }, | |
214e1eca JA |
1609 | { .ival = "rw", |
1610 | .oval = TD_DDIR_RW, | |
1611 | .help = "Sequential read and write mix", | |
1612 | }, | |
10b023db JA |
1613 | { .ival = "readwrite", |
1614 | .oval = TD_DDIR_RW, | |
1615 | .help = "Sequential read and write mix", | |
1616 | }, | |
214e1eca JA |
1617 | { .ival = "randrw", |
1618 | .oval = TD_DDIR_RANDRW, | |
1619 | .help = "Random read and write mix" | |
1620 | }, | |
82a90686 JA |
1621 | { .ival = "trimwrite", |
1622 | .oval = TD_DDIR_TRIMWRITE, | |
1623 | .help = "Trim and write mix, trims preceding writes" | |
0e4dd95c | 1624 | }, |
214e1eca JA |
1625 | }, |
1626 | }, | |
38dad62d JA |
1627 | { |
1628 | .name = "rw_sequencer", | |
e8b0e958 | 1629 | .lname = "RW Sequencer", |
38dad62d | 1630 | .type = FIO_OPT_STR, |
a609f12a | 1631 | .off1 = offsetof(struct thread_options, rw_seq), |
38dad62d JA |
1632 | .help = "IO offset generator modifier", |
1633 | .def = "sequential", | |
e8b0e958 | 1634 | .category = FIO_OPT_C_IO, |
0626037e | 1635 | .group = FIO_OPT_G_IO_BASIC, |
38dad62d JA |
1636 | .posval = { |
1637 | { .ival = "sequential", | |
1638 | .oval = RW_SEQ_SEQ, | |
1639 | .help = "Generate sequential offsets", | |
1640 | }, | |
1641 | { .ival = "identical", | |
1642 | .oval = RW_SEQ_IDENT, | |
1643 | .help = "Generate identical offsets", | |
1644 | }, | |
1645 | }, | |
1646 | }, | |
1647 | ||
214e1eca JA |
1648 | { |
1649 | .name = "ioengine", | |
e8b0e958 | 1650 | .lname = "IO Engine", |
214e1eca | 1651 | .type = FIO_OPT_STR_STORE, |
a609f12a | 1652 | .off1 = offsetof(struct thread_options, ioengine), |
214e1eca | 1653 | .help = "IO engine to use", |
58483fa4 | 1654 | .def = FIO_PREFERRED_ENGINE, |
e8b0e958 | 1655 | .category = FIO_OPT_C_IO, |
0626037e | 1656 | .group = FIO_OPT_G_IO_BASIC, |
214e1eca JA |
1657 | .posval = { |
1658 | { .ival = "sync", | |
1659 | .help = "Use read/write", | |
1660 | }, | |
a31041ea | 1661 | { .ival = "psync", |
1662 | .help = "Use pread/pwrite", | |
1663 | }, | |
1d2af02a | 1664 | { .ival = "vsync", |
03e20d68 | 1665 | .help = "Use readv/writev", |
1d2af02a | 1666 | }, |
07fc0acd JA |
1667 | #ifdef CONFIG_PWRITEV |
1668 | { .ival = "pvsync", | |
1669 | .help = "Use preadv/pwritev", | |
1670 | }, | |
1671 | #endif | |
6562685f | 1672 | #ifdef FIO_HAVE_PWRITEV2 |
2cafffbe JA |
1673 | { .ival = "pvsync2", |
1674 | .help = "Use preadv2/pwritev2", | |
1675 | }, | |
1676 | #endif | |
67bf9823 | 1677 | #ifdef CONFIG_LIBAIO |
214e1eca JA |
1678 | { .ival = "libaio", |
1679 | .help = "Linux native asynchronous IO", | |
1680 | }, | |
1681 | #endif | |
67bf9823 | 1682 | #ifdef CONFIG_POSIXAIO |
214e1eca JA |
1683 | { .ival = "posixaio", |
1684 | .help = "POSIX asynchronous IO", | |
1685 | }, | |
417f0068 | 1686 | #endif |
997843cb | 1687 | #ifdef CONFIG_SOLARISAIO |
417f0068 JA |
1688 | { .ival = "solarisaio", |
1689 | .help = "Solaris native asynchronous IO", | |
1690 | }, | |
214e1eca | 1691 | #endif |
4700b234 | 1692 | #ifdef CONFIG_WINDOWSAIO |
03e20d68 | 1693 | { .ival = "windowsaio", |
3be80071 | 1694 | .help = "Windows native asynchronous IO" |
de890a1e | 1695 | }, |
fc5c0345 DG |
1696 | #endif |
1697 | #ifdef CONFIG_RBD | |
1698 | { .ival = "rbd", | |
1699 | .help = "Rados Block Device asynchronous IO" | |
1700 | }, | |
3be80071 | 1701 | #endif |
214e1eca | 1702 | { .ival = "mmap", |
03e20d68 | 1703 | .help = "Memory mapped IO" |
214e1eca | 1704 | }, |
67bf9823 | 1705 | #ifdef CONFIG_LINUX_SPLICE |
214e1eca JA |
1706 | { .ival = "splice", |
1707 | .help = "splice/vmsplice based IO", | |
1708 | }, | |
9cce02e8 JA |
1709 | { .ival = "netsplice", |
1710 | .help = "splice/vmsplice to/from the network", | |
1711 | }, | |
214e1eca JA |
1712 | #endif |
1713 | #ifdef FIO_HAVE_SGIO | |
1714 | { .ival = "sg", | |
1715 | .help = "SCSI generic v3 IO", | |
1716 | }, | |
1717 | #endif | |
1718 | { .ival = "null", | |
1719 | .help = "Testing engine (no data transfer)", | |
1720 | }, | |
1721 | { .ival = "net", | |
1722 | .help = "Network IO", | |
1723 | }, | |
214e1eca | 1724 | { .ival = "cpuio", |
03e20d68 | 1725 | .help = "CPU cycle burner engine", |
214e1eca | 1726 | }, |
67bf9823 | 1727 | #ifdef CONFIG_GUASI |
b8c82a46 JA |
1728 | { .ival = "guasi", |
1729 | .help = "GUASI IO engine", | |
1730 | }, | |
79a43187 JA |
1731 | #endif |
1732 | #ifdef FIO_HAVE_BINJECT | |
1733 | { .ival = "binject", | |
1734 | .help = "binject direct inject block engine", | |
1735 | }, | |
21b8aee8 | 1736 | #endif |
67bf9823 | 1737 | #ifdef CONFIG_RDMA |
21b8aee8 | 1738 | { .ival = "rdma", |
1739 | .help = "RDMA IO engine", | |
1740 | }, | |
8200b8c7 | 1741 | #endif |
67bf9823 | 1742 | #ifdef CONFIG_FUSION_AW |
8200b8c7 JA |
1743 | { .ival = "fusion-aw-sync", |
1744 | .help = "Fusion-io atomic write engine", | |
1745 | }, | |
1ecc95ca | 1746 | #endif |
997843cb | 1747 | #ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT |
1ecc95ca JA |
1748 | { .ival = "e4defrag", |
1749 | .help = "ext4 defrag engine", | |
1750 | }, | |
1751 | #endif | |
997843cb | 1752 | #ifdef CONFIG_LINUX_FALLOCATE |
1ecc95ca JA |
1753 | { .ival = "falloc", |
1754 | .help = "fallocate() file based engine", | |
1755 | }, | |
b8c82a46 | 1756 | #endif |
a7c386f4 | 1757 | #ifdef CONFIG_GFAPI |
1758 | { .ival = "gfapi", | |
cc47f094 | 1759 | .help = "Glusterfs libgfapi(sync) based engine" |
1760 | }, | |
1761 | { .ival = "gfapi_async", | |
1762 | .help = "Glusterfs libgfapi(async) based engine" | |
a7c386f4 | 1763 | }, |
1764 | #endif | |
1b10477b | 1765 | #ifdef CONFIG_LIBHDFS |
b74e419e | 1766 | { .ival = "libhdfs", |
1b10477b MM |
1767 | .help = "Hadoop Distributed Filesystem (HDFS) engine" |
1768 | }, | |
5c4ef02e JA |
1769 | #endif |
1770 | #ifdef CONFIG_PMEMBLK | |
1771 | { .ival = "pmemblk", | |
1772 | .help = "NVML libpmemblk based IO engine", | |
1773 | }, | |
1774 | ||
104ee4de DJ |
1775 | #endif |
1776 | #ifdef CONFIG_LINUX_DEVDAX | |
1777 | { .ival = "dev-dax", | |
1778 | .help = "DAX Device based IO engine", | |
1779 | }, | |
1b10477b | 1780 | #endif |
214e1eca JA |
1781 | { .ival = "external", |
1782 | .help = "Load external engine (append name)", | |
1783 | }, | |
1784 | }, | |
1785 | }, | |
1786 | { | |
1787 | .name = "iodepth", | |
e8b0e958 | 1788 | .lname = "IO Depth", |
214e1eca | 1789 | .type = FIO_OPT_INT, |
a609f12a | 1790 | .off1 = offsetof(struct thread_options, iodepth), |
03e20d68 | 1791 | .help = "Number of IO buffers to keep in flight", |
757aff4f | 1792 | .minval = 1, |
20eb06bd | 1793 | .interval = 1, |
214e1eca | 1794 | .def = "1", |
e8b0e958 | 1795 | .category = FIO_OPT_C_IO, |
0626037e | 1796 | .group = FIO_OPT_G_IO_BASIC, |
214e1eca JA |
1797 | }, |
1798 | { | |
1799 | .name = "iodepth_batch", | |
e8b0e958 | 1800 | .lname = "IO Depth batch", |
4950421a | 1801 | .alias = "iodepth_batch_submit", |
214e1eca | 1802 | .type = FIO_OPT_INT, |
a609f12a | 1803 | .off1 = offsetof(struct thread_options, iodepth_batch), |
d65db441 | 1804 | .help = "Number of IO buffers to submit in one go", |
afdf9352 | 1805 | .parent = "iodepth", |
d71c154c | 1806 | .hide = 1, |
20eb06bd | 1807 | .interval = 1, |
a2e6f8ac | 1808 | .def = "1", |
e8b0e958 | 1809 | .category = FIO_OPT_C_IO, |
0626037e | 1810 | .group = FIO_OPT_G_IO_BASIC, |
4950421a JA |
1811 | }, |
1812 | { | |
82407585 RP |
1813 | .name = "iodepth_batch_complete_min", |
1814 | .lname = "Min IO depth batch complete", | |
1815 | .alias = "iodepth_batch_complete", | |
4950421a | 1816 | .type = FIO_OPT_INT, |
a609f12a | 1817 | .off1 = offsetof(struct thread_options, iodepth_batch_complete_min), |
82407585 | 1818 | .help = "Min number of IO buffers to retrieve in one go", |
4950421a | 1819 | .parent = "iodepth", |
d71c154c | 1820 | .hide = 1, |
4950421a | 1821 | .minval = 0, |
20eb06bd | 1822 | .interval = 1, |
4950421a | 1823 | .def = "1", |
e8b0e958 | 1824 | .category = FIO_OPT_C_IO, |
0626037e | 1825 | .group = FIO_OPT_G_IO_BASIC, |
214e1eca | 1826 | }, |
82407585 RP |
1827 | { |
1828 | .name = "iodepth_batch_complete_max", | |
1829 | .lname = "Max IO depth batch complete", | |
1830 | .type = FIO_OPT_INT, | |
a609f12a | 1831 | .off1 = offsetof(struct thread_options, iodepth_batch_complete_max), |
82407585 RP |
1832 | .help = "Max number of IO buffers to retrieve in one go", |
1833 | .parent = "iodepth", | |
1834 | .hide = 1, | |
1835 | .minval = 0, | |
1836 | .interval = 1, | |
1837 | .category = FIO_OPT_C_IO, | |
1838 | .group = FIO_OPT_G_IO_BASIC, | |
1839 | }, | |
214e1eca JA |
1840 | { |
1841 | .name = "iodepth_low", | |
e8b0e958 | 1842 | .lname = "IO Depth batch low", |
214e1eca | 1843 | .type = FIO_OPT_INT, |
a609f12a | 1844 | .off1 = offsetof(struct thread_options, iodepth_low), |
214e1eca | 1845 | .help = "Low water mark for queuing depth", |
afdf9352 | 1846 | .parent = "iodepth", |
d71c154c | 1847 | .hide = 1, |
20eb06bd | 1848 | .interval = 1, |
e8b0e958 | 1849 | .category = FIO_OPT_C_IO, |
0626037e | 1850 | .group = FIO_OPT_G_IO_BASIC, |
214e1eca | 1851 | }, |
a9da8ab2 JA |
1852 | { |
1853 | .name = "io_submit_mode", | |
1854 | .lname = "IO submit mode", | |
1855 | .type = FIO_OPT_STR, | |
a609f12a | 1856 | .off1 = offsetof(struct thread_options, io_submit_mode), |
a9da8ab2 JA |
1857 | .help = "How IO submissions and completions are done", |
1858 | .def = "inline", | |
1859 | .category = FIO_OPT_C_IO, | |
1860 | .group = FIO_OPT_G_IO_BASIC, | |
1861 | .posval = { | |
1862 | { .ival = "inline", | |
1863 | .oval = IO_MODE_INLINE, | |
1864 | .help = "Submit and complete IO inline", | |
1865 | }, | |
1866 | { .ival = "offload", | |
1867 | .oval = IO_MODE_OFFLOAD, | |
1868 | .help = "Offload submit and complete to threads", | |
1869 | }, | |
1870 | }, | |
1871 | }, | |
214e1eca JA |
1872 | { |
1873 | .name = "size", | |
e8b0e958 | 1874 | .lname = "Size", |
214e1eca | 1875 | .type = FIO_OPT_STR_VAL, |
7bb59102 | 1876 | .cb = str_size_cb, |
a609f12a | 1877 | .off1 = offsetof(struct thread_options, size), |
214e1eca | 1878 | .help = "Total size of device or files", |
20eb06bd | 1879 | .interval = 1024 * 1024, |
e8b0e958 JA |
1880 | .category = FIO_OPT_C_IO, |
1881 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 1882 | }, |
77731b29 | 1883 | { |
a4d3b4db JA |
1884 | .name = "io_size", |
1885 | .alias = "io_limit", | |
1886 | .lname = "IO Size", | |
77731b29 | 1887 | .type = FIO_OPT_STR_VAL, |
5be9bf09 | 1888 | .off1 = offsetof(struct thread_options, io_size), |
1684f7fd | 1889 | .help = "Total size of I/O to be performed", |
77731b29 JA |
1890 | .interval = 1024 * 1024, |
1891 | .category = FIO_OPT_C_IO, | |
1892 | .group = FIO_OPT_G_INVALID, | |
1893 | }, | |
aa31f1f1 SL |
1894 | { |
1895 | .name = "fill_device", | |
e8b0e958 | 1896 | .lname = "Fill device", |
74586c1e | 1897 | .alias = "fill_fs", |
aa31f1f1 | 1898 | .type = FIO_OPT_BOOL, |
a609f12a | 1899 | .off1 = offsetof(struct thread_options, fill_device), |
aa31f1f1 SL |
1900 | .help = "Write until an ENOSPC error occurs", |
1901 | .def = "0", | |
e8b0e958 JA |
1902 | .category = FIO_OPT_C_FILE, |
1903 | .group = FIO_OPT_G_INVALID, | |
aa31f1f1 | 1904 | }, |
214e1eca JA |
1905 | { |
1906 | .name = "filesize", | |
e8b0e958 | 1907 | .lname = "File size", |
214e1eca | 1908 | .type = FIO_OPT_STR_VAL, |
a609f12a JA |
1909 | .off1 = offsetof(struct thread_options, file_size_low), |
1910 | .off2 = offsetof(struct thread_options, file_size_high), | |
c3edbdba | 1911 | .minval = 1, |
214e1eca | 1912 | .help = "Size of individual files", |
20eb06bd | 1913 | .interval = 1024 * 1024, |
e8b0e958 JA |
1914 | .category = FIO_OPT_C_FILE, |
1915 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 1916 | }, |
bedc9dc2 JA |
1917 | { |
1918 | .name = "file_append", | |
1919 | .lname = "File append", | |
1920 | .type = FIO_OPT_BOOL, | |
a609f12a | 1921 | .off1 = offsetof(struct thread_options, file_append), |
bedc9dc2 JA |
1922 | .help = "IO will start at the end of the file(s)", |
1923 | .def = "0", | |
1924 | .category = FIO_OPT_C_FILE, | |
1925 | .group = FIO_OPT_G_INVALID, | |
1926 | }, | |
67a1000f JA |
1927 | { |
1928 | .name = "offset", | |
e8b0e958 | 1929 | .lname = "IO offset", |
67a1000f JA |
1930 | .alias = "fileoffset", |
1931 | .type = FIO_OPT_STR_VAL, | |
a609f12a | 1932 | .off1 = offsetof(struct thread_options, start_offset), |
67a1000f JA |
1933 | .help = "Start IO from this offset", |
1934 | .def = "0", | |
20eb06bd | 1935 | .interval = 1024 * 1024, |
e8b0e958 JA |
1936 | .category = FIO_OPT_C_IO, |
1937 | .group = FIO_OPT_G_INVALID, | |
67a1000f | 1938 | }, |
2d7cd868 JA |
1939 | { |
1940 | .name = "offset_increment", | |
e8b0e958 | 1941 | .lname = "IO offset increment", |
2d7cd868 | 1942 | .type = FIO_OPT_STR_VAL, |
a609f12a | 1943 | .off1 = offsetof(struct thread_options, offset_increment), |
2d7cd868 JA |
1944 | .help = "What is the increment from one offset to the next", |
1945 | .parent = "offset", | |
d71c154c | 1946 | .hide = 1, |
2d7cd868 | 1947 | .def = "0", |
20eb06bd | 1948 | .interval = 1024 * 1024, |
e8b0e958 JA |
1949 | .category = FIO_OPT_C_IO, |
1950 | .group = FIO_OPT_G_INVALID, | |
2d7cd868 | 1951 | }, |
ddf24e42 JA |
1952 | { |
1953 | .name = "number_ios", | |
1954 | .lname = "Number of IOs to perform", | |
1955 | .type = FIO_OPT_STR_VAL, | |
a609f12a | 1956 | .off1 = offsetof(struct thread_options, number_ios), |
be3fec7d | 1957 | .help = "Force job completion after this number of IOs", |
ddf24e42 JA |
1958 | .def = "0", |
1959 | .category = FIO_OPT_C_IO, | |
1960 | .group = FIO_OPT_G_INVALID, | |
1961 | }, | |
214e1eca JA |
1962 | { |
1963 | .name = "bs", | |
e8b0e958 | 1964 | .lname = "Block size", |
d3aad8f2 | 1965 | .alias = "blocksize", |
e01b22b8 | 1966 | .type = FIO_OPT_INT, |
a609f12a JA |
1967 | .off1 = offsetof(struct thread_options, bs[DDIR_READ]), |
1968 | .off2 = offsetof(struct thread_options, bs[DDIR_WRITE]), | |
1969 | .off3 = offsetof(struct thread_options, bs[DDIR_TRIM]), | |
c3edbdba | 1970 | .minval = 1, |
214e1eca | 1971 | .help = "Block size unit", |
2b9136a3 | 1972 | .def = "4096", |
67a1000f | 1973 | .parent = "rw", |
d71c154c | 1974 | .hide = 1, |
20eb06bd | 1975 | .interval = 512, |
e8b0e958 JA |
1976 | .category = FIO_OPT_C_IO, |
1977 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 1978 | }, |
2b7a01d0 JA |
1979 | { |
1980 | .name = "ba", | |
e8b0e958 | 1981 | .lname = "Block size align", |
2b7a01d0 | 1982 | .alias = "blockalign", |
e01b22b8 | 1983 | .type = FIO_OPT_INT, |
a609f12a JA |
1984 | .off1 = offsetof(struct thread_options, ba[DDIR_READ]), |
1985 | .off2 = offsetof(struct thread_options, ba[DDIR_WRITE]), | |
1986 | .off3 = offsetof(struct thread_options, ba[DDIR_TRIM]), | |
2b7a01d0 JA |
1987 | .minval = 1, |
1988 | .help = "IO block offset alignment", | |
1989 | .parent = "rw", | |
d71c154c | 1990 | .hide = 1, |
20eb06bd | 1991 | .interval = 512, |
e8b0e958 JA |
1992 | .category = FIO_OPT_C_IO, |
1993 | .group = FIO_OPT_G_INVALID, | |
2b7a01d0 | 1994 | }, |
214e1eca JA |
1995 | { |
1996 | .name = "bsrange", | |
e8b0e958 | 1997 | .lname = "Block size range", |
d3aad8f2 | 1998 | .alias = "blocksize_range", |
214e1eca | 1999 | .type = FIO_OPT_RANGE, |
a609f12a JA |
2000 | .off1 = offsetof(struct thread_options, min_bs[DDIR_READ]), |
2001 | .off2 = offsetof(struct thread_options, max_bs[DDIR_READ]), | |
2002 | .off3 = offsetof(struct thread_options, min_bs[DDIR_WRITE]), | |
2003 | .off4 = offsetof(struct thread_options, max_bs[DDIR_WRITE]), | |
2004 | .off5 = offsetof(struct thread_options, min_bs[DDIR_TRIM]), | |
2005 | .off6 = offsetof(struct thread_options, max_bs[DDIR_TRIM]), | |
c3edbdba | 2006 | .minval = 1, |
214e1eca | 2007 | .help = "Set block size range (in more detail than bs)", |
67a1000f | 2008 | .parent = "rw", |
d71c154c | 2009 | .hide = 1, |
20eb06bd | 2010 | .interval = 4096, |
e8b0e958 JA |
2011 | .category = FIO_OPT_C_IO, |
2012 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 2013 | }, |
564ca972 JA |
2014 | { |
2015 | .name = "bssplit", | |
e8b0e958 | 2016 | .lname = "Block size split", |
564ca972 JA |
2017 | .type = FIO_OPT_STR, |
2018 | .cb = str_bssplit_cb, | |
a609f12a | 2019 | .off1 = offsetof(struct thread_options, bssplit), |
564ca972 JA |
2020 | .help = "Set a specific mix of block sizes", |
2021 | .parent = "rw", | |
d71c154c | 2022 | .hide = 1, |
e8b0e958 JA |
2023 | .category = FIO_OPT_C_IO, |
2024 | .group = FIO_OPT_G_INVALID, | |
564ca972 | 2025 | }, |
214e1eca JA |
2026 | { |
2027 | .name = "bs_unaligned", | |
e8b0e958 | 2028 | .lname = "Block size unaligned", |
d3aad8f2 | 2029 | .alias = "blocksize_unaligned", |
214e1eca | 2030 | .type = FIO_OPT_STR_SET, |
a609f12a | 2031 | .off1 = offsetof(struct thread_options, bs_unaligned), |
214e1eca | 2032 | .help = "Don't sector align IO buffer sizes", |
67a1000f | 2033 | .parent = "rw", |
d71c154c | 2034 | .hide = 1, |
e8b0e958 JA |
2035 | .category = FIO_OPT_C_IO, |
2036 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 2037 | }, |
6aca9b3d JA |
2038 | { |
2039 | .name = "bs_is_seq_rand", | |
2040 | .lname = "Block size division is seq/random (not read/write)", | |
2041 | .type = FIO_OPT_BOOL, | |
a609f12a | 2042 | .off1 = offsetof(struct thread_options, bs_is_seq_rand), |
86d59660 | 2043 | .help = "Consider any blocksize setting to be sequential,random", |
6aca9b3d JA |
2044 | .def = "0", |
2045 | .parent = "blocksize", | |
2046 | .category = FIO_OPT_C_IO, | |
2047 | .group = FIO_OPT_G_INVALID, | |
2048 | }, | |
214e1eca JA |
2049 | { |
2050 | .name = "randrepeat", | |
e8b0e958 | 2051 | .lname = "Random repeatable", |
214e1eca | 2052 | .type = FIO_OPT_BOOL, |
a609f12a | 2053 | .off1 = offsetof(struct thread_options, rand_repeatable), |
214e1eca JA |
2054 | .help = "Use repeatable random IO pattern", |
2055 | .def = "1", | |
67a1000f | 2056 | .parent = "rw", |
d71c154c | 2057 | .hide = 1, |
e8b0e958 | 2058 | .category = FIO_OPT_C_IO, |
3ceb458f | 2059 | .group = FIO_OPT_G_RANDOM, |
214e1eca | 2060 | }, |
04778baf JA |
2061 | { |
2062 | .name = "randseed", | |
2063 | .lname = "The random generator seed", | |
363cffa7 | 2064 | .type = FIO_OPT_STR_VAL, |
a609f12a | 2065 | .off1 = offsetof(struct thread_options, rand_seed), |
04778baf | 2066 | .help = "Set the random generator seed value", |
40fe5e7b | 2067 | .def = "0x89", |
04778baf JA |
2068 | .parent = "rw", |
2069 | .category = FIO_OPT_C_IO, | |
2070 | .group = FIO_OPT_G_RANDOM, | |
2071 | }, | |
2615cc4b JA |
2072 | { |
2073 | .name = "use_os_rand", | |
e8b0e958 | 2074 | .lname = "Use OS random", |
54a21917 | 2075 | .type = FIO_OPT_DEPRECATED, |
a609f12a | 2076 | .off1 = offsetof(struct thread_options, dep_use_os_rand), |
e8b0e958 | 2077 | .category = FIO_OPT_C_IO, |
3ceb458f | 2078 | .group = FIO_OPT_G_RANDOM, |
2615cc4b | 2079 | }, |
214e1eca JA |
2080 | { |
2081 | .name = "norandommap", | |
e8b0e958 | 2082 | .lname = "No randommap", |
214e1eca | 2083 | .type = FIO_OPT_STR_SET, |
a609f12a | 2084 | .off1 = offsetof(struct thread_options, norandommap), |
214e1eca | 2085 | .help = "Accept potential duplicate random blocks", |
67a1000f | 2086 | .parent = "rw", |
d71c154c | 2087 | .hide = 1, |
b2452a43 | 2088 | .hide_on_set = 1, |
e8b0e958 | 2089 | .category = FIO_OPT_C_IO, |
3ceb458f | 2090 | .group = FIO_OPT_G_RANDOM, |
214e1eca | 2091 | }, |
2b386d25 JA |
2092 | { |
2093 | .name = "softrandommap", | |
e8b0e958 | 2094 | .lname = "Soft randommap", |
2b386d25 | 2095 | .type = FIO_OPT_BOOL, |
a609f12a | 2096 | .off1 = offsetof(struct thread_options, softrandommap), |
f66ab3c8 | 2097 | .help = "Set norandommap if randommap allocation fails", |
2b386d25 | 2098 | .parent = "norandommap", |
d71c154c | 2099 | .hide = 1, |
2b386d25 | 2100 | .def = "0", |
e8b0e958 | 2101 | .category = FIO_OPT_C_IO, |
3ceb458f | 2102 | .group = FIO_OPT_G_RANDOM, |
2b386d25 | 2103 | }, |
8055e41d JA |
2104 | { |
2105 | .name = "random_generator", | |
cce2fdfe | 2106 | .lname = "Random Generator", |
8055e41d | 2107 | .type = FIO_OPT_STR, |
a609f12a | 2108 | .off1 = offsetof(struct thread_options, random_generator), |
8055e41d JA |
2109 | .help = "Type of random number generator to use", |
2110 | .def = "tausworthe", | |
2111 | .posval = { | |
2112 | { .ival = "tausworthe", | |
2113 | .oval = FIO_RAND_GEN_TAUSWORTHE, | |
2114 | .help = "Strong Tausworthe generator", | |
2115 | }, | |
2116 | { .ival = "lfsr", | |
2117 | .oval = FIO_RAND_GEN_LFSR, | |
2118 | .help = "Variable length LFSR", | |
2119 | }, | |
c3546b53 JA |
2120 | { |
2121 | .ival = "tausworthe64", | |
2122 | .oval = FIO_RAND_GEN_TAUSWORTHE64, | |
2123 | .help = "64-bit Tausworthe variant", | |
2124 | }, | |
8055e41d | 2125 | }, |
48107598 JA |
2126 | .category = FIO_OPT_C_IO, |
2127 | .group = FIO_OPT_G_RANDOM, | |
8055e41d | 2128 | }, |
e25839d4 JA |
2129 | { |
2130 | .name = "random_distribution", | |
cce2fdfe | 2131 | .lname = "Random Distribution", |
e25839d4 | 2132 | .type = FIO_OPT_STR, |
a609f12a | 2133 | .off1 = offsetof(struct thread_options, random_distribution), |
e25839d4 JA |
2134 | .cb = str_random_distribution_cb, |
2135 | .help = "Random offset distribution generator", | |
2136 | .def = "random", | |
2137 | .posval = { | |
2138 | { .ival = "random", | |
2139 | .oval = FIO_RAND_DIST_RANDOM, | |
2140 | .help = "Completely random", | |
2141 | }, | |
2142 | { .ival = "zipf", | |
2143 | .oval = FIO_RAND_DIST_ZIPF, | |
2144 | .help = "Zipf distribution", | |
2145 | }, | |
925fee33 JA |
2146 | { .ival = "pareto", |
2147 | .oval = FIO_RAND_DIST_PARETO, | |
2148 | .help = "Pareto distribution", | |
2149 | }, | |
56d9fa4b JA |
2150 | { .ival = "normal", |
2151 | .oval = FIO_RAND_DIST_GAUSS, | |
ba2b3b07 | 2152 | .help = "Normal (Gaussian) distribution", |
56d9fa4b | 2153 | }, |
e0a04ac1 JA |
2154 | { .ival = "zoned", |
2155 | .oval = FIO_RAND_DIST_ZONED, | |
2156 | .help = "Zoned random distribution", | |
2157 | }, | |
2158 | ||
e25839d4 | 2159 | }, |
48107598 JA |
2160 | .category = FIO_OPT_C_IO, |
2161 | .group = FIO_OPT_G_RANDOM, | |
e25839d4 | 2162 | }, |
211c9b89 JA |
2163 | { |
2164 | .name = "percentage_random", | |
2165 | .lname = "Percentage Random", | |
2166 | .type = FIO_OPT_INT, | |
a609f12a JA |
2167 | .off1 = offsetof(struct thread_options, perc_rand[DDIR_READ]), |
2168 | .off2 = offsetof(struct thread_options, perc_rand[DDIR_WRITE]), | |
2169 | .off3 = offsetof(struct thread_options, perc_rand[DDIR_TRIM]), | |
211c9b89 JA |
2170 | .maxval = 100, |
2171 | .help = "Percentage of seq/random mix that should be random", | |
d9472271 | 2172 | .def = "100,100,100", |
211c9b89 JA |
2173 | .interval = 5, |
2174 | .inverse = "percentage_sequential", | |
2175 | .category = FIO_OPT_C_IO, | |
2176 | .group = FIO_OPT_G_RANDOM, | |
2177 | }, | |
2178 | { | |
2179 | .name = "percentage_sequential", | |
2180 | .lname = "Percentage Sequential", | |
d9472271 | 2181 | .type = FIO_OPT_DEPRECATED, |
211c9b89 JA |
2182 | .category = FIO_OPT_C_IO, |
2183 | .group = FIO_OPT_G_RANDOM, | |
2184 | }, | |
56e2a5fc CE |
2185 | { |
2186 | .name = "allrandrepeat", | |
cce2fdfe | 2187 | .lname = "All Random Repeat", |
56e2a5fc | 2188 | .type = FIO_OPT_BOOL, |
a609f12a | 2189 | .off1 = offsetof(struct thread_options, allrand_repeatable), |
56e2a5fc CE |
2190 | .help = "Use repeatable random numbers for everything", |
2191 | .def = "0", | |
a869d9c6 JA |
2192 | .category = FIO_OPT_C_IO, |
2193 | .group = FIO_OPT_G_RANDOM, | |
56e2a5fc | 2194 | }, |
214e1eca JA |
2195 | { |
2196 | .name = "nrfiles", | |
e8b0e958 | 2197 | .lname = "Number of files", |
d7c8be03 | 2198 | .alias = "nr_files", |
214e1eca | 2199 | .type = FIO_OPT_INT, |
a609f12a | 2200 | .off1 = offsetof(struct thread_options, nr_files), |
214e1eca JA |
2201 | .help = "Split job workload between this number of files", |
2202 | .def = "1", | |
20eb06bd | 2203 | .interval = 1, |
e8b0e958 JA |
2204 | .category = FIO_OPT_C_FILE, |
2205 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
2206 | }, |
2207 | { | |
2208 | .name = "openfiles", | |
e8b0e958 | 2209 | .lname = "Number of open files", |
214e1eca | 2210 | .type = FIO_OPT_INT, |
a609f12a | 2211 | .off1 = offsetof(struct thread_options, open_files), |
214e1eca | 2212 | .help = "Number of files to keep open at the same time", |
e8b0e958 JA |
2213 | .category = FIO_OPT_C_FILE, |
2214 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
2215 | }, |
2216 | { | |
2217 | .name = "file_service_type", | |
e8b0e958 | 2218 | .lname = "File service type", |
214e1eca JA |
2219 | .type = FIO_OPT_STR, |
2220 | .cb = str_fst_cb, | |
a609f12a | 2221 | .off1 = offsetof(struct thread_options, file_service_type), |
214e1eca JA |
2222 | .help = "How to select which file to service next", |
2223 | .def = "roundrobin", | |
e8b0e958 JA |
2224 | .category = FIO_OPT_C_FILE, |
2225 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
2226 | .posval = { |
2227 | { .ival = "random", | |
2228 | .oval = FIO_FSERVICE_RANDOM, | |
8c07860d JA |
2229 | .help = "Choose a file at random (uniform)", |
2230 | }, | |
2231 | { .ival = "zipf", | |
2232 | .oval = FIO_FSERVICE_ZIPF, | |
2233 | .help = "Zipf randomized", | |
2234 | }, | |
2235 | { .ival = "pareto", | |
2236 | .oval = FIO_FSERVICE_PARETO, | |
2237 | .help = "Pareto randomized", | |
2238 | }, | |
2239 | { .ival = "gauss", | |
2240 | .oval = FIO_FSERVICE_GAUSS, | |
c60ebc45 | 2241 | .help = "Normal (Gaussian) distribution", |
214e1eca JA |
2242 | }, |
2243 | { .ival = "roundrobin", | |
2244 | .oval = FIO_FSERVICE_RR, | |
2245 | .help = "Round robin select files", | |
2246 | }, | |
a086c257 JA |
2247 | { .ival = "sequential", |
2248 | .oval = FIO_FSERVICE_SEQ, | |
2249 | .help = "Finish one file before moving to the next", | |
2250 | }, | |
214e1eca | 2251 | }, |
67a1000f | 2252 | .parent = "nrfiles", |
d71c154c | 2253 | .hide = 1, |
67a1000f | 2254 | }, |
97ac992c | 2255 | #ifdef CONFIG_POSIX_FALLOCATE |
7bc8c2cf JA |
2256 | { |
2257 | .name = "fallocate", | |
e8b0e958 | 2258 | .lname = "Fallocate", |
a596f047 | 2259 | .type = FIO_OPT_STR, |
a609f12a | 2260 | .off1 = offsetof(struct thread_options, fallocate_mode), |
a596f047 EG |
2261 | .help = "Whether pre-allocation is performed when laying out files", |
2262 | .def = "posix", | |
e8b0e958 JA |
2263 | .category = FIO_OPT_C_FILE, |
2264 | .group = FIO_OPT_G_INVALID, | |
a596f047 EG |
2265 | .posval = { |
2266 | { .ival = "none", | |
2267 | .oval = FIO_FALLOCATE_NONE, | |
2268 | .help = "Do not pre-allocate space", | |
2269 | }, | |
2270 | { .ival = "posix", | |
2271 | .oval = FIO_FALLOCATE_POSIX, | |
2272 | .help = "Use posix_fallocate()", | |
2273 | }, | |
97ac992c | 2274 | #ifdef CONFIG_LINUX_FALLOCATE |
a596f047 EG |
2275 | { .ival = "keep", |
2276 | .oval = FIO_FALLOCATE_KEEP_SIZE, | |
2277 | .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)", | |
2278 | }, | |
7bc8c2cf | 2279 | #endif |
a596f047 EG |
2280 | /* Compatibility with former boolean values */ |
2281 | { .ival = "0", | |
2282 | .oval = FIO_FALLOCATE_NONE, | |
2283 | .help = "Alias for 'none'", | |
2284 | }, | |
2285 | { .ival = "1", | |
2286 | .oval = FIO_FALLOCATE_POSIX, | |
2287 | .help = "Alias for 'posix'", | |
2288 | }, | |
2289 | }, | |
2290 | }, | |
a275c37a JA |
2291 | #else /* CONFIG_POSIX_FALLOCATE */ |
2292 | { | |
2293 | .name = "fallocate", | |
2294 | .lname = "Fallocate", | |
2295 | .type = FIO_OPT_UNSUPPORTED, | |
2296 | .help = "Your platform does not support fallocate", | |
2297 | }, | |
2298 | #endif /* CONFIG_POSIX_FALLOCATE */ | |
67a1000f JA |
2299 | { |
2300 | .name = "fadvise_hint", | |
e8b0e958 | 2301 | .lname = "Fadvise hint", |
ecb2083d | 2302 | .type = FIO_OPT_STR, |
a609f12a | 2303 | .off1 = offsetof(struct thread_options, fadvise_hint), |
ecb2083d JA |
2304 | .posval = { |
2305 | { .ival = "0", | |
2306 | .oval = F_ADV_NONE, | |
2307 | .help = "Don't issue fadvise", | |
2308 | }, | |
2309 | { .ival = "1", | |
2310 | .oval = F_ADV_TYPE, | |
2311 | .help = "Advise using fio IO pattern", | |
2312 | }, | |
2313 | { .ival = "random", | |
2314 | .oval = F_ADV_RANDOM, | |
2315 | .help = "Advise using FADV_RANDOM", | |
2316 | }, | |
2317 | { .ival = "sequential", | |
2318 | .oval = F_ADV_SEQUENTIAL, | |
2319 | .help = "Advise using FADV_SEQUENTIAL", | |
2320 | }, | |
2321 | }, | |
67a1000f JA |
2322 | .help = "Use fadvise() to advise the kernel on IO pattern", |
2323 | .def = "1", | |
e8b0e958 JA |
2324 | .category = FIO_OPT_C_FILE, |
2325 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 2326 | }, |
37659335 JA |
2327 | #ifdef FIO_HAVE_STREAMID |
2328 | { | |
2329 | .name = "fadvise_stream", | |
2330 | .lname = "Fadvise stream", | |
2331 | .type = FIO_OPT_INT, | |
a609f12a | 2332 | .off1 = offsetof(struct thread_options, fadvise_stream), |
37659335 JA |
2333 | .help = "Use fadvise() to set stream ID", |
2334 | .category = FIO_OPT_C_FILE, | |
2335 | .group = FIO_OPT_G_INVALID, | |
2336 | }, | |
a275c37a | 2337 | #else |
54d0a315 | 2338 | { |
a275c37a JA |
2339 | .name = "fadvise_stream", |
2340 | .lname = "Fadvise stream", | |
2341 | .type = FIO_OPT_UNSUPPORTED, | |
2342 | .help = "Your platform does not support fadvise stream ID", | |
2343 | }, | |
37659335 | 2344 | #endif |
214e1eca JA |
2345 | { |
2346 | .name = "fsync", | |
e8b0e958 | 2347 | .lname = "Fsync", |
214e1eca | 2348 | .type = FIO_OPT_INT, |
a609f12a | 2349 | .off1 = offsetof(struct thread_options, fsync_blocks), |
214e1eca JA |
2350 | .help = "Issue fsync for writes every given number of blocks", |
2351 | .def = "0", | |
20eb06bd | 2352 | .interval = 1, |
e8b0e958 JA |
2353 | .category = FIO_OPT_C_FILE, |
2354 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 2355 | }, |
5f9099ea JA |
2356 | { |
2357 | .name = "fdatasync", | |
e8b0e958 | 2358 | .lname = "Fdatasync", |
5f9099ea | 2359 | .type = FIO_OPT_INT, |
a609f12a | 2360 | .off1 = offsetof(struct thread_options, fdatasync_blocks), |
5f9099ea JA |
2361 | .help = "Issue fdatasync for writes every given number of blocks", |
2362 | .def = "0", | |
20eb06bd | 2363 | .interval = 1, |
e8b0e958 JA |
2364 | .category = FIO_OPT_C_FILE, |
2365 | .group = FIO_OPT_G_INVALID, | |
5f9099ea | 2366 | }, |
1ef2b6be JA |
2367 | { |
2368 | .name = "write_barrier", | |
e8b0e958 | 2369 | .lname = "Write barrier", |
1ef2b6be | 2370 | .type = FIO_OPT_INT, |
a609f12a | 2371 | .off1 = offsetof(struct thread_options, barrier_blocks), |
1ef2b6be JA |
2372 | .help = "Make every Nth write a barrier write", |
2373 | .def = "0", | |
20eb06bd | 2374 | .interval = 1, |
e8b0e958 JA |
2375 | .category = FIO_OPT_C_IO, |
2376 | .group = FIO_OPT_G_INVALID, | |
1ef2b6be | 2377 | }, |
67bf9823 | 2378 | #ifdef CONFIG_SYNC_FILE_RANGE |
44f29692 JA |
2379 | { |
2380 | .name = "sync_file_range", | |
e8b0e958 | 2381 | .lname = "Sync file range", |
44f29692 JA |
2382 | .posval = { |
2383 | { .ival = "wait_before", | |
2384 | .oval = SYNC_FILE_RANGE_WAIT_BEFORE, | |
2385 | .help = "SYNC_FILE_RANGE_WAIT_BEFORE", | |
ebadc0ce | 2386 | .orval = 1, |
44f29692 JA |
2387 | }, |
2388 | { .ival = "write", | |
2389 | .oval = SYNC_FILE_RANGE_WRITE, | |
2390 | .help = "SYNC_FILE_RANGE_WRITE", | |
ebadc0ce | 2391 | .orval = 1, |
44f29692 JA |
2392 | }, |
2393 | { | |
2394 | .ival = "wait_after", | |
2395 | .oval = SYNC_FILE_RANGE_WAIT_AFTER, | |
2396 | .help = "SYNC_FILE_RANGE_WAIT_AFTER", | |
ebadc0ce | 2397 | .orval = 1, |
44f29692 JA |
2398 | }, |
2399 | }, | |
3843deb3 | 2400 | .type = FIO_OPT_STR_MULTI, |
44f29692 | 2401 | .cb = str_sfr_cb, |
a609f12a | 2402 | .off1 = offsetof(struct thread_options, sync_file_range), |
44f29692 | 2403 | .help = "Use sync_file_range()", |
e8b0e958 JA |
2404 | .category = FIO_OPT_C_FILE, |
2405 | .group = FIO_OPT_G_INVALID, | |
44f29692 | 2406 | }, |
a275c37a | 2407 | #else |
54d0a315 | 2408 | { |
a275c37a JA |
2409 | .name = "sync_file_range", |
2410 | .lname = "Sync file range", | |
2411 | .type = FIO_OPT_UNSUPPORTED, | |
2412 | .help = "Your platform does not support sync_file_range", | |
2413 | }, | |
44f29692 | 2414 | #endif |
214e1eca JA |
2415 | { |
2416 | .name = "direct", | |
e8b0e958 | 2417 | .lname = "Direct I/O", |
214e1eca | 2418 | .type = FIO_OPT_BOOL, |
a609f12a | 2419 | .off1 = offsetof(struct thread_options, odirect), |
214e1eca JA |
2420 | .help = "Use O_DIRECT IO (negates buffered)", |
2421 | .def = "0", | |
a01a1bc5 | 2422 | .inverse = "buffered", |
e8b0e958 | 2423 | .category = FIO_OPT_C_IO, |
3ceb458f | 2424 | .group = FIO_OPT_G_IO_TYPE, |
214e1eca | 2425 | }, |
d01612f3 CM |
2426 | { |
2427 | .name = "atomic", | |
2428 | .lname = "Atomic I/O", | |
2429 | .type = FIO_OPT_BOOL, | |
a609f12a | 2430 | .off1 = offsetof(struct thread_options, oatomic), |
d01612f3 CM |
2431 | .help = "Use Atomic IO with O_DIRECT (implies O_DIRECT)", |
2432 | .def = "0", | |
2433 | .category = FIO_OPT_C_IO, | |
2434 | .group = FIO_OPT_G_IO_TYPE, | |
2435 | }, | |
214e1eca JA |
2436 | { |
2437 | .name = "buffered", | |
e8b0e958 | 2438 | .lname = "Buffered I/O", |
214e1eca | 2439 | .type = FIO_OPT_BOOL, |
a609f12a | 2440 | .off1 = offsetof(struct thread_options, odirect), |
214e1eca JA |
2441 | .neg = 1, |
2442 | .help = "Use buffered IO (negates direct)", | |
2443 | .def = "1", | |
a01a1bc5 | 2444 | .inverse = "direct", |
e8b0e958 | 2445 | .category = FIO_OPT_C_IO, |
3ceb458f | 2446 | .group = FIO_OPT_G_IO_TYPE, |
214e1eca JA |
2447 | }, |
2448 | { | |
2449 | .name = "overwrite", | |
e8b0e958 | 2450 | .lname = "Overwrite", |
214e1eca | 2451 | .type = FIO_OPT_BOOL, |
a609f12a | 2452 | .off1 = offsetof(struct thread_options, overwrite), |
214e1eca JA |
2453 | .help = "When writing, set whether to overwrite current data", |
2454 | .def = "0", | |
e8b0e958 JA |
2455 | .category = FIO_OPT_C_FILE, |
2456 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
2457 | }, |
2458 | { | |
2459 | .name = "loops", | |
e8b0e958 | 2460 | .lname = "Loops", |
214e1eca | 2461 | .type = FIO_OPT_INT, |
a609f12a | 2462 | .off1 = offsetof(struct thread_options, loops), |
214e1eca JA |
2463 | .help = "Number of times to run the job", |
2464 | .def = "1", | |
20eb06bd | 2465 | .interval = 1, |
e8b0e958 | 2466 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 2467 | .group = FIO_OPT_G_RUNTIME, |
214e1eca JA |
2468 | }, |
2469 | { | |
2470 | .name = "numjobs", | |
e8b0e958 | 2471 | .lname = "Number of jobs", |
214e1eca | 2472 | .type = FIO_OPT_INT, |
a609f12a | 2473 | .off1 = offsetof(struct thread_options, numjobs), |
214e1eca JA |
2474 | .help = "Duplicate this job this many times", |
2475 | .def = "1", | |
20eb06bd | 2476 | .interval = 1, |
e8b0e958 | 2477 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 2478 | .group = FIO_OPT_G_RUNTIME, |
214e1eca JA |
2479 | }, |
2480 | { | |
2481 | .name = "startdelay", | |
e8b0e958 | 2482 | .lname = "Start delay", |
a5737c93 | 2483 | .type = FIO_OPT_STR_VAL_TIME, |
a609f12a JA |
2484 | .off1 = offsetof(struct thread_options, start_delay), |
2485 | .off2 = offsetof(struct thread_options, start_delay_high), | |
214e1eca JA |
2486 | .help = "Only start job when this period has passed", |
2487 | .def = "0", | |
0de5b26f | 2488 | .is_seconds = 1, |
88038bc7 | 2489 | .is_time = 1, |
e8b0e958 | 2490 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 2491 | .group = FIO_OPT_G_RUNTIME, |
214e1eca JA |
2492 | }, |
2493 | { | |
2494 | .name = "runtime", | |
e8b0e958 | 2495 | .lname = "Runtime", |
214e1eca JA |
2496 | .alias = "timeout", |
2497 | .type = FIO_OPT_STR_VAL_TIME, | |
a609f12a | 2498 | .off1 = offsetof(struct thread_options, timeout), |
214e1eca JA |
2499 | .help = "Stop workload when this amount of time has passed", |
2500 | .def = "0", | |
0de5b26f | 2501 | .is_seconds = 1, |
88038bc7 | 2502 | .is_time = 1, |
e8b0e958 | 2503 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 2504 | .group = FIO_OPT_G_RUNTIME, |
214e1eca | 2505 | }, |
cf4464ca JA |
2506 | { |
2507 | .name = "time_based", | |
e8b0e958 | 2508 | .lname = "Time based", |
cf4464ca | 2509 | .type = FIO_OPT_STR_SET, |
a609f12a | 2510 | .off1 = offsetof(struct thread_options, time_based), |
cf4464ca | 2511 | .help = "Keep running until runtime/timeout is met", |
e8b0e958 | 2512 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 2513 | .group = FIO_OPT_G_RUNTIME, |
cf4464ca | 2514 | }, |
62167762 JC |
2515 | { |
2516 | .name = "verify_only", | |
2517 | .lname = "Verify only", | |
2518 | .type = FIO_OPT_STR_SET, | |
a609f12a | 2519 | .off1 = offsetof(struct thread_options, verify_only), |
62167762 JC |
2520 | .help = "Verifies previously written data is still valid", |
2521 | .category = FIO_OPT_C_GENERAL, | |
2522 | .group = FIO_OPT_G_RUNTIME, | |
2523 | }, | |
721938ae JA |
2524 | { |
2525 | .name = "ramp_time", | |
e8b0e958 | 2526 | .lname = "Ramp time", |
721938ae | 2527 | .type = FIO_OPT_STR_VAL_TIME, |
a609f12a | 2528 | .off1 = offsetof(struct thread_options, ramp_time), |
721938ae | 2529 | .help = "Ramp up time before measuring performance", |
0de5b26f | 2530 | .is_seconds = 1, |
88038bc7 | 2531 | .is_time = 1, |
e8b0e958 | 2532 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 2533 | .group = FIO_OPT_G_RUNTIME, |
721938ae | 2534 | }, |
c223da83 JA |
2535 | { |
2536 | .name = "clocksource", | |
e8b0e958 | 2537 | .lname = "Clock source", |
c223da83 JA |
2538 | .type = FIO_OPT_STR, |
2539 | .cb = fio_clock_source_cb, | |
a609f12a | 2540 | .off1 = offsetof(struct thread_options, clocksource), |
c223da83 | 2541 | .help = "What type of timing source to use", |
e8b0e958 | 2542 | .category = FIO_OPT_C_GENERAL, |
10860056 | 2543 | .group = FIO_OPT_G_CLOCK, |
c223da83 | 2544 | .posval = { |
67bf9823 | 2545 | #ifdef CONFIG_GETTIMEOFDAY |
c223da83 JA |
2546 | { .ival = "gettimeofday", |
2547 | .oval = CS_GTOD, | |
2548 | .help = "Use gettimeofday(2) for timing", | |
2549 | }, | |
67bf9823 JA |
2550 | #endif |
2551 | #ifdef CONFIG_CLOCK_GETTIME | |
c223da83 JA |
2552 | { .ival = "clock_gettime", |
2553 | .oval = CS_CGETTIME, | |
2554 | .help = "Use clock_gettime(2) for timing", | |
2555 | }, | |
67bf9823 | 2556 | #endif |
c223da83 JA |
2557 | #ifdef ARCH_HAVE_CPU_CLOCK |
2558 | { .ival = "cpu", | |
2559 | .oval = CS_CPUCLOCK, | |
2560 | .help = "Use CPU private clock", | |
2561 | }, | |
2562 | #endif | |
2563 | }, | |
2564 | }, | |
214e1eca JA |
2565 | { |
2566 | .name = "mem", | |
d3aad8f2 | 2567 | .alias = "iomem", |
e8b0e958 | 2568 | .lname = "I/O Memory", |
214e1eca JA |
2569 | .type = FIO_OPT_STR, |
2570 | .cb = str_mem_cb, | |
a609f12a | 2571 | .off1 = offsetof(struct thread_options, mem_type), |
214e1eca JA |
2572 | .help = "Backing type for IO buffers", |
2573 | .def = "malloc", | |
e8b0e958 JA |
2574 | .category = FIO_OPT_C_IO, |
2575 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
2576 | .posval = { |
2577 | { .ival = "malloc", | |
2578 | .oval = MEM_MALLOC, | |
2579 | .help = "Use malloc(3) for IO buffers", | |
2580 | }, | |
c8931876 | 2581 | #ifndef CONFIG_NO_SHM |
37c8cdfe JA |
2582 | { .ival = "shm", |
2583 | .oval = MEM_SHM, | |
2584 | .help = "Use shared memory segments for IO buffers", | |
2585 | }, | |
214e1eca JA |
2586 | #ifdef FIO_HAVE_HUGETLB |
2587 | { .ival = "shmhuge", | |
2588 | .oval = MEM_SHMHUGE, | |
2589 | .help = "Like shm, but use huge pages", | |
2590 | }, | |
c8931876 | 2591 | #endif |
b370e46a | 2592 | #endif |
37c8cdfe JA |
2593 | { .ival = "mmap", |
2594 | .oval = MEM_MMAP, | |
2595 | .help = "Use mmap(2) (file or anon) for IO buffers", | |
2596 | }, | |
217b0f1d LG |
2597 | { .ival = "mmapshared", |
2598 | .oval = MEM_MMAPSHARED, | |
2599 | .help = "Like mmap, but use the shared flag", | |
2600 | }, | |
214e1eca JA |
2601 | #ifdef FIO_HAVE_HUGETLB |
2602 | { .ival = "mmaphuge", | |
2603 | .oval = MEM_MMAPHUGE, | |
2604 | .help = "Like mmap, but use huge pages", | |
2605 | }, | |
2606 | #endif | |
2607 | }, | |
2608 | }, | |
d529ee19 JA |
2609 | { |
2610 | .name = "iomem_align", | |
2611 | .alias = "mem_align", | |
e8b0e958 | 2612 | .lname = "I/O memory alignment", |
d529ee19 | 2613 | .type = FIO_OPT_INT, |
a609f12a | 2614 | .off1 = offsetof(struct thread_options, mem_align), |
d529ee19 JA |
2615 | .minval = 0, |
2616 | .help = "IO memory buffer offset alignment", | |
2617 | .def = "0", | |
2618 | .parent = "iomem", | |
d71c154c | 2619 | .hide = 1, |
e8b0e958 JA |
2620 | .category = FIO_OPT_C_IO, |
2621 | .group = FIO_OPT_G_INVALID, | |
d529ee19 | 2622 | }, |
214e1eca JA |
2623 | { |
2624 | .name = "verify", | |
e8b0e958 | 2625 | .lname = "Verify", |
214e1eca | 2626 | .type = FIO_OPT_STR, |
a609f12a | 2627 | .off1 = offsetof(struct thread_options, verify), |
214e1eca JA |
2628 | .help = "Verify data written", |
2629 | .def = "0", | |
e8b0e958 | 2630 | .category = FIO_OPT_C_IO, |
3ceb458f | 2631 | .group = FIO_OPT_G_VERIFY, |
214e1eca JA |
2632 | .posval = { |
2633 | { .ival = "0", | |
2634 | .oval = VERIFY_NONE, | |
2635 | .help = "Don't do IO verification", | |
2636 | }, | |
fcca4b58 JA |
2637 | { .ival = "md5", |
2638 | .oval = VERIFY_MD5, | |
2639 | .help = "Use md5 checksums for verification", | |
2640 | }, | |
d77a7af3 JA |
2641 | { .ival = "crc64", |
2642 | .oval = VERIFY_CRC64, | |
2643 | .help = "Use crc64 checksums for verification", | |
2644 | }, | |
214e1eca JA |
2645 | { .ival = "crc32", |
2646 | .oval = VERIFY_CRC32, | |
2647 | .help = "Use crc32 checksums for verification", | |
2648 | }, | |
af497e6a | 2649 | { .ival = "crc32c-intel", |
e3aaafc4 JA |
2650 | .oval = VERIFY_CRC32C, |
2651 | .help = "Use crc32c checksums for verification (hw assisted, if available)", | |
af497e6a | 2652 | }, |
bac39e0e JA |
2653 | { .ival = "crc32c", |
2654 | .oval = VERIFY_CRC32C, | |
e3aaafc4 | 2655 | .help = "Use crc32c checksums for verification (hw assisted, if available)", |
bac39e0e | 2656 | }, |
969f7ed3 JA |
2657 | { .ival = "crc16", |
2658 | .oval = VERIFY_CRC16, | |
2659 | .help = "Use crc16 checksums for verification", | |
2660 | }, | |
1e154bdb JA |
2661 | { .ival = "crc7", |
2662 | .oval = VERIFY_CRC7, | |
2663 | .help = "Use crc7 checksums for verification", | |
2664 | }, | |
7c353ceb JA |
2665 | { .ival = "sha1", |
2666 | .oval = VERIFY_SHA1, | |
2667 | .help = "Use sha1 checksums for verification", | |
2668 | }, | |
cd14cc10 JA |
2669 | { .ival = "sha256", |
2670 | .oval = VERIFY_SHA256, | |
2671 | .help = "Use sha256 checksums for verification", | |
2672 | }, | |
2673 | { .ival = "sha512", | |
2674 | .oval = VERIFY_SHA512, | |
2675 | .help = "Use sha512 checksums for verification", | |
2676 | }, | |
844ea602 JA |
2677 | { .ival = "xxhash", |
2678 | .oval = VERIFY_XXHASH, | |
2679 | .help = "Use xxhash checksums for verification", | |
2680 | }, | |
b638d82f RP |
2681 | /* Meta information was included into verify_header, |
2682 | * 'meta' verification is implied by default. */ | |
7437ee87 | 2683 | { .ival = "meta", |
b638d82f RP |
2684 | .oval = VERIFY_HDR_ONLY, |
2685 | .help = "Use io information for verification. " | |
2686 | "Now is implied by default, thus option is obsolete, " | |
2687 | "don't use it", | |
7437ee87 | 2688 | }, |
59245381 JA |
2689 | { .ival = "pattern", |
2690 | .oval = VERIFY_PATTERN_NO_HDR, | |
2691 | .help = "Verify strict pattern", | |
2692 | }, | |
36690c9b JA |
2693 | { |
2694 | .ival = "null", | |
2695 | .oval = VERIFY_NULL, | |
2696 | .help = "Pretend to verify", | |
2697 | }, | |
214e1eca JA |
2698 | }, |
2699 | }, | |
005c565a JA |
2700 | { |
2701 | .name = "do_verify", | |
e8b0e958 | 2702 | .lname = "Perform verify step", |
68e1f29a | 2703 | .type = FIO_OPT_BOOL, |
a609f12a | 2704 | .off1 = offsetof(struct thread_options, do_verify), |
005c565a JA |
2705 | .help = "Run verification stage after write", |
2706 | .def = "1", | |
2707 | .parent = "verify", | |
d71c154c | 2708 | .hide = 1, |
e8b0e958 JA |
2709 | .category = FIO_OPT_C_IO, |
2710 | .group = FIO_OPT_G_VERIFY, | |
005c565a | 2711 | }, |
160b966d JA |
2712 | { |
2713 | .name = "verifysort", | |
e8b0e958 | 2714 | .lname = "Verify sort", |
160b966d | 2715 | .type = FIO_OPT_BOOL, |
a609f12a | 2716 | .off1 = offsetof(struct thread_options, verifysort), |
160b966d JA |
2717 | .help = "Sort written verify blocks for read back", |
2718 | .def = "1", | |
c83f2df1 | 2719 | .parent = "verify", |
d71c154c | 2720 | .hide = 1, |
e8b0e958 JA |
2721 | .category = FIO_OPT_C_IO, |
2722 | .group = FIO_OPT_G_VERIFY, | |
160b966d | 2723 | }, |
1ae83d45 JA |
2724 | { |
2725 | .name = "verifysort_nr", | |
cce2fdfe | 2726 | .lname = "Verify Sort Nr", |
1ae83d45 | 2727 | .type = FIO_OPT_INT, |
a609f12a | 2728 | .off1 = offsetof(struct thread_options, verifysort_nr), |
1ae83d45 JA |
2729 | .help = "Pre-load and sort verify blocks for a read workload", |
2730 | .minval = 0, | |
2731 | .maxval = 131072, | |
2732 | .def = "1024", | |
2733 | .parent = "verify", | |
836fcc0f JA |
2734 | .category = FIO_OPT_C_IO, |
2735 | .group = FIO_OPT_G_VERIFY, | |
1ae83d45 | 2736 | }, |
3f9f4e26 | 2737 | { |
a59e170d | 2738 | .name = "verify_interval", |
e8b0e958 | 2739 | .lname = "Verify interval", |
e01b22b8 | 2740 | .type = FIO_OPT_INT, |
a609f12a | 2741 | .off1 = offsetof(struct thread_options, verify_interval), |
819a9680 | 2742 | .minval = 2 * sizeof(struct verify_header), |
a59e170d | 2743 | .help = "Store verify buffer header every N bytes", |
afdf9352 | 2744 | .parent = "verify", |
d71c154c | 2745 | .hide = 1, |
20eb06bd | 2746 | .interval = 2 * sizeof(struct verify_header), |
e8b0e958 JA |
2747 | .category = FIO_OPT_C_IO, |
2748 | .group = FIO_OPT_G_VERIFY, | |
3f9f4e26 | 2749 | }, |
546a9142 | 2750 | { |
a59e170d | 2751 | .name = "verify_offset", |
e8b0e958 | 2752 | .lname = "Verify offset", |
e01b22b8 | 2753 | .type = FIO_OPT_INT, |
a59e170d | 2754 | .help = "Offset verify header location by N bytes", |
a609f12a | 2755 | .off1 = offsetof(struct thread_options, verify_offset), |
203160d5 | 2756 | .minval = sizeof(struct verify_header), |
afdf9352 | 2757 | .parent = "verify", |
d71c154c | 2758 | .hide = 1, |
e8b0e958 JA |
2759 | .category = FIO_OPT_C_IO, |
2760 | .group = FIO_OPT_G_VERIFY, | |
546a9142 | 2761 | }, |
e28218f3 SL |
2762 | { |
2763 | .name = "verify_pattern", | |
e8b0e958 | 2764 | .lname = "Verify pattern", |
0e92f873 | 2765 | .type = FIO_OPT_STR, |
e28218f3 | 2766 | .cb = str_verify_pattern_cb, |
a609f12a | 2767 | .off1 = offsetof(struct thread_options, verify_pattern), |
e28218f3 SL |
2768 | .help = "Fill pattern for IO buffers", |
2769 | .parent = "verify", | |
d71c154c | 2770 | .hide = 1, |
e8b0e958 JA |
2771 | .category = FIO_OPT_C_IO, |
2772 | .group = FIO_OPT_G_VERIFY, | |
e28218f3 | 2773 | }, |
a12a3b4d JA |
2774 | { |
2775 | .name = "verify_fatal", | |
e8b0e958 | 2776 | .lname = "Verify fatal", |
68e1f29a | 2777 | .type = FIO_OPT_BOOL, |
a609f12a | 2778 | .off1 = offsetof(struct thread_options, verify_fatal), |
a12a3b4d JA |
2779 | .def = "0", |
2780 | .help = "Exit on a single verify failure, don't continue", | |
2781 | .parent = "verify", | |
d71c154c | 2782 | .hide = 1, |
e8b0e958 JA |
2783 | .category = FIO_OPT_C_IO, |
2784 | .group = FIO_OPT_G_VERIFY, | |
a12a3b4d | 2785 | }, |
b463e936 JA |
2786 | { |
2787 | .name = "verify_dump", | |
e8b0e958 | 2788 | .lname = "Verify dump", |
b463e936 | 2789 | .type = FIO_OPT_BOOL, |
a609f12a | 2790 | .off1 = offsetof(struct thread_options, verify_dump), |
ef71e317 | 2791 | .def = "0", |
b463e936 JA |
2792 | .help = "Dump contents of good and bad blocks on failure", |
2793 | .parent = "verify", | |
d71c154c | 2794 | .hide = 1, |
e8b0e958 JA |
2795 | .category = FIO_OPT_C_IO, |
2796 | .group = FIO_OPT_G_VERIFY, | |
b463e936 | 2797 | }, |
e8462bd8 JA |
2798 | { |
2799 | .name = "verify_async", | |
e8b0e958 | 2800 | .lname = "Verify asynchronously", |
e8462bd8 | 2801 | .type = FIO_OPT_INT, |
a609f12a | 2802 | .off1 = offsetof(struct thread_options, verify_async), |
e8462bd8 JA |
2803 | .def = "0", |
2804 | .help = "Number of async verifier threads to use", | |
2805 | .parent = "verify", | |
d71c154c | 2806 | .hide = 1, |
e8b0e958 JA |
2807 | .category = FIO_OPT_C_IO, |
2808 | .group = FIO_OPT_G_VERIFY, | |
e8462bd8 | 2809 | }, |
9e144189 JA |
2810 | { |
2811 | .name = "verify_backlog", | |
e8b0e958 | 2812 | .lname = "Verify backlog", |
9e144189 | 2813 | .type = FIO_OPT_STR_VAL, |
a609f12a | 2814 | .off1 = offsetof(struct thread_options, verify_backlog), |
9e144189 JA |
2815 | .help = "Verify after this number of blocks are written", |
2816 | .parent = "verify", | |
d71c154c | 2817 | .hide = 1, |
e8b0e958 JA |
2818 | .category = FIO_OPT_C_IO, |
2819 | .group = FIO_OPT_G_VERIFY, | |
9e144189 JA |
2820 | }, |
2821 | { | |
2822 | .name = "verify_backlog_batch", | |
e8b0e958 | 2823 | .lname = "Verify backlog batch", |
9e144189 | 2824 | .type = FIO_OPT_INT, |
a609f12a | 2825 | .off1 = offsetof(struct thread_options, verify_batch), |
9e144189 | 2826 | .help = "Verify this number of IO blocks", |
0d29de83 | 2827 | .parent = "verify", |
d71c154c | 2828 | .hide = 1, |
e8b0e958 JA |
2829 | .category = FIO_OPT_C_IO, |
2830 | .group = FIO_OPT_G_VERIFY, | |
9e144189 | 2831 | }, |
e8462bd8 JA |
2832 | #ifdef FIO_HAVE_CPU_AFFINITY |
2833 | { | |
2834 | .name = "verify_async_cpus", | |
e8b0e958 | 2835 | .lname = "Async verify CPUs", |
e8462bd8 JA |
2836 | .type = FIO_OPT_STR, |
2837 | .cb = str_verify_cpus_allowed_cb, | |
a609f12a | 2838 | .off1 = offsetof(struct thread_options, verify_cpumask), |
e8462bd8 JA |
2839 | .help = "Set CPUs allowed for async verify threads", |
2840 | .parent = "verify_async", | |
d71c154c | 2841 | .hide = 1, |
e8b0e958 JA |
2842 | .category = FIO_OPT_C_IO, |
2843 | .group = FIO_OPT_G_VERIFY, | |
e8462bd8 | 2844 | }, |
a275c37a JA |
2845 | #else |
2846 | { | |
2847 | .name = "verify_async_cpus", | |
2848 | .lname = "Async verify CPUs", | |
2849 | .type = FIO_OPT_UNSUPPORTED, | |
54d0a315 | 2850 | .help = "Your platform does not support CPU affinities", |
a275c37a | 2851 | }, |
0d29de83 | 2852 | #endif |
51aa2da8 JA |
2853 | { |
2854 | .name = "experimental_verify", | |
cce2fdfe | 2855 | .lname = "Experimental Verify", |
a609f12a | 2856 | .off1 = offsetof(struct thread_options, experimental_verify), |
51aa2da8 | 2857 | .type = FIO_OPT_BOOL, |
b31eaac9 | 2858 | .help = "Enable experimental verification", |
ca09be4b JA |
2859 | .parent = "verify", |
2860 | .category = FIO_OPT_C_IO, | |
2861 | .group = FIO_OPT_G_VERIFY, | |
2862 | }, | |
2863 | { | |
2864 | .name = "verify_state_load", | |
2865 | .lname = "Load verify state", | |
a609f12a | 2866 | .off1 = offsetof(struct thread_options, verify_state), |
ca09be4b JA |
2867 | .type = FIO_OPT_BOOL, |
2868 | .help = "Load verify termination state", | |
2869 | .parent = "verify", | |
2870 | .category = FIO_OPT_C_IO, | |
2871 | .group = FIO_OPT_G_VERIFY, | |
2872 | }, | |
2873 | { | |
2874 | .name = "verify_state_save", | |
2875 | .lname = "Save verify state", | |
a609f12a | 2876 | .off1 = offsetof(struct thread_options, verify_state_save), |
ca09be4b JA |
2877 | .type = FIO_OPT_BOOL, |
2878 | .def = "1", | |
2879 | .help = "Save verify state on termination", | |
2880 | .parent = "verify", | |
836fcc0f JA |
2881 | .category = FIO_OPT_C_IO, |
2882 | .group = FIO_OPT_G_VERIFY, | |
51aa2da8 | 2883 | }, |
0d29de83 JA |
2884 | #ifdef FIO_HAVE_TRIM |
2885 | { | |
2886 | .name = "trim_percentage", | |
e8b0e958 | 2887 | .lname = "Trim percentage", |
0d29de83 | 2888 | .type = FIO_OPT_INT, |
a609f12a | 2889 | .off1 = offsetof(struct thread_options, trim_percentage), |
20eb06bd | 2890 | .minval = 0, |
0d29de83 | 2891 | .maxval = 100, |
169c098d | 2892 | .help = "Number of verify blocks to trim (i.e., discard)", |
0d29de83 JA |
2893 | .parent = "verify", |
2894 | .def = "0", | |
20eb06bd | 2895 | .interval = 1, |
d71c154c | 2896 | .hide = 1, |
e8b0e958 JA |
2897 | .category = FIO_OPT_C_IO, |
2898 | .group = FIO_OPT_G_TRIM, | |
0d29de83 JA |
2899 | }, |
2900 | { | |
2901 | .name = "trim_verify_zero", | |
e8b0e958 | 2902 | .lname = "Verify trim zero", |
20eb06bd | 2903 | .type = FIO_OPT_BOOL, |
169c098d | 2904 | .help = "Verify that trimmed (i.e., discarded) blocks are returned as zeroes", |
a609f12a | 2905 | .off1 = offsetof(struct thread_options, trim_zero), |
0d29de83 | 2906 | .parent = "trim_percentage", |
d71c154c | 2907 | .hide = 1, |
0d29de83 | 2908 | .def = "1", |
e8b0e958 JA |
2909 | .category = FIO_OPT_C_IO, |
2910 | .group = FIO_OPT_G_TRIM, | |
0d29de83 JA |
2911 | }, |
2912 | { | |
2913 | .name = "trim_backlog", | |
e8b0e958 | 2914 | .lname = "Trim backlog", |
0d29de83 | 2915 | .type = FIO_OPT_STR_VAL, |
a609f12a | 2916 | .off1 = offsetof(struct thread_options, trim_backlog), |
0d29de83 JA |
2917 | .help = "Trim after this number of blocks are written", |
2918 | .parent = "trim_percentage", | |
d71c154c | 2919 | .hide = 1, |
20eb06bd | 2920 | .interval = 1, |
e8b0e958 JA |
2921 | .category = FIO_OPT_C_IO, |
2922 | .group = FIO_OPT_G_TRIM, | |
0d29de83 JA |
2923 | }, |
2924 | { | |
2925 | .name = "trim_backlog_batch", | |
e8b0e958 | 2926 | .lname = "Trim backlog batch", |
0d29de83 | 2927 | .type = FIO_OPT_INT, |
a609f12a | 2928 | .off1 = offsetof(struct thread_options, trim_batch), |
0d29de83 JA |
2929 | .help = "Trim this number of IO blocks", |
2930 | .parent = "trim_percentage", | |
d71c154c | 2931 | .hide = 1, |
20eb06bd | 2932 | .interval = 1, |
e8b0e958 JA |
2933 | .category = FIO_OPT_C_IO, |
2934 | .group = FIO_OPT_G_TRIM, | |
0d29de83 | 2935 | }, |
a275c37a JA |
2936 | #else |
2937 | { | |
2938 | .name = "trim_percentage", | |
2939 | .lname = "Trim percentage", | |
2940 | .type = FIO_OPT_UNSUPPORTED, | |
2941 | .help = "Fio does not support TRIM on your platform", | |
2942 | }, | |
2943 | { | |
2944 | .name = "trim_verify_zero", | |
2945 | .lname = "Verify trim zero", | |
2946 | .type = FIO_OPT_UNSUPPORTED, | |
2947 | .help = "Fio does not support TRIM on your platform", | |
2948 | }, | |
2949 | { | |
2950 | .name = "trim_backlog", | |
2951 | .lname = "Trim backlog", | |
2952 | .type = FIO_OPT_UNSUPPORTED, | |
2953 | .help = "Fio does not support TRIM on your platform", | |
2954 | }, | |
2955 | { | |
2956 | .name = "trim_backlog_batch", | |
2957 | .lname = "Trim backlog batch", | |
2958 | .type = FIO_OPT_UNSUPPORTED, | |
2959 | .help = "Fio does not support TRIM on your platform", | |
2960 | }, | |
e8462bd8 | 2961 | #endif |
214e1eca JA |
2962 | { |
2963 | .name = "write_iolog", | |
e8b0e958 | 2964 | .lname = "Write I/O log", |
214e1eca | 2965 | .type = FIO_OPT_STR_STORE, |
a609f12a | 2966 | .off1 = offsetof(struct thread_options, write_iolog_file), |
214e1eca | 2967 | .help = "Store IO pattern to file", |
e8b0e958 JA |
2968 | .category = FIO_OPT_C_IO, |
2969 | .group = FIO_OPT_G_IOLOG, | |
214e1eca JA |
2970 | }, |
2971 | { | |
2972 | .name = "read_iolog", | |
e8b0e958 | 2973 | .lname = "Read I/O log", |
214e1eca | 2974 | .type = FIO_OPT_STR_STORE, |
a609f12a | 2975 | .off1 = offsetof(struct thread_options, read_iolog_file), |
214e1eca | 2976 | .help = "Playback IO pattern from file", |
e8b0e958 JA |
2977 | .category = FIO_OPT_C_IO, |
2978 | .group = FIO_OPT_G_IOLOG, | |
214e1eca | 2979 | }, |
64bbb865 DN |
2980 | { |
2981 | .name = "replay_no_stall", | |
e8b0e958 | 2982 | .lname = "Don't stall on replay", |
20eb06bd | 2983 | .type = FIO_OPT_BOOL, |
a609f12a | 2984 | .off1 = offsetof(struct thread_options, no_stall), |
64bbb865 | 2985 | .def = "0", |
87e7a972 | 2986 | .parent = "read_iolog", |
d71c154c | 2987 | .hide = 1, |
64bbb865 | 2988 | .help = "Playback IO pattern file as fast as possible without stalls", |
e8b0e958 JA |
2989 | .category = FIO_OPT_C_IO, |
2990 | .group = FIO_OPT_G_IOLOG, | |
64bbb865 | 2991 | }, |
d1c46c04 DN |
2992 | { |
2993 | .name = "replay_redirect", | |
e8b0e958 | 2994 | .lname = "Redirect device for replay", |
d1c46c04 | 2995 | .type = FIO_OPT_STR_STORE, |
a609f12a | 2996 | .off1 = offsetof(struct thread_options, replay_redirect), |
d1c46c04 | 2997 | .parent = "read_iolog", |
d71c154c | 2998 | .hide = 1, |
d1c46c04 | 2999 | .help = "Replay all I/O onto this device, regardless of trace device", |
e8b0e958 JA |
3000 | .category = FIO_OPT_C_IO, |
3001 | .group = FIO_OPT_G_IOLOG, | |
d1c46c04 | 3002 | }, |
0c63576e JA |
3003 | { |
3004 | .name = "replay_scale", | |
3005 | .lname = "Replace offset scale factor", | |
3006 | .type = FIO_OPT_INT, | |
a609f12a | 3007 | .off1 = offsetof(struct thread_options, replay_scale), |
0c63576e JA |
3008 | .parent = "read_iolog", |
3009 | .def = "1", | |
3010 | .help = "Align offsets to this blocksize", | |
3011 | .category = FIO_OPT_C_IO, | |
3012 | .group = FIO_OPT_G_IOLOG, | |
3013 | }, | |
3014 | { | |
3015 | .name = "replay_align", | |
3016 | .lname = "Replace alignment", | |
3017 | .type = FIO_OPT_INT, | |
a609f12a | 3018 | .off1 = offsetof(struct thread_options, replay_align), |
0c63576e JA |
3019 | .parent = "read_iolog", |
3020 | .help = "Scale offset down by this factor", | |
3021 | .category = FIO_OPT_C_IO, | |
3022 | .group = FIO_OPT_G_IOLOG, | |
3023 | .pow2 = 1, | |
3024 | }, | |
214e1eca JA |
3025 | { |
3026 | .name = "exec_prerun", | |
e8b0e958 | 3027 | .lname = "Pre-execute runnable", |
214e1eca | 3028 | .type = FIO_OPT_STR_STORE, |
a609f12a | 3029 | .off1 = offsetof(struct thread_options, exec_prerun), |
214e1eca | 3030 | .help = "Execute this file prior to running job", |
e8b0e958 JA |
3031 | .category = FIO_OPT_C_GENERAL, |
3032 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
3033 | }, |
3034 | { | |
3035 | .name = "exec_postrun", | |
e8b0e958 | 3036 | .lname = "Post-execute runnable", |
214e1eca | 3037 | .type = FIO_OPT_STR_STORE, |
a609f12a | 3038 | .off1 = offsetof(struct thread_options, exec_postrun), |
214e1eca | 3039 | .help = "Execute this file after running job", |
e8b0e958 JA |
3040 | .category = FIO_OPT_C_GENERAL, |
3041 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
3042 | }, |
3043 | #ifdef FIO_HAVE_IOSCHED_SWITCH | |
3044 | { | |
3045 | .name = "ioscheduler", | |
e8b0e958 | 3046 | .lname = "I/O scheduler", |
214e1eca | 3047 | .type = FIO_OPT_STR_STORE, |
a609f12a | 3048 | .off1 = offsetof(struct thread_options, ioscheduler), |
214e1eca | 3049 | .help = "Use this IO scheduler on the backing device", |
e8b0e958 JA |
3050 | .category = FIO_OPT_C_FILE, |
3051 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 3052 | }, |
a275c37a JA |
3053 | #else |
3054 | { | |
3055 | .name = "ioscheduler", | |
3056 | .lname = "I/O scheduler", | |
3057 | .type = FIO_OPT_UNSUPPORTED, | |
3058 | .help = "Your platform does not support IO scheduler switching", | |
3059 | }, | |
214e1eca JA |
3060 | #endif |
3061 | { | |
3062 | .name = "zonesize", | |
e8b0e958 | 3063 | .lname = "Zone size", |
214e1eca | 3064 | .type = FIO_OPT_STR_VAL, |
a609f12a | 3065 | .off1 = offsetof(struct thread_options, zone_size), |
ed335855 SN |
3066 | .help = "Amount of data to read per zone", |
3067 | .def = "0", | |
20eb06bd | 3068 | .interval = 1024 * 1024, |
e8b0e958 JA |
3069 | .category = FIO_OPT_C_IO, |
3070 | .group = FIO_OPT_G_ZONE, | |
ed335855 SN |
3071 | }, |
3072 | { | |
3073 | .name = "zonerange", | |
e8b0e958 | 3074 | .lname = "Zone range", |
ed335855 | 3075 | .type = FIO_OPT_STR_VAL, |
a609f12a | 3076 | .off1 = offsetof(struct thread_options, zone_range), |
214e1eca JA |
3077 | .help = "Give size of an IO zone", |
3078 | .def = "0", | |
20eb06bd | 3079 | .interval = 1024 * 1024, |
e8b0e958 JA |
3080 | .category = FIO_OPT_C_IO, |
3081 | .group = FIO_OPT_G_ZONE, | |
214e1eca JA |
3082 | }, |
3083 | { | |
3084 | .name = "zoneskip", | |
e8b0e958 | 3085 | .lname = "Zone skip", |
214e1eca | 3086 | .type = FIO_OPT_STR_VAL, |
a609f12a | 3087 | .off1 = offsetof(struct thread_options, zone_skip), |
214e1eca JA |
3088 | .help = "Space between IO zones", |
3089 | .def = "0", | |
20eb06bd | 3090 | .interval = 1024 * 1024, |
e8b0e958 JA |
3091 | .category = FIO_OPT_C_IO, |
3092 | .group = FIO_OPT_G_ZONE, | |
214e1eca JA |
3093 | }, |
3094 | { | |
3095 | .name = "lockmem", | |
e8b0e958 | 3096 | .lname = "Lock memory", |
214e1eca | 3097 | .type = FIO_OPT_STR_VAL, |
a609f12a | 3098 | .off1 = offsetof(struct thread_options, lockmem), |
81c6b6cd | 3099 | .help = "Lock down this amount of memory (per worker)", |
214e1eca | 3100 | .def = "0", |
20eb06bd | 3101 | .interval = 1024 * 1024, |
e8b0e958 JA |
3102 | .category = FIO_OPT_C_GENERAL, |
3103 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 3104 | }, |
214e1eca JA |
3105 | { |
3106 | .name = "rwmixread", | |
e8b0e958 | 3107 | .lname = "Read/write mix read", |
214e1eca | 3108 | .type = FIO_OPT_INT, |
cb499fc4 | 3109 | .cb = str_rwmix_read_cb, |
a609f12a | 3110 | .off1 = offsetof(struct thread_options, rwmix[DDIR_READ]), |
214e1eca JA |
3111 | .maxval = 100, |
3112 | .help = "Percentage of mixed workload that is reads", | |
3113 | .def = "50", | |
20eb06bd | 3114 | .interval = 5, |
90265353 | 3115 | .inverse = "rwmixwrite", |
e8b0e958 JA |
3116 | .category = FIO_OPT_C_IO, |
3117 | .group = FIO_OPT_G_RWMIX, | |
214e1eca JA |
3118 | }, |
3119 | { | |
3120 | .name = "rwmixwrite", | |
e8b0e958 | 3121 | .lname = "Read/write mix write", |
214e1eca | 3122 | .type = FIO_OPT_INT, |
cb499fc4 | 3123 | .cb = str_rwmix_write_cb, |
a609f12a | 3124 | .off1 = offsetof(struct thread_options, rwmix[DDIR_WRITE]), |
214e1eca JA |
3125 | .maxval = 100, |
3126 | .help = "Percentage of mixed workload that is writes", | |
3127 | .def = "50", | |
20eb06bd | 3128 | .interval = 5, |
90265353 | 3129 | .inverse = "rwmixread", |
e8b0e958 JA |
3130 | .category = FIO_OPT_C_IO, |
3131 | .group = FIO_OPT_G_RWMIX, | |
214e1eca | 3132 | }, |
afdf9352 JA |
3133 | { |
3134 | .name = "rwmixcycle", | |
e8b0e958 | 3135 | .lname = "Read/write mix cycle", |
15ca150e | 3136 | .type = FIO_OPT_DEPRECATED, |
e8b0e958 JA |
3137 | .category = FIO_OPT_C_IO, |
3138 | .group = FIO_OPT_G_RWMIX, | |
afdf9352 | 3139 | }, |
214e1eca JA |
3140 | { |
3141 | .name = "nice", | |
e8b0e958 | 3142 | .lname = "Nice", |
214e1eca | 3143 | .type = FIO_OPT_INT, |
a609f12a | 3144 | .off1 = offsetof(struct thread_options, nice), |
214e1eca JA |
3145 | .help = "Set job CPU nice value", |
3146 | .minval = -19, | |
3147 | .maxval = 20, | |
3148 | .def = "0", | |
20eb06bd | 3149 | .interval = 1, |
e8b0e958 | 3150 | .category = FIO_OPT_C_GENERAL, |
10860056 | 3151 | .group = FIO_OPT_G_CRED, |
214e1eca JA |
3152 | }, |
3153 | #ifdef FIO_HAVE_IOPRIO | |
3154 | { | |
3155 | .name = "prio", | |
e8b0e958 | 3156 | .lname = "I/O nice priority", |
214e1eca | 3157 | .type = FIO_OPT_INT, |
a609f12a | 3158 | .off1 = offsetof(struct thread_options, ioprio), |
214e1eca | 3159 | .help = "Set job IO priority value", |
1767bd34 TK |
3160 | .minval = IOPRIO_MIN_PRIO, |
3161 | .maxval = IOPRIO_MAX_PRIO, | |
20eb06bd | 3162 | .interval = 1, |
e8b0e958 | 3163 | .category = FIO_OPT_C_GENERAL, |
10860056 | 3164 | .group = FIO_OPT_G_CRED, |
214e1eca | 3165 | }, |
32ef447a TK |
3166 | #else |
3167 | { | |
3168 | .name = "prio", | |
3169 | .lname = "I/O nice priority", | |
3170 | .type = FIO_OPT_UNSUPPORTED, | |
3171 | .help = "Your platform does not support IO priorities", | |
3172 | }, | |
3173 | #endif | |
3174 | #ifdef FIO_HAVE_IOPRIO_CLASS | |
3175 | #ifndef FIO_HAVE_IOPRIO | |
3176 | #error "FIO_HAVE_IOPRIO_CLASS requires FIO_HAVE_IOPRIO" | |
3177 | #endif | |
214e1eca JA |
3178 | { |
3179 | .name = "prioclass", | |
e8b0e958 | 3180 | .lname = "I/O nice priority class", |
214e1eca | 3181 | .type = FIO_OPT_INT, |
a609f12a | 3182 | .off1 = offsetof(struct thread_options, ioprio_class), |
214e1eca | 3183 | .help = "Set job IO priority class", |
1767bd34 TK |
3184 | .minval = IOPRIO_MIN_PRIO_CLASS, |
3185 | .maxval = IOPRIO_MAX_PRIO_CLASS, | |
20eb06bd | 3186 | .interval = 1, |
e8b0e958 | 3187 | .category = FIO_OPT_C_GENERAL, |
10860056 | 3188 | .group = FIO_OPT_G_CRED, |
214e1eca | 3189 | }, |
a275c37a | 3190 | #else |
a275c37a JA |
3191 | { |
3192 | .name = "prioclass", | |
3193 | .lname = "I/O nice priority class", | |
3194 | .type = FIO_OPT_UNSUPPORTED, | |
32ef447a | 3195 | .help = "Your platform does not support IO priority classes", |
a275c37a | 3196 | }, |
214e1eca JA |
3197 | #endif |
3198 | { | |
3199 | .name = "thinktime", | |
e8b0e958 | 3200 | .lname = "Thinktime", |
214e1eca | 3201 | .type = FIO_OPT_INT, |
a609f12a | 3202 | .off1 = offsetof(struct thread_options, thinktime), |
214e1eca JA |
3203 | .help = "Idle time between IO buffers (usec)", |
3204 | .def = "0", | |
88038bc7 | 3205 | .is_time = 1, |
e8b0e958 | 3206 | .category = FIO_OPT_C_IO, |
3ceb458f | 3207 | .group = FIO_OPT_G_THINKTIME, |
214e1eca JA |
3208 | }, |
3209 | { | |
3210 | .name = "thinktime_spin", | |
e8b0e958 | 3211 | .lname = "Thinktime spin", |
214e1eca | 3212 | .type = FIO_OPT_INT, |
a609f12a | 3213 | .off1 = offsetof(struct thread_options, thinktime_spin), |
214e1eca JA |
3214 | .help = "Start think time by spinning this amount (usec)", |
3215 | .def = "0", | |
88038bc7 | 3216 | .is_time = 1, |
afdf9352 | 3217 | .parent = "thinktime", |
d71c154c | 3218 | .hide = 1, |
e8b0e958 | 3219 | .category = FIO_OPT_C_IO, |
3ceb458f | 3220 | .group = FIO_OPT_G_THINKTIME, |
214e1eca JA |
3221 | }, |
3222 | { | |
3223 | .name = "thinktime_blocks", | |
e8b0e958 | 3224 | .lname = "Thinktime blocks", |
214e1eca | 3225 | .type = FIO_OPT_INT, |
a609f12a | 3226 | .off1 = offsetof(struct thread_options, thinktime_blocks), |
214e1eca JA |
3227 | .help = "IO buffer period between 'thinktime'", |
3228 | .def = "1", | |
afdf9352 | 3229 | .parent = "thinktime", |
d71c154c | 3230 | .hide = 1, |
e8b0e958 | 3231 | .category = FIO_OPT_C_IO, |
3ceb458f | 3232 | .group = FIO_OPT_G_THINKTIME, |
214e1eca JA |
3233 | }, |
3234 | { | |
3235 | .name = "rate", | |
e8b0e958 | 3236 | .lname = "I/O rate", |
e01b22b8 | 3237 | .type = FIO_OPT_INT, |
a609f12a JA |
3238 | .off1 = offsetof(struct thread_options, rate[DDIR_READ]), |
3239 | .off2 = offsetof(struct thread_options, rate[DDIR_WRITE]), | |
3240 | .off3 = offsetof(struct thread_options, rate[DDIR_TRIM]), | |
214e1eca | 3241 | .help = "Set bandwidth rate", |
e8b0e958 JA |
3242 | .category = FIO_OPT_C_IO, |
3243 | .group = FIO_OPT_G_RATE, | |
214e1eca JA |
3244 | }, |
3245 | { | |
6d428bcd JA |
3246 | .name = "rate_min", |
3247 | .alias = "ratemin", | |
e8b0e958 | 3248 | .lname = "I/O min rate", |
e01b22b8 | 3249 | .type = FIO_OPT_INT, |
a609f12a JA |
3250 | .off1 = offsetof(struct thread_options, ratemin[DDIR_READ]), |
3251 | .off2 = offsetof(struct thread_options, ratemin[DDIR_WRITE]), | |
3252 | .off3 = offsetof(struct thread_options, ratemin[DDIR_TRIM]), | |
4e991c23 | 3253 | .help = "Job must meet this rate or it will be shutdown", |
afdf9352 | 3254 | .parent = "rate", |
d71c154c | 3255 | .hide = 1, |
e8b0e958 JA |
3256 | .category = FIO_OPT_C_IO, |
3257 | .group = FIO_OPT_G_RATE, | |
4e991c23 JA |
3258 | }, |
3259 | { | |
3260 | .name = "rate_iops", | |
e8b0e958 | 3261 | .lname = "I/O rate IOPS", |
e01b22b8 | 3262 | .type = FIO_OPT_INT, |
a609f12a JA |
3263 | .off1 = offsetof(struct thread_options, rate_iops[DDIR_READ]), |
3264 | .off2 = offsetof(struct thread_options, rate_iops[DDIR_WRITE]), | |
3265 | .off3 = offsetof(struct thread_options, rate_iops[DDIR_TRIM]), | |
4e991c23 | 3266 | .help = "Limit IO used to this number of IO operations/sec", |
d71c154c | 3267 | .hide = 1, |
e8b0e958 JA |
3268 | .category = FIO_OPT_C_IO, |
3269 | .group = FIO_OPT_G_RATE, | |
4e991c23 JA |
3270 | }, |
3271 | { | |
3272 | .name = "rate_iops_min", | |
e8b0e958 | 3273 | .lname = "I/O min rate IOPS", |
e01b22b8 | 3274 | .type = FIO_OPT_INT, |
a609f12a JA |
3275 | .off1 = offsetof(struct thread_options, rate_iops_min[DDIR_READ]), |
3276 | .off2 = offsetof(struct thread_options, rate_iops_min[DDIR_WRITE]), | |
3277 | .off3 = offsetof(struct thread_options, rate_iops_min[DDIR_TRIM]), | |
03e20d68 | 3278 | .help = "Job must meet this rate or it will be shut down", |
afdf9352 | 3279 | .parent = "rate_iops", |
d71c154c | 3280 | .hide = 1, |
e8b0e958 JA |
3281 | .category = FIO_OPT_C_IO, |
3282 | .group = FIO_OPT_G_RATE, | |
214e1eca | 3283 | }, |
ff6bb260 | 3284 | { |
6de65959 JA |
3285 | .name = "rate_process", |
3286 | .lname = "Rate Process", | |
3287 | .type = FIO_OPT_STR, | |
a609f12a | 3288 | .off1 = offsetof(struct thread_options, rate_process), |
6de65959 JA |
3289 | .help = "What process controls how rated IO is managed", |
3290 | .def = "linear", | |
ff6bb260 SL |
3291 | .category = FIO_OPT_C_IO, |
3292 | .group = FIO_OPT_G_RATE, | |
6de65959 JA |
3293 | .posval = { |
3294 | { .ival = "linear", | |
3295 | .oval = RATE_PROCESS_LINEAR, | |
3296 | .help = "Linear rate of IO", | |
3297 | }, | |
3298 | { | |
3299 | .ival = "poisson", | |
3300 | .oval = RATE_PROCESS_POISSON, | |
3301 | .help = "Rate follows Poisson process", | |
3302 | }, | |
3303 | }, | |
3304 | .parent = "rate", | |
ff6bb260 | 3305 | }, |
214e1eca | 3306 | { |
6d428bcd JA |
3307 | .name = "rate_cycle", |
3308 | .alias = "ratecycle", | |
e8b0e958 | 3309 | .lname = "I/O rate cycle", |
214e1eca | 3310 | .type = FIO_OPT_INT, |
a609f12a | 3311 | .off1 = offsetof(struct thread_options, ratecycle), |
214e1eca JA |
3312 | .help = "Window average for rate limits (msec)", |
3313 | .def = "1000", | |
afdf9352 | 3314 | .parent = "rate", |
d71c154c | 3315 | .hide = 1, |
e8b0e958 JA |
3316 | .category = FIO_OPT_C_IO, |
3317 | .group = FIO_OPT_G_RATE, | |
214e1eca | 3318 | }, |
15501535 JA |
3319 | { |
3320 | .name = "max_latency", | |
cce2fdfe | 3321 | .lname = "Max Latency", |
15501535 | 3322 | .type = FIO_OPT_INT, |
a609f12a | 3323 | .off1 = offsetof(struct thread_options, max_latency), |
15501535 | 3324 | .help = "Maximum tolerated IO latency (usec)", |
88038bc7 | 3325 | .is_time = 1, |
1e5324e7 | 3326 | .category = FIO_OPT_C_IO, |
3e260a46 JA |
3327 | .group = FIO_OPT_G_LATPROF, |
3328 | }, | |
3329 | { | |
3330 | .name = "latency_target", | |
3331 | .lname = "Latency Target (usec)", | |
3332 | .type = FIO_OPT_STR_VAL_TIME, | |
a609f12a | 3333 | .off1 = offsetof(struct thread_options, latency_target), |
3e260a46 | 3334 | .help = "Ramp to max queue depth supporting this latency", |
88038bc7 | 3335 | .is_time = 1, |
3e260a46 JA |
3336 | .category = FIO_OPT_C_IO, |
3337 | .group = FIO_OPT_G_LATPROF, | |
3338 | }, | |
3339 | { | |
3340 | .name = "latency_window", | |
3341 | .lname = "Latency Window (usec)", | |
3342 | .type = FIO_OPT_STR_VAL_TIME, | |
a609f12a | 3343 | .off1 = offsetof(struct thread_options, latency_window), |
3e260a46 | 3344 | .help = "Time to sustain latency_target", |
88038bc7 | 3345 | .is_time = 1, |
3e260a46 JA |
3346 | .category = FIO_OPT_C_IO, |
3347 | .group = FIO_OPT_G_LATPROF, | |
3348 | }, | |
3349 | { | |
3350 | .name = "latency_percentile", | |
3351 | .lname = "Latency Percentile", | |
3352 | .type = FIO_OPT_FLOAT_LIST, | |
a609f12a | 3353 | .off1 = offsetof(struct thread_options, latency_percentile), |
3e260a46 JA |
3354 | .help = "Percentile of IOs must be below latency_target", |
3355 | .def = "100", | |
3356 | .maxlen = 1, | |
3357 | .minfp = 0.0, | |
3358 | .maxfp = 100.0, | |
3359 | .category = FIO_OPT_C_IO, | |
3360 | .group = FIO_OPT_G_LATPROF, | |
15501535 | 3361 | }, |
214e1eca JA |
3362 | { |
3363 | .name = "invalidate", | |
e8b0e958 | 3364 | .lname = "Cache invalidate", |
214e1eca | 3365 | .type = FIO_OPT_BOOL, |
a609f12a | 3366 | .off1 = offsetof(struct thread_options, invalidate_cache), |
214e1eca JA |
3367 | .help = "Invalidate buffer/page cache prior to running job", |
3368 | .def = "1", | |
e8b0e958 | 3369 | .category = FIO_OPT_C_IO, |
3ceb458f | 3370 | .group = FIO_OPT_G_IO_TYPE, |
214e1eca JA |
3371 | }, |
3372 | { | |
3373 | .name = "sync", | |
e8b0e958 | 3374 | .lname = "Synchronous I/O", |
214e1eca | 3375 | .type = FIO_OPT_BOOL, |
a609f12a | 3376 | .off1 = offsetof(struct thread_options, sync_io), |
214e1eca JA |
3377 | .help = "Use O_SYNC for buffered writes", |
3378 | .def = "0", | |
67a1000f | 3379 | .parent = "buffered", |
d71c154c | 3380 | .hide = 1, |
e8b0e958 | 3381 | .category = FIO_OPT_C_IO, |
3ceb458f | 3382 | .group = FIO_OPT_G_IO_TYPE, |
214e1eca | 3383 | }, |
214e1eca JA |
3384 | { |
3385 | .name = "create_serialize", | |
e8b0e958 | 3386 | .lname = "Create serialize", |
214e1eca | 3387 | .type = FIO_OPT_BOOL, |
a609f12a | 3388 | .off1 = offsetof(struct thread_options, create_serialize), |
c2b8035f | 3389 | .help = "Serialize creation of job files", |
214e1eca | 3390 | .def = "1", |
e8b0e958 JA |
3391 | .category = FIO_OPT_C_FILE, |
3392 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
3393 | }, |
3394 | { | |
3395 | .name = "create_fsync", | |
e8b0e958 | 3396 | .lname = "Create fsync", |
214e1eca | 3397 | .type = FIO_OPT_BOOL, |
a609f12a | 3398 | .off1 = offsetof(struct thread_options, create_fsync), |
03e20d68 | 3399 | .help = "fsync file after creation", |
214e1eca | 3400 | .def = "1", |
e8b0e958 JA |
3401 | .category = FIO_OPT_C_FILE, |
3402 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 3403 | }, |
814452bd JA |
3404 | { |
3405 | .name = "create_on_open", | |
e8b0e958 | 3406 | .lname = "Create on open", |
814452bd | 3407 | .type = FIO_OPT_BOOL, |
a609f12a | 3408 | .off1 = offsetof(struct thread_options, create_on_open), |
814452bd JA |
3409 | .help = "Create files when they are opened for IO", |
3410 | .def = "0", | |
e8b0e958 JA |
3411 | .category = FIO_OPT_C_FILE, |
3412 | .group = FIO_OPT_G_INVALID, | |
814452bd | 3413 | }, |
25460cf6 JA |
3414 | { |
3415 | .name = "create_only", | |
cce2fdfe | 3416 | .lname = "Create Only", |
25460cf6 | 3417 | .type = FIO_OPT_BOOL, |
a609f12a | 3418 | .off1 = offsetof(struct thread_options, create_only), |
25460cf6 | 3419 | .help = "Only perform file creation phase", |
d17fda71 | 3420 | .category = FIO_OPT_C_FILE, |
25460cf6 JA |
3421 | .def = "0", |
3422 | }, | |
2378826d JA |
3423 | { |
3424 | .name = "allow_file_create", | |
e81ecca3 | 3425 | .lname = "Allow file create", |
2378826d | 3426 | .type = FIO_OPT_BOOL, |
a609f12a | 3427 | .off1 = offsetof(struct thread_options, allow_create), |
2378826d JA |
3428 | .help = "Permit fio to create files, if they don't exist", |
3429 | .def = "1", | |
3430 | .category = FIO_OPT_C_FILE, | |
3431 | .group = FIO_OPT_G_FILENAME, | |
3432 | }, | |
e81ecca3 JA |
3433 | { |
3434 | .name = "allow_mounted_write", | |
3435 | .lname = "Allow mounted write", | |
3436 | .type = FIO_OPT_BOOL, | |
a609f12a | 3437 | .off1 = offsetof(struct thread_options, allow_mounted_write), |
e81ecca3 JA |
3438 | .help = "Allow writes to a mounted partition", |
3439 | .def = "0", | |
3440 | .category = FIO_OPT_C_FILE, | |
3441 | .group = FIO_OPT_G_FILENAME, | |
3442 | }, | |
0b9d69ec | 3443 | { |
afad68f7 | 3444 | .name = "pre_read", |
e8b0e958 | 3445 | .lname = "Pre-read files", |
afad68f7 | 3446 | .type = FIO_OPT_BOOL, |
a609f12a | 3447 | .off1 = offsetof(struct thread_options, pre_read), |
03e20d68 | 3448 | .help = "Pre-read files before starting official testing", |
afad68f7 | 3449 | .def = "0", |
e8b0e958 JA |
3450 | .category = FIO_OPT_C_FILE, |
3451 | .group = FIO_OPT_G_INVALID, | |
afad68f7 | 3452 | }, |
214e1eca JA |
3453 | #ifdef FIO_HAVE_CPU_AFFINITY |
3454 | { | |
3455 | .name = "cpumask", | |
e8b0e958 | 3456 | .lname = "CPU mask", |
214e1eca JA |
3457 | .type = FIO_OPT_INT, |
3458 | .cb = str_cpumask_cb, | |
a609f12a | 3459 | .off1 = offsetof(struct thread_options, cpumask), |
214e1eca | 3460 | .help = "CPU affinity mask", |
e8b0e958 | 3461 | .category = FIO_OPT_C_GENERAL, |
10860056 | 3462 | .group = FIO_OPT_G_CRED, |
214e1eca | 3463 | }, |
d2e268b0 JA |
3464 | { |
3465 | .name = "cpus_allowed", | |
e8b0e958 | 3466 | .lname = "CPUs allowed", |
d2e268b0 JA |
3467 | .type = FIO_OPT_STR, |
3468 | .cb = str_cpus_allowed_cb, | |
a609f12a | 3469 | .off1 = offsetof(struct thread_options, cpumask), |
d2e268b0 | 3470 | .help = "Set CPUs allowed", |
e8b0e958 | 3471 | .category = FIO_OPT_C_GENERAL, |
10860056 | 3472 | .group = FIO_OPT_G_CRED, |
d2e268b0 | 3473 | }, |
c2acfbac JA |
3474 | { |
3475 | .name = "cpus_allowed_policy", | |
3476 | .lname = "CPUs allowed distribution policy", | |
3477 | .type = FIO_OPT_STR, | |
a609f12a | 3478 | .off1 = offsetof(struct thread_options, cpus_allowed_policy), |
c2acfbac JA |
3479 | .help = "Distribution policy for cpus_allowed", |
3480 | .parent = "cpus_allowed", | |
3481 | .prio = 1, | |
3482 | .posval = { | |
3483 | { .ival = "shared", | |
3484 | .oval = FIO_CPUS_SHARED, | |
3485 | .help = "Mask shared between threads", | |
3486 | }, | |
3487 | { .ival = "split", | |
3488 | .oval = FIO_CPUS_SPLIT, | |
3489 | .help = "Mask split between threads", | |
3490 | }, | |
3491 | }, | |
3492 | .category = FIO_OPT_C_GENERAL, | |
3493 | .group = FIO_OPT_G_CRED, | |
3494 | }, | |
a275c37a JA |
3495 | #else |
3496 | { | |
3497 | .name = "cpumask", | |
3498 | .lname = "CPU mask", | |
3499 | .type = FIO_OPT_UNSUPPORTED, | |
3500 | .help = "Your platform does not support CPU affinities", | |
3501 | }, | |
3502 | { | |
3503 | .name = "cpus_allowed", | |
3504 | .lname = "CPUs allowed", | |
3505 | .type = FIO_OPT_UNSUPPORTED, | |
3506 | .help = "Your platform does not support CPU affinities", | |
3507 | }, | |
3508 | { | |
3509 | .name = "cpus_allowed_policy", | |
3510 | .lname = "CPUs allowed distribution policy", | |
3511 | .type = FIO_OPT_UNSUPPORTED, | |
3512 | .help = "Your platform does not support CPU affinities", | |
3513 | }, | |
d0b937ed | 3514 | #endif |
67bf9823 | 3515 | #ifdef CONFIG_LIBNUMA |
d0b937ed YR |
3516 | { |
3517 | .name = "numa_cpu_nodes", | |
cce2fdfe | 3518 | .lname = "NUMA CPU Nodes", |
d0b937ed YR |
3519 | .type = FIO_OPT_STR, |
3520 | .cb = str_numa_cpunodes_cb, | |
a609f12a | 3521 | .off1 = offsetof(struct thread_options, numa_cpunodes), |
d0b937ed | 3522 | .help = "NUMA CPU nodes bind", |
6be54b2d JA |
3523 | .category = FIO_OPT_C_GENERAL, |
3524 | .group = FIO_OPT_G_INVALID, | |
d0b937ed YR |
3525 | }, |
3526 | { | |
3527 | .name = "numa_mem_policy", | |
cce2fdfe | 3528 | .lname = "NUMA Memory Policy", |
d0b937ed YR |
3529 | .type = FIO_OPT_STR, |
3530 | .cb = str_numa_mpol_cb, | |
a609f12a | 3531 | .off1 = offsetof(struct thread_options, numa_memnodes), |
d0b937ed | 3532 | .help = "NUMA memory policy setup", |
6be54b2d JA |
3533 | .category = FIO_OPT_C_GENERAL, |
3534 | .group = FIO_OPT_G_INVALID, | |
d0b937ed | 3535 | }, |
a275c37a JA |
3536 | #else |
3537 | { | |
3538 | .name = "numa_cpu_nodes", | |
3539 | .lname = "NUMA CPU Nodes", | |
3540 | .type = FIO_OPT_UNSUPPORTED, | |
3541 | .help = "Build fio with libnuma-dev(el) to enable this option", | |
3542 | }, | |
3543 | { | |
3544 | .name = "numa_mem_policy", | |
3545 | .lname = "NUMA Memory Policy", | |
3546 | .type = FIO_OPT_UNSUPPORTED, | |
3547 | .help = "Build fio with libnuma-dev(el) to enable this option", | |
3548 | }, | |
214e1eca JA |
3549 | #endif |
3550 | { | |
3551 | .name = "end_fsync", | |
e8b0e958 | 3552 | .lname = "End fsync", |
214e1eca | 3553 | .type = FIO_OPT_BOOL, |
a609f12a | 3554 | .off1 = offsetof(struct thread_options, end_fsync), |
214e1eca JA |
3555 | .help = "Include fsync at the end of job", |
3556 | .def = "0", | |
e8b0e958 JA |
3557 | .category = FIO_OPT_C_FILE, |
3558 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
3559 | }, |
3560 | { | |
3561 | .name = "fsync_on_close", | |
e8b0e958 | 3562 | .lname = "Fsync on close", |
214e1eca | 3563 | .type = FIO_OPT_BOOL, |
a609f12a | 3564 | .off1 = offsetof(struct thread_options, fsync_on_close), |
214e1eca JA |
3565 | .help = "fsync files on close", |
3566 | .def = "0", | |
e8b0e958 JA |
3567 | .category = FIO_OPT_C_FILE, |
3568 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
3569 | }, |
3570 | { | |
3571 | .name = "unlink", | |
e8b0e958 | 3572 | .lname = "Unlink file", |
214e1eca | 3573 | .type = FIO_OPT_BOOL, |
a609f12a | 3574 | .off1 = offsetof(struct thread_options, unlink), |
214e1eca JA |
3575 | .help = "Unlink created files after job has completed", |
3576 | .def = "0", | |
e8b0e958 JA |
3577 | .category = FIO_OPT_C_FILE, |
3578 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 3579 | }, |
39c1c323 | 3580 | { |
3581 | .name = "unlink_each_loop", | |
3582 | .lname = "Unlink file after each loop of a job", | |
3583 | .type = FIO_OPT_BOOL, | |
a609f12a | 3584 | .off1 = offsetof(struct thread_options, unlink_each_loop), |
39c1c323 | 3585 | .help = "Unlink created files after each loop in a job has completed", |
3586 | .def = "0", | |
3587 | .category = FIO_OPT_C_FILE, | |
3588 | .group = FIO_OPT_G_INVALID, | |
3589 | }, | |
214e1eca JA |
3590 | { |
3591 | .name = "exitall", | |
e8b0e958 | 3592 | .lname = "Exit-all on terminate", |
214e1eca JA |
3593 | .type = FIO_OPT_STR_SET, |
3594 | .cb = str_exitall_cb, | |
3595 | .help = "Terminate all jobs when one exits", | |
e8b0e958 | 3596 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 3597 | .group = FIO_OPT_G_PROCESS, |
214e1eca | 3598 | }, |
f9cafb12 JA |
3599 | { |
3600 | .name = "exitall_on_error", | |
3601 | .lname = "Exit-all on terminate in error", | |
78abcf9b | 3602 | .type = FIO_OPT_STR_SET, |
a609f12a | 3603 | .off1 = offsetof(struct thread_options, exitall_error), |
f9cafb12 JA |
3604 | .help = "Terminate all jobs when one exits in error", |
3605 | .category = FIO_OPT_C_GENERAL, | |
3606 | .group = FIO_OPT_G_PROCESS, | |
3607 | }, | |
214e1eca JA |
3608 | { |
3609 | .name = "stonewall", | |
e8b0e958 | 3610 | .lname = "Wait for previous", |
d392365e | 3611 | .alias = "wait_for_previous", |
214e1eca | 3612 | .type = FIO_OPT_STR_SET, |
a609f12a | 3613 | .off1 = offsetof(struct thread_options, stonewall), |
214e1eca | 3614 | .help = "Insert a hard barrier between this job and previous", |
e8b0e958 | 3615 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 3616 | .group = FIO_OPT_G_PROCESS, |
214e1eca | 3617 | }, |
b3d62a75 JA |
3618 | { |
3619 | .name = "new_group", | |
e8b0e958 | 3620 | .lname = "New group", |
b3d62a75 | 3621 | .type = FIO_OPT_STR_SET, |
a609f12a | 3622 | .off1 = offsetof(struct thread_options, new_group), |
b3d62a75 | 3623 | .help = "Mark the start of a new group (for reporting)", |
e8b0e958 | 3624 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 3625 | .group = FIO_OPT_G_PROCESS, |
b3d62a75 | 3626 | }, |
214e1eca JA |
3627 | { |
3628 | .name = "thread", | |
e8b0e958 | 3629 | .lname = "Thread", |
214e1eca | 3630 | .type = FIO_OPT_STR_SET, |
a609f12a | 3631 | .off1 = offsetof(struct thread_options, use_thread), |
20eb06bd | 3632 | .help = "Use threads instead of processes", |
c8931876 JA |
3633 | #ifdef CONFIG_NO_SHM |
3634 | .def = "1", | |
3635 | .no_warn_def = 1, | |
3636 | #endif | |
e8b0e958 | 3637 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 3638 | .group = FIO_OPT_G_PROCESS, |
214e1eca | 3639 | }, |
3a5db920 JA |
3640 | { |
3641 | .name = "per_job_logs", | |
cce2fdfe | 3642 | .lname = "Per Job Logs", |
3a5db920 | 3643 | .type = FIO_OPT_BOOL, |
a609f12a | 3644 | .off1 = offsetof(struct thread_options, per_job_logs), |
3a5db920 JA |
3645 | .help = "Include job number in generated log files or not", |
3646 | .def = "1", | |
3647 | .category = FIO_OPT_C_LOG, | |
3648 | .group = FIO_OPT_G_INVALID, | |
3649 | }, | |
214e1eca JA |
3650 | { |
3651 | .name = "write_bw_log", | |
e8b0e958 | 3652 | .lname = "Write bandwidth log", |
dded427c | 3653 | .type = FIO_OPT_STR, |
a609f12a | 3654 | .off1 = offsetof(struct thread_options, bw_log_file), |
dded427c | 3655 | .cb = str_write_bw_log_cb, |
214e1eca | 3656 | .help = "Write log of bandwidth during run", |
e8b0e958 JA |
3657 | .category = FIO_OPT_C_LOG, |
3658 | .group = FIO_OPT_G_INVALID, | |
214e1eca JA |
3659 | }, |
3660 | { | |
3661 | .name = "write_lat_log", | |
e8b0e958 | 3662 | .lname = "Write latency log", |
dded427c | 3663 | .type = FIO_OPT_STR, |
a609f12a | 3664 | .off1 = offsetof(struct thread_options, lat_log_file), |
dded427c | 3665 | .cb = str_write_lat_log_cb, |
214e1eca | 3666 | .help = "Write log of latency during run", |
e8b0e958 JA |
3667 | .category = FIO_OPT_C_LOG, |
3668 | .group = FIO_OPT_G_INVALID, | |
214e1eca | 3669 | }, |
c8eeb9df JA |
3670 | { |
3671 | .name = "write_iops_log", | |
e8b0e958 | 3672 | .lname = "Write IOPS log", |
dded427c | 3673 | .type = FIO_OPT_STR, |
a609f12a | 3674 | .off1 = offsetof(struct thread_options, iops_log_file), |
dded427c | 3675 | .cb = str_write_iops_log_cb, |
c8eeb9df | 3676 | .help = "Write log of IOPS during run", |
e8b0e958 JA |
3677 | .category = FIO_OPT_C_LOG, |
3678 | .group = FIO_OPT_G_INVALID, | |
c8eeb9df | 3679 | }, |
b8bc8cba JA |
3680 | { |
3681 | .name = "log_avg_msec", | |
e8b0e958 | 3682 | .lname = "Log averaging (msec)", |
b8bc8cba | 3683 | .type = FIO_OPT_INT, |
a609f12a | 3684 | .off1 = offsetof(struct thread_options, log_avg_msec), |
b8bc8cba JA |
3685 | .help = "Average bw/iops/lat logs over this period of time", |
3686 | .def = "0", | |
e8b0e958 | 3687 | .category = FIO_OPT_C_LOG, |
1e613c9c KC |
3688 | .group = FIO_OPT_G_INVALID, |
3689 | }, | |
3690 | { | |
3691 | .name = "log_hist_msec", | |
3692 | .lname = "Log histograms (msec)", | |
3693 | .type = FIO_OPT_INT, | |
a609f12a | 3694 | .off1 = offsetof(struct thread_options, log_hist_msec), |
1e613c9c KC |
3695 | .help = "Dump completion latency histograms at frequency of this time value", |
3696 | .def = "0", | |
3697 | .category = FIO_OPT_C_LOG, | |
3698 | .group = FIO_OPT_G_INVALID, | |
3699 | }, | |
3700 | { | |
3701 | .name = "log_hist_coarseness", | |
3702 | .lname = "Histogram logs coarseness", | |
3703 | .type = FIO_OPT_INT, | |
a609f12a | 3704 | .off1 = offsetof(struct thread_options, log_hist_coarseness), |
1e613c9c KC |
3705 | .help = "Integer in range [0,6]. Higher coarseness outputs" |
3706 | " fewer histogram bins per sample. The number of bins for" | |
3707 | " these are [1216, 608, 304, 152, 76, 38, 19] respectively.", | |
3708 | .def = "0", | |
3709 | .category = FIO_OPT_C_LOG, | |
3710 | .group = FIO_OPT_G_INVALID, | |
3711 | }, | |
3712 | { | |
3713 | .name = "write_hist_log", | |
3714 | .lname = "Write latency histogram logs", | |
dded427c | 3715 | .type = FIO_OPT_STR, |
a609f12a | 3716 | .off1 = offsetof(struct thread_options, hist_log_file), |
dded427c | 3717 | .cb = str_write_hist_log_cb, |
1e613c9c KC |
3718 | .help = "Write log of latency histograms during run", |
3719 | .category = FIO_OPT_C_LOG, | |
e8b0e958 | 3720 | .group = FIO_OPT_G_INVALID, |
b8bc8cba | 3721 | }, |
e6989e10 JA |
3722 | { |
3723 | .name = "log_max_value", | |
3724 | .lname = "Log maximum instead of average", | |
3725 | .type = FIO_OPT_BOOL, | |
a609f12a | 3726 | .off1 = offsetof(struct thread_options, log_max), |
e6989e10 JA |
3727 | .help = "Log max sample in a window instead of average", |
3728 | .def = "0", | |
3729 | .category = FIO_OPT_C_LOG, | |
3730 | .group = FIO_OPT_G_INVALID, | |
3731 | }, | |
ae588852 JA |
3732 | { |
3733 | .name = "log_offset", | |
3734 | .lname = "Log offset of IO", | |
3735 | .type = FIO_OPT_BOOL, | |
a609f12a | 3736 | .off1 = offsetof(struct thread_options, log_offset), |
ae588852 JA |
3737 | .help = "Include offset of IO for each log entry", |
3738 | .def = "0", | |
3739 | .category = FIO_OPT_C_LOG, | |
3740 | .group = FIO_OPT_G_INVALID, | |
3741 | }, | |
aee2ab67 JA |
3742 | #ifdef CONFIG_ZLIB |
3743 | { | |
3744 | .name = "log_compression", | |
3745 | .lname = "Log compression", | |
3746 | .type = FIO_OPT_INT, | |
a609f12a | 3747 | .off1 = offsetof(struct thread_options, log_gz), |
aee2ab67 | 3748 | .help = "Log in compressed chunks of this size", |
9919b27b | 3749 | .minval = 1024ULL, |
aee2ab67 JA |
3750 | .maxval = 512 * 1024 * 1024ULL, |
3751 | .category = FIO_OPT_C_LOG, | |
3752 | .group = FIO_OPT_G_INVALID, | |
3753 | }, | |
c08f9fe2 JA |
3754 | #ifdef FIO_HAVE_CPU_AFFINITY |
3755 | { | |
3756 | .name = "log_compression_cpus", | |
3757 | .lname = "Log Compression CPUs", | |
3758 | .type = FIO_OPT_STR, | |
3759 | .cb = str_log_cpus_allowed_cb, | |
a609f12a | 3760 | .off1 = offsetof(struct thread_options, log_gz_cpumask), |
c08f9fe2 JA |
3761 | .parent = "log_compression", |
3762 | .help = "Limit log compression to these CPUs", | |
3763 | .category = FIO_OPT_C_LOG, | |
3764 | .group = FIO_OPT_G_INVALID, | |
3765 | }, | |
a275c37a JA |
3766 | #else |
3767 | { | |
3768 | .name = "log_compression_cpus", | |
3769 | .lname = "Log Compression CPUs", | |
3770 | .type = FIO_OPT_UNSUPPORTED, | |
3771 | .help = "Your platform does not support CPU affinities", | |
3772 | }, | |
c08f9fe2 | 3773 | #endif |
b26317c9 JA |
3774 | { |
3775 | .name = "log_store_compressed", | |
3776 | .lname = "Log store compressed", | |
3777 | .type = FIO_OPT_BOOL, | |
a609f12a | 3778 | .off1 = offsetof(struct thread_options, log_gz_store), |
b26317c9 JA |
3779 | .help = "Store logs in a compressed format", |
3780 | .category = FIO_OPT_C_LOG, | |
3781 | .group = FIO_OPT_G_INVALID, | |
3782 | }, | |
a275c37a JA |
3783 | #else |
3784 | { | |
3785 | .name = "log_compression", | |
3786 | .lname = "Log compression", | |
3787 | .type = FIO_OPT_UNSUPPORTED, | |
3788 | .help = "Install libz-dev(el) to get compression support", | |
3789 | }, | |
3790 | { | |
3791 | .name = "log_store_compressed", | |
3792 | .lname = "Log store compressed", | |
3793 | .type = FIO_OPT_UNSUPPORTED, | |
3794 | .help = "Install libz-dev(el) to get compression support", | |
3795 | }, | |
aee2ab67 | 3796 | #endif |
3aea75b1 KC |
3797 | { |
3798 | .name = "log_unix_epoch", | |
3799 | .lname = "Log epoch unix", | |
3800 | .type = FIO_OPT_BOOL, | |
3801 | .off1 = offsetof(struct thread_options, log_unix_epoch), | |
3802 | .help = "Use Unix time in log files", | |
3803 | .category = FIO_OPT_C_LOG, | |
3804 | .group = FIO_OPT_G_INVALID, | |
3805 | }, | |
66347cfa DE |
3806 | { |
3807 | .name = "block_error_percentiles", | |
3808 | .lname = "Block error percentiles", | |
3809 | .type = FIO_OPT_BOOL, | |
a609f12a | 3810 | .off1 = offsetof(struct thread_options, block_error_hist), |
66347cfa DE |
3811 | .help = "Record trim block errors and make a histogram", |
3812 | .def = "0", | |
3813 | .category = FIO_OPT_C_LOG, | |
3814 | .group = FIO_OPT_G_INVALID, | |
3815 | }, | |
c504ee55 JA |
3816 | { |
3817 | .name = "bwavgtime", | |
3818 | .lname = "Bandwidth average time", | |
3819 | .type = FIO_OPT_INT, | |
a609f12a | 3820 | .off1 = offsetof(struct thread_options, bw_avg_time), |
c504ee55 JA |
3821 | .help = "Time window over which to calculate bandwidth" |
3822 | " (msec)", | |
3823 | .def = "500", | |
3824 | .parent = "write_bw_log", | |
3825 | .hide = 1, | |
3826 | .interval = 100, | |
3827 | .category = FIO_OPT_C_LOG, | |
3828 | .group = FIO_OPT_G_INVALID, | |
3829 | }, | |
3830 | { | |
3831 | .name = "iopsavgtime", | |
3832 | .lname = "IOPS average time", | |
3833 | .type = FIO_OPT_INT, | |
a609f12a | 3834 | .off1 = offsetof(struct thread_options, iops_avg_time), |
c504ee55 JA |
3835 | .help = "Time window over which to calculate IOPS (msec)", |
3836 | .def = "500", | |
3837 | .parent = "write_iops_log", | |
3838 | .hide = 1, | |
3839 | .interval = 100, | |
3840 | .category = FIO_OPT_C_LOG, | |
3841 | .group = FIO_OPT_G_INVALID, | |
3842 | }, | |
214e1eca JA |
3843 | { |
3844 | .name = "group_reporting", | |
e8b0e958 | 3845 | .lname = "Group reporting", |
d2507043 | 3846 | .type = FIO_OPT_STR_SET, |
a609f12a | 3847 | .off1 = offsetof(struct thread_options, group_reporting), |
214e1eca | 3848 | .help = "Do reporting on a per-group basis", |
10860056 | 3849 | .category = FIO_OPT_C_STAT, |
e8b0e958 | 3850 | .group = FIO_OPT_G_INVALID, |
214e1eca | 3851 | }, |
e9459e5a JA |
3852 | { |
3853 | .name = "zero_buffers", | |
e8b0e958 | 3854 | .lname = "Zero I/O buffers", |
e9459e5a | 3855 | .type = FIO_OPT_STR_SET, |
a609f12a | 3856 | .off1 = offsetof(struct thread_options, zero_buffers), |
e9459e5a | 3857 | .help = "Init IO buffers to all zeroes", |
e8b0e958 | 3858 | .category = FIO_OPT_C_IO, |
3ceb458f | 3859 | .group = FIO_OPT_G_IO_BUF, |
e9459e5a | 3860 | }, |
5973cafb JA |
3861 | { |
3862 | .name = "refill_buffers", | |
e8b0e958 | 3863 | .lname = "Refill I/O buffers", |
5973cafb | 3864 | .type = FIO_OPT_STR_SET, |
a609f12a | 3865 | .off1 = offsetof(struct thread_options, refill_buffers), |
5973cafb | 3866 | .help = "Refill IO buffers on every IO submit", |
e8b0e958 | 3867 | .category = FIO_OPT_C_IO, |
3ceb458f | 3868 | .group = FIO_OPT_G_IO_BUF, |
5973cafb | 3869 | }, |
fd68418e JA |
3870 | { |
3871 | .name = "scramble_buffers", | |
e8b0e958 | 3872 | .lname = "Scramble I/O buffers", |
fd68418e | 3873 | .type = FIO_OPT_BOOL, |
a609f12a | 3874 | .off1 = offsetof(struct thread_options, scramble_buffers), |
fd68418e JA |
3875 | .help = "Slightly scramble buffers on every IO submit", |
3876 | .def = "1", | |
e8b0e958 | 3877 | .category = FIO_OPT_C_IO, |
3ceb458f | 3878 | .group = FIO_OPT_G_IO_BUF, |
fd68418e | 3879 | }, |
ce35b1ec JA |
3880 | { |
3881 | .name = "buffer_pattern", | |
3882 | .lname = "Buffer pattern", | |
3883 | .type = FIO_OPT_STR, | |
3884 | .cb = str_buffer_pattern_cb, | |
a609f12a | 3885 | .off1 = offsetof(struct thread_options, buffer_pattern), |
ce35b1ec JA |
3886 | .help = "Fill pattern for IO buffers", |
3887 | .category = FIO_OPT_C_IO, | |
3888 | .group = FIO_OPT_G_IO_BUF, | |
3889 | }, | |
9c42684e JA |
3890 | { |
3891 | .name = "buffer_compress_percentage", | |
e8b0e958 | 3892 | .lname = "Buffer compression percentage", |
9c42684e | 3893 | .type = FIO_OPT_INT, |
bedc9dc2 | 3894 | .cb = str_buffer_compress_cb, |
a609f12a | 3895 | .off1 = offsetof(struct thread_options, compress_percentage), |
9c42684e | 3896 | .maxval = 100, |
e7f5de90 | 3897 | .minval = 0, |
9c42684e | 3898 | .help = "How compressible the buffer is (approximately)", |
20eb06bd | 3899 | .interval = 5, |
e8b0e958 | 3900 | .category = FIO_OPT_C_IO, |
3ceb458f | 3901 | .group = FIO_OPT_G_IO_BUF, |
9c42684e | 3902 | }, |
f97a43a1 JA |
3903 | { |
3904 | .name = "buffer_compress_chunk", | |
e8b0e958 | 3905 | .lname = "Buffer compression chunk size", |
f97a43a1 | 3906 | .type = FIO_OPT_INT, |
a609f12a | 3907 | .off1 = offsetof(struct thread_options, compress_chunk), |
207b18e4 | 3908 | .parent = "buffer_compress_percentage", |
d71c154c | 3909 | .hide = 1, |
f97a43a1 | 3910 | .help = "Size of compressible region in buffer", |
20eb06bd | 3911 | .interval = 256, |
e8b0e958 | 3912 | .category = FIO_OPT_C_IO, |
3ceb458f | 3913 | .group = FIO_OPT_G_IO_BUF, |
f97a43a1 | 3914 | }, |
5c94b008 JA |
3915 | { |
3916 | .name = "dedupe_percentage", | |
3917 | .lname = "Dedupe percentage", | |
3918 | .type = FIO_OPT_INT, | |
3919 | .cb = str_dedupe_cb, | |
a609f12a | 3920 | .off1 = offsetof(struct thread_options, dedupe_percentage), |
5c94b008 JA |
3921 | .maxval = 100, |
3922 | .minval = 0, | |
3923 | .help = "Percentage of buffers that are dedupable", | |
3924 | .interval = 1, | |
3925 | .category = FIO_OPT_C_IO, | |
3926 | .group = FIO_OPT_G_IO_BUF, | |
3927 | }, | |
83349190 YH |
3928 | { |
3929 | .name = "clat_percentiles", | |
e8b0e958 | 3930 | .lname = "Completion latency percentiles", |
83349190 | 3931 | .type = FIO_OPT_BOOL, |
a609f12a | 3932 | .off1 = offsetof(struct thread_options, clat_percentiles), |
83349190 | 3933 | .help = "Enable the reporting of completion latency percentiles", |
467b35ed | 3934 | .def = "1", |
e8b0e958 JA |
3935 | .category = FIO_OPT_C_STAT, |
3936 | .group = FIO_OPT_G_INVALID, | |
83349190 YH |
3937 | }, |
3938 | { | |
3939 | .name = "percentile_list", | |
66347cfa | 3940 | .lname = "Percentile list", |
83349190 | 3941 | .type = FIO_OPT_FLOAT_LIST, |
a609f12a JA |
3942 | .off1 = offsetof(struct thread_options, percentile_list), |
3943 | .off2 = offsetof(struct thread_options, percentile_precision), | |
66347cfa DE |
3944 | .help = "Specify a custom list of percentiles to report for " |
3945 | "completion latency and block errors", | |
fd112d34 | 3946 | .def = "1:5:10:20:30:40:50:60:70:80:90:95:99:99.5:99.9:99.95:99.99", |
83349190 YH |
3947 | .maxlen = FIO_IO_U_LIST_MAX_LEN, |
3948 | .minfp = 0.0, | |
3949 | .maxfp = 100.0, | |
e8b0e958 JA |
3950 | .category = FIO_OPT_C_STAT, |
3951 | .group = FIO_OPT_G_INVALID, | |
83349190 YH |
3952 | }, |
3953 | ||
0a839f30 JA |
3954 | #ifdef FIO_HAVE_DISK_UTIL |
3955 | { | |
3956 | .name = "disk_util", | |
e8b0e958 | 3957 | .lname = "Disk utilization", |
0a839f30 | 3958 | .type = FIO_OPT_BOOL, |
a609f12a | 3959 | .off1 = offsetof(struct thread_options, do_disk_util), |
f66ab3c8 | 3960 | .help = "Log disk utilization statistics", |
0a839f30 | 3961 | .def = "1", |
e8b0e958 JA |
3962 | .category = FIO_OPT_C_STAT, |
3963 | .group = FIO_OPT_G_INVALID, | |
0a839f30 | 3964 | }, |
a275c37a JA |
3965 | #else |
3966 | { | |
3967 | .name = "disk_util", | |
3968 | .lname = "Disk utilization", | |
3969 | .type = FIO_OPT_UNSUPPORTED, | |
3970 | .help = "Your platform does not support disk utilization", | |
3971 | }, | |
0a839f30 | 3972 | #endif |
993bf48b JA |
3973 | { |
3974 | .name = "gtod_reduce", | |
e8b0e958 | 3975 | .lname = "Reduce gettimeofday() calls", |
993bf48b JA |
3976 | .type = FIO_OPT_BOOL, |
3977 | .help = "Greatly reduce number of gettimeofday() calls", | |
3978 | .cb = str_gtod_reduce_cb, | |
3979 | .def = "0", | |
a4ed77fe | 3980 | .hide_on_set = 1, |
e8b0e958 JA |
3981 | .category = FIO_OPT_C_STAT, |
3982 | .group = FIO_OPT_G_INVALID, | |
993bf48b | 3983 | }, |
02af0988 JA |
3984 | { |
3985 | .name = "disable_lat", | |
e8b0e958 | 3986 | .lname = "Disable all latency stats", |
02af0988 | 3987 | .type = FIO_OPT_BOOL, |
a609f12a | 3988 | .off1 = offsetof(struct thread_options, disable_lat), |
02af0988 JA |
3989 | .help = "Disable latency numbers", |
3990 | .parent = "gtod_reduce", | |
d71c154c | 3991 | .hide = 1, |
02af0988 | 3992 | .def = "0", |
e8b0e958 JA |
3993 | .category = FIO_OPT_C_STAT, |
3994 | .group = FIO_OPT_G_INVALID, | |
02af0988 | 3995 | }, |
9520ebb9 JA |
3996 | { |
3997 | .name = "disable_clat", | |
e8b0e958 | 3998 | .lname = "Disable completion latency stats", |
9520ebb9 | 3999 | .type = FIO_OPT_BOOL, |
a609f12a | 4000 | .off1 = offsetof(struct thread_options, disable_clat), |
9520ebb9 | 4001 | .help = "Disable completion latency numbers", |
993bf48b | 4002 | .parent = "gtod_reduce", |
d71c154c | 4003 | .hide = 1, |
9520ebb9 | 4004 | .def = "0", |
e8b0e958 JA |
4005 | .category = FIO_OPT_C_STAT, |
4006 | .group = FIO_OPT_G_INVALID, | |
9520ebb9 JA |
4007 | }, |
4008 | { | |
4009 | .name = "disable_slat", | |
e8b0e958 | 4010 | .lname = "Disable submission latency stats", |
9520ebb9 | 4011 | .type = FIO_OPT_BOOL, |
a609f12a | 4012 | .off1 = offsetof(struct thread_options, disable_slat), |
03e20d68 | 4013 | .help = "Disable submission latency numbers", |
993bf48b | 4014 | .parent = "gtod_reduce", |
d71c154c | 4015 | .hide = 1, |
9520ebb9 | 4016 | .def = "0", |
e8b0e958 JA |
4017 | .category = FIO_OPT_C_STAT, |
4018 | .group = FIO_OPT_G_INVALID, | |
9520ebb9 JA |
4019 | }, |
4020 | { | |
4021 | .name = "disable_bw_measurement", | |
afd2ceff | 4022 | .alias = "disable_bw", |
e8b0e958 | 4023 | .lname = "Disable bandwidth stats", |
9520ebb9 | 4024 | .type = FIO_OPT_BOOL, |
a609f12a | 4025 | .off1 = offsetof(struct thread_options, disable_bw), |
9520ebb9 | 4026 | .help = "Disable bandwidth logging", |
993bf48b | 4027 | .parent = "gtod_reduce", |
d71c154c | 4028 | .hide = 1, |
9520ebb9 | 4029 | .def = "0", |
e8b0e958 JA |
4030 | .category = FIO_OPT_C_STAT, |
4031 | .group = FIO_OPT_G_INVALID, | |
9520ebb9 | 4032 | }, |
be4ecfdf JA |
4033 | { |
4034 | .name = "gtod_cpu", | |
e8b0e958 | 4035 | .lname = "Dedicated gettimeofday() CPU", |
be4ecfdf | 4036 | .type = FIO_OPT_INT, |
a609f12a | 4037 | .off1 = offsetof(struct thread_options, gtod_cpu), |
03e20d68 | 4038 | .help = "Set up dedicated gettimeofday() thread on this CPU", |
29d43ff9 | 4039 | .verify = gtod_cpu_verify, |
e8b0e958 | 4040 | .category = FIO_OPT_C_GENERAL, |
10860056 | 4041 | .group = FIO_OPT_G_CLOCK, |
be4ecfdf | 4042 | }, |
771e58be JA |
4043 | { |
4044 | .name = "unified_rw_reporting", | |
cce2fdfe | 4045 | .lname = "Unified RW Reporting", |
771e58be | 4046 | .type = FIO_OPT_BOOL, |
a609f12a | 4047 | .off1 = offsetof(struct thread_options, unified_rw_rep), |
771e58be JA |
4048 | .help = "Unify reporting across data direction", |
4049 | .def = "0", | |
90b7a96d JA |
4050 | .category = FIO_OPT_C_GENERAL, |
4051 | .group = FIO_OPT_G_INVALID, | |
771e58be | 4052 | }, |
f2bba182 RR |
4053 | { |
4054 | .name = "continue_on_error", | |
e8b0e958 | 4055 | .lname = "Continue on error", |
06842027 | 4056 | .type = FIO_OPT_STR, |
a609f12a | 4057 | .off1 = offsetof(struct thread_options, continue_on_error), |
03e20d68 | 4058 | .help = "Continue on non-fatal errors during IO", |
06842027 | 4059 | .def = "none", |
e8b0e958 | 4060 | .category = FIO_OPT_C_GENERAL, |
bc3f552f | 4061 | .group = FIO_OPT_G_ERR, |
06842027 SL |
4062 | .posval = { |
4063 | { .ival = "none", | |
4064 | .oval = ERROR_TYPE_NONE, | |
4065 | .help = "Exit when an error is encountered", | |
4066 | }, | |
4067 | { .ival = "read", | |
4068 | .oval = ERROR_TYPE_READ, | |
4069 | .help = "Continue on read errors only", | |
4070 | }, | |
4071 | { .ival = "write", | |
4072 | .oval = ERROR_TYPE_WRITE, | |
4073 | .help = "Continue on write errors only", | |
4074 | }, | |
4075 | { .ival = "io", | |
4076 | .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE, | |
4077 | .help = "Continue on any IO errors", | |
4078 | }, | |
4079 | { .ival = "verify", | |
4080 | .oval = ERROR_TYPE_VERIFY, | |
4081 | .help = "Continue on verify errors only", | |
4082 | }, | |
4083 | { .ival = "all", | |
4084 | .oval = ERROR_TYPE_ANY, | |
4085 | .help = "Continue on all io and verify errors", | |
4086 | }, | |
4087 | { .ival = "0", | |
4088 | .oval = ERROR_TYPE_NONE, | |
4089 | .help = "Alias for 'none'", | |
4090 | }, | |
4091 | { .ival = "1", | |
4092 | .oval = ERROR_TYPE_ANY, | |
4093 | .help = "Alias for 'all'", | |
4094 | }, | |
4095 | }, | |
f2bba182 | 4096 | }, |
8b28bd41 DM |
4097 | { |
4098 | .name = "ignore_error", | |
cce2fdfe | 4099 | .lname = "Ignore Error", |
8b28bd41 DM |
4100 | .type = FIO_OPT_STR, |
4101 | .cb = str_ignore_error_cb, | |
a609f12a | 4102 | .off1 = offsetof(struct thread_options, ignore_error_nr), |
8b28bd41 DM |
4103 | .help = "Set a specific list of errors to ignore", |
4104 | .parent = "rw", | |
a94eb99a | 4105 | .category = FIO_OPT_C_GENERAL, |
bc3f552f | 4106 | .group = FIO_OPT_G_ERR, |
8b28bd41 DM |
4107 | }, |
4108 | { | |
4109 | .name = "error_dump", | |
cce2fdfe | 4110 | .lname = "Error Dump", |
8b28bd41 | 4111 | .type = FIO_OPT_BOOL, |
a609f12a | 4112 | .off1 = offsetof(struct thread_options, error_dump), |
8b28bd41 DM |
4113 | .def = "0", |
4114 | .help = "Dump info on each error", | |
a94eb99a | 4115 | .category = FIO_OPT_C_GENERAL, |
bc3f552f | 4116 | .group = FIO_OPT_G_ERR, |
8b28bd41 | 4117 | }, |
9ac8a797 JA |
4118 | { |
4119 | .name = "profile", | |
e8b0e958 | 4120 | .lname = "Profile", |
79d16311 | 4121 | .type = FIO_OPT_STR_STORE, |
a609f12a | 4122 | .off1 = offsetof(struct thread_options, profile), |
9ac8a797 | 4123 | .help = "Select a specific builtin performance test", |
13fca827 | 4124 | .category = FIO_OPT_C_PROFILE, |
e8b0e958 | 4125 | .group = FIO_OPT_G_INVALID, |
9ac8a797 | 4126 | }, |
a696fa2a JA |
4127 | { |
4128 | .name = "cgroup", | |
e8b0e958 | 4129 | .lname = "Cgroup", |
a696fa2a | 4130 | .type = FIO_OPT_STR_STORE, |
a609f12a | 4131 | .off1 = offsetof(struct thread_options, cgroup), |
a696fa2a | 4132 | .help = "Add job to cgroup of this name", |
e8b0e958 | 4133 | .category = FIO_OPT_C_GENERAL, |
a1f6afec JA |
4134 | .group = FIO_OPT_G_CGROUP, |
4135 | }, | |
4136 | { | |
4137 | .name = "cgroup_nodelete", | |
4138 | .lname = "Cgroup no-delete", | |
4139 | .type = FIO_OPT_BOOL, | |
a609f12a | 4140 | .off1 = offsetof(struct thread_options, cgroup_nodelete), |
a1f6afec JA |
4141 | .help = "Do not delete cgroups after job completion", |
4142 | .def = "0", | |
4143 | .parent = "cgroup", | |
4144 | .category = FIO_OPT_C_GENERAL, | |
4145 | .group = FIO_OPT_G_CGROUP, | |
a696fa2a JA |
4146 | }, |
4147 | { | |
4148 | .name = "cgroup_weight", | |
e8b0e958 | 4149 | .lname = "Cgroup weight", |
a696fa2a | 4150 | .type = FIO_OPT_INT, |
a609f12a | 4151 | .off1 = offsetof(struct thread_options, cgroup_weight), |
a696fa2a JA |
4152 | .help = "Use given weight for cgroup", |
4153 | .minval = 100, | |
4154 | .maxval = 1000, | |
a1f6afec | 4155 | .parent = "cgroup", |
e8b0e958 | 4156 | .category = FIO_OPT_C_GENERAL, |
a1f6afec | 4157 | .group = FIO_OPT_G_CGROUP, |
7de87099 | 4158 | }, |
e0b0d892 JA |
4159 | { |
4160 | .name = "uid", | |
e8b0e958 | 4161 | .lname = "User ID", |
e0b0d892 | 4162 | .type = FIO_OPT_INT, |
a609f12a | 4163 | .off1 = offsetof(struct thread_options, uid), |
e0b0d892 | 4164 | .help = "Run job with this user ID", |
e8b0e958 | 4165 | .category = FIO_OPT_C_GENERAL, |
10860056 | 4166 | .group = FIO_OPT_G_CRED, |
e0b0d892 JA |
4167 | }, |
4168 | { | |
4169 | .name = "gid", | |
e8b0e958 | 4170 | .lname = "Group ID", |
e0b0d892 | 4171 | .type = FIO_OPT_INT, |
a609f12a | 4172 | .off1 = offsetof(struct thread_options, gid), |
e0b0d892 | 4173 | .help = "Run job with this group ID", |
e8b0e958 | 4174 | .category = FIO_OPT_C_GENERAL, |
10860056 | 4175 | .group = FIO_OPT_G_CRED, |
e0b0d892 | 4176 | }, |
a1f6afec JA |
4177 | { |
4178 | .name = "kb_base", | |
4179 | .lname = "KB Base", | |
4180 | .type = FIO_OPT_INT, | |
a609f12a | 4181 | .off1 = offsetof(struct thread_options, kb_base), |
a1f6afec JA |
4182 | .prio = 1, |
4183 | .def = "1024", | |
ba9c7219 JA |
4184 | .posval = { |
4185 | { .ival = "1024", | |
4186 | .oval = 1024, | |
d694a6a7 | 4187 | .help = "Inputs invert IEC and SI prefixes (for compatibility); outputs prefer binary", |
ba9c7219 JA |
4188 | }, |
4189 | { .ival = "1000", | |
4190 | .oval = 1000, | |
d694a6a7 | 4191 | .help = "Inputs use IEC and SI prefixes; outputs prefer SI", |
ba9c7219 JA |
4192 | }, |
4193 | }, | |
d694a6a7 | 4194 | .help = "Unit prefix interpretation for quantities of data (IEC and SI)", |
a1f6afec JA |
4195 | .category = FIO_OPT_C_GENERAL, |
4196 | .group = FIO_OPT_G_INVALID, | |
4197 | }, | |
cf3a0518 JA |
4198 | { |
4199 | .name = "unit_base", | |
d694a6a7 | 4200 | .lname = "Unit for quantities of data (Bits or Bytes)", |
cf3a0518 | 4201 | .type = FIO_OPT_INT, |
a609f12a | 4202 | .off1 = offsetof(struct thread_options, unit_base), |
cf3a0518 | 4203 | .prio = 1, |
71a08258 JA |
4204 | .posval = { |
4205 | { .ival = "0", | |
4206 | .oval = 0, | |
4207 | .help = "Auto-detect", | |
4208 | }, | |
4209 | { .ival = "8", | |
4210 | .oval = 8, | |
4211 | .help = "Normal (byte based)", | |
4212 | }, | |
4213 | { .ival = "1", | |
4214 | .oval = 1, | |
4215 | .help = "Bit based", | |
4216 | }, | |
4217 | }, | |
cf3a0518 JA |
4218 | .help = "Bit multiple of result summary data (8 for byte, 1 for bit)", |
4219 | .category = FIO_OPT_C_GENERAL, | |
4220 | .group = FIO_OPT_G_INVALID, | |
4221 | }, | |
3ceb458f JA |
4222 | { |
4223 | .name = "hugepage-size", | |
4224 | .lname = "Hugepage size", | |
4225 | .type = FIO_OPT_INT, | |
a609f12a | 4226 | .off1 = offsetof(struct thread_options, hugepage_size), |
3ceb458f JA |
4227 | .help = "When using hugepages, specify size of each page", |
4228 | .def = __fio_stringify(FIO_HUGE_PAGE), | |
4229 | .interval = 1024 * 1024, | |
4230 | .category = FIO_OPT_C_GENERAL, | |
4231 | .group = FIO_OPT_G_INVALID, | |
4232 | }, | |
9e684a49 DE |
4233 | { |
4234 | .name = "flow_id", | |
e8b0e958 | 4235 | .lname = "I/O flow ID", |
9e684a49 | 4236 | .type = FIO_OPT_INT, |
a609f12a | 4237 | .off1 = offsetof(struct thread_options, flow_id), |
9e684a49 DE |
4238 | .help = "The flow index ID to use", |
4239 | .def = "0", | |
e8b0e958 JA |
4240 | .category = FIO_OPT_C_IO, |
4241 | .group = FIO_OPT_G_IO_FLOW, | |
9e684a49 DE |
4242 | }, |
4243 | { | |
4244 | .name = "flow", | |
e8b0e958 | 4245 | .lname = "I/O flow weight", |
9e684a49 | 4246 | .type = FIO_OPT_INT, |
a609f12a | 4247 | .off1 = offsetof(struct thread_options, flow), |
9e684a49 DE |
4248 | .help = "Weight for flow control of this job", |
4249 | .parent = "flow_id", | |
d71c154c | 4250 | .hide = 1, |
9e684a49 | 4251 | .def = "0", |
e8b0e958 JA |
4252 | .category = FIO_OPT_C_IO, |
4253 | .group = FIO_OPT_G_IO_FLOW, | |
9e684a49 DE |
4254 | }, |
4255 | { | |
4256 | .name = "flow_watermark", | |
e8b0e958 | 4257 | .lname = "I/O flow watermark", |
9e684a49 | 4258 | .type = FIO_OPT_INT, |
a609f12a | 4259 | .off1 = offsetof(struct thread_options, flow_watermark), |
9e684a49 DE |
4260 | .help = "High watermark for flow control. This option" |
4261 | " should be set to the same value for all threads" | |
4262 | " with non-zero flow.", | |
4263 | .parent = "flow_id", | |
d71c154c | 4264 | .hide = 1, |
9e684a49 | 4265 | .def = "1024", |
e8b0e958 JA |
4266 | .category = FIO_OPT_C_IO, |
4267 | .group = FIO_OPT_G_IO_FLOW, | |
9e684a49 DE |
4268 | }, |
4269 | { | |
4270 | .name = "flow_sleep", | |
e8b0e958 | 4271 | .lname = "I/O flow sleep", |
9e684a49 | 4272 | .type = FIO_OPT_INT, |
a609f12a | 4273 | .off1 = offsetof(struct thread_options, flow_sleep), |
9e684a49 DE |
4274 | .help = "How many microseconds to sleep after being held" |
4275 | " back by the flow control mechanism", | |
4276 | .parent = "flow_id", | |
d71c154c | 4277 | .hide = 1, |
9e684a49 | 4278 | .def = "0", |
e8b0e958 JA |
4279 | .category = FIO_OPT_C_IO, |
4280 | .group = FIO_OPT_G_IO_FLOW, | |
9e684a49 | 4281 | }, |
65fa28ca DE |
4282 | { |
4283 | .name = "skip_bad", | |
4284 | .lname = "Skip operations against bad blocks", | |
4285 | .type = FIO_OPT_BOOL, | |
a609f12a | 4286 | .off1 = offsetof(struct thread_options, skip_bad), |
65fa28ca DE |
4287 | .help = "Skip operations against known bad blocks.", |
4288 | .hide = 1, | |
4289 | .def = "0", | |
4290 | .category = FIO_OPT_C_IO, | |
4291 | .group = FIO_OPT_G_MTD, | |
4292 | }, | |
16e56d25 VF |
4293 | { |
4294 | .name = "steadystate", | |
4295 | .lname = "Steady state threshold", | |
4296 | .alias = "ss", | |
4297 | .type = FIO_OPT_STR, | |
2c5d94bc | 4298 | .off1 = offsetof(struct thread_options, ss_state), |
16e56d25 VF |
4299 | .cb = str_steadystate_cb, |
4300 | .help = "Define the criterion and limit to judge when a job has reached steady state", | |
4301 | .def = "iops_slope:0.01%", | |
4302 | .posval = { | |
4303 | { .ival = "iops", | |
f0c50c66 | 4304 | .oval = FIO_SS_IOPS, |
16e56d25 VF |
4305 | .help = "maximum mean deviation of IOPS measurements", |
4306 | }, | |
4307 | { .ival = "iops_slope", | |
f0c50c66 | 4308 | .oval = FIO_SS_IOPS_SLOPE, |
16e56d25 VF |
4309 | .help = "slope calculated from IOPS measurements", |
4310 | }, | |
4311 | { .ival = "bw", | |
f0c50c66 | 4312 | .oval = FIO_SS_BW, |
16e56d25 VF |
4313 | .help = "maximum mean deviation of bandwidth measurements", |
4314 | }, | |
4315 | { | |
4316 | .ival = "bw_slope", | |
f0c50c66 | 4317 | .oval = FIO_SS_BW_SLOPE, |
16e56d25 VF |
4318 | .help = "slope calculated from bandwidth measurements", |
4319 | }, | |
4320 | }, | |
4321 | .category = FIO_OPT_C_GENERAL, | |
4322 | .group = FIO_OPT_G_RUNTIME, | |
4323 | }, | |
4324 | { | |
4325 | .name = "steadystate_duration", | |
4326 | .lname = "Steady state duration", | |
4327 | .alias = "ss_dur", | |
915ca980 | 4328 | .parent = "steadystate", |
16e56d25 VF |
4329 | .type = FIO_OPT_STR_VAL_TIME, |
4330 | .off1 = offsetof(struct thread_options, ss_dur), | |
4331 | .help = "Stop workload upon attaining steady state for specified duration", | |
4332 | .def = "0", | |
4333 | .is_seconds = 1, | |
4334 | .is_time = 1, | |
4335 | .category = FIO_OPT_C_GENERAL, | |
4336 | .group = FIO_OPT_G_RUNTIME, | |
4337 | }, | |
4338 | { | |
4339 | .name = "steadystate_ramp_time", | |
4340 | .lname = "Steady state ramp time", | |
4341 | .alias = "ss_ramp", | |
915ca980 | 4342 | .parent = "steadystate", |
16e56d25 VF |
4343 | .type = FIO_OPT_STR_VAL_TIME, |
4344 | .off1 = offsetof(struct thread_options, ss_ramp_time), | |
4345 | .help = "Delay before initiation of data collection for steady state job termination testing", | |
4346 | .def = "0", | |
4347 | .is_seconds = 1, | |
4348 | .is_time = 1, | |
4349 | .category = FIO_OPT_C_GENERAL, | |
4350 | .group = FIO_OPT_G_RUNTIME, | |
4351 | }, | |
214e1eca JA |
4352 | { |
4353 | .name = NULL, | |
4354 | }, | |
4355 | }; | |
4356 | ||
17af15d4 | 4357 | static void add_to_lopt(struct option *lopt, struct fio_option *o, |
de890a1e | 4358 | const char *name, int val) |
9f81736c | 4359 | { |
17af15d4 | 4360 | lopt->name = (char *) name; |
de890a1e | 4361 | lopt->val = val; |
9f81736c | 4362 | if (o->type == FIO_OPT_STR_SET) |
ff52be3d | 4363 | lopt->has_arg = optional_argument; |
9f81736c JA |
4364 | else |
4365 | lopt->has_arg = required_argument; | |
4366 | } | |
4367 | ||
de890a1e SL |
4368 | static void options_to_lopts(struct fio_option *opts, |
4369 | struct option *long_options, | |
4370 | int i, int option_type) | |
214e1eca | 4371 | { |
de890a1e | 4372 | struct fio_option *o = &opts[0]; |
214e1eca | 4373 | while (o->name) { |
de890a1e | 4374 | add_to_lopt(&long_options[i], o, o->name, option_type); |
17af15d4 JA |
4375 | if (o->alias) { |
4376 | i++; | |
de890a1e | 4377 | add_to_lopt(&long_options[i], o, o->alias, option_type); |
17af15d4 | 4378 | } |
214e1eca JA |
4379 | |
4380 | i++; | |
4381 | o++; | |
4382 | assert(i < FIO_NR_OPTIONS); | |
4383 | } | |
4384 | } | |
4385 | ||
de890a1e SL |
4386 | void fio_options_set_ioengine_opts(struct option *long_options, |
4387 | struct thread_data *td) | |
4388 | { | |
4389 | unsigned int i; | |
4390 | ||
4391 | i = 0; | |
4392 | while (long_options[i].name) { | |
4393 | if (long_options[i].val == FIO_GETOPT_IOENGINE) { | |
4394 | memset(&long_options[i], 0, sizeof(*long_options)); | |
4395 | break; | |
4396 | } | |
4397 | i++; | |
4398 | } | |
4399 | ||
4400 | /* | |
4401 | * Just clear out the prior ioengine options. | |
4402 | */ | |
4403 | if (!td || !td->eo) | |
4404 | return; | |
4405 | ||
4406 | options_to_lopts(td->io_ops->options, long_options, i, | |
4407 | FIO_GETOPT_IOENGINE); | |
4408 | } | |
4409 | ||
4410 | void fio_options_dup_and_init(struct option *long_options) | |
4411 | { | |
4412 | unsigned int i; | |
4413 | ||
9af4a244 | 4414 | options_init(fio_options); |
de890a1e SL |
4415 | |
4416 | i = 0; | |
4417 | while (long_options[i].name) | |
4418 | i++; | |
4419 | ||
9af4a244 | 4420 | options_to_lopts(fio_options, long_options, i, FIO_GETOPT_JOB); |
de890a1e SL |
4421 | } |
4422 | ||
74929ac2 JA |
4423 | struct fio_keyword { |
4424 | const char *word; | |
4425 | const char *desc; | |
4426 | char *replace; | |
4427 | }; | |
4428 | ||
4429 | static struct fio_keyword fio_keywords[] = { | |
4430 | { | |
4431 | .word = "$pagesize", | |
4432 | .desc = "Page size in the system", | |
4433 | }, | |
4434 | { | |
4435 | .word = "$mb_memory", | |
4436 | .desc = "Megabytes of memory online", | |
4437 | }, | |
4438 | { | |
4439 | .word = "$ncpus", | |
4440 | .desc = "Number of CPUs online in the system", | |
4441 | }, | |
4442 | { | |
4443 | .word = NULL, | |
4444 | }, | |
4445 | }; | |
4446 | ||
af1dc266 JA |
4447 | void fio_keywords_exit(void) |
4448 | { | |
4449 | struct fio_keyword *kw; | |
4450 | ||
4451 | kw = &fio_keywords[0]; | |
4452 | while (kw->word) { | |
4453 | free(kw->replace); | |
4454 | kw->replace = NULL; | |
4455 | kw++; | |
4456 | } | |
4457 | } | |
4458 | ||
74929ac2 JA |
4459 | void fio_keywords_init(void) |
4460 | { | |
3b2e1464 | 4461 | unsigned long long mb_memory; |
74929ac2 JA |
4462 | char buf[128]; |
4463 | long l; | |
4464 | ||
a4cfc477 | 4465 | sprintf(buf, "%lu", (unsigned long) page_size); |
74929ac2 JA |
4466 | fio_keywords[0].replace = strdup(buf); |
4467 | ||
8eb016d3 | 4468 | mb_memory = os_phys_mem() / (1024 * 1024); |
3b2e1464 | 4469 | sprintf(buf, "%llu", mb_memory); |
74929ac2 JA |
4470 | fio_keywords[1].replace = strdup(buf); |
4471 | ||
c00a2289 | 4472 | l = cpus_online(); |
74929ac2 JA |
4473 | sprintf(buf, "%lu", l); |
4474 | fio_keywords[2].replace = strdup(buf); | |
4475 | } | |
4476 | ||
892a6ffc JA |
4477 | #define BC_APP "bc" |
4478 | ||
4479 | static char *bc_calc(char *str) | |
4480 | { | |
d0c814ec | 4481 | char buf[128], *tmp; |
892a6ffc JA |
4482 | FILE *f; |
4483 | int ret; | |
4484 | ||
4485 | /* | |
4486 | * No math, just return string | |
4487 | */ | |
d0c814ec SL |
4488 | if ((!strchr(str, '+') && !strchr(str, '-') && !strchr(str, '*') && |
4489 | !strchr(str, '/')) || strchr(str, '\'')) | |
892a6ffc JA |
4490 | return str; |
4491 | ||
4492 | /* | |
4493 | * Split option from value, we only need to calculate the value | |
4494 | */ | |
4495 | tmp = strchr(str, '='); | |
4496 | if (!tmp) | |
4497 | return str; | |
4498 | ||
4499 | tmp++; | |
892a6ffc | 4500 | |
d0c814ec SL |
4501 | /* |
4502 | * Prevent buffer overflows; such a case isn't reasonable anyway | |
4503 | */ | |
4504 | if (strlen(str) >= 128 || strlen(tmp) > 100) | |
4505 | return str; | |
892a6ffc JA |
4506 | |
4507 | sprintf(buf, "which %s > /dev/null", BC_APP); | |
4508 | if (system(buf)) { | |
4509 | log_err("fio: bc is needed for performing math\n"); | |
892a6ffc JA |
4510 | return NULL; |
4511 | } | |
4512 | ||
d0c814ec | 4513 | sprintf(buf, "echo '%s' | %s", tmp, BC_APP); |
892a6ffc | 4514 | f = popen(buf, "r"); |
3c3ed070 | 4515 | if (!f) |
892a6ffc | 4516 | return NULL; |
892a6ffc | 4517 | |
d0c814ec | 4518 | ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f); |
1d824f37 JA |
4519 | if (ret <= 0) { |
4520 | pclose(f); | |
892a6ffc | 4521 | return NULL; |
1d824f37 | 4522 | } |
892a6ffc | 4523 | |
892a6ffc | 4524 | pclose(f); |
d0c814ec SL |
4525 | buf[(tmp - str) + ret - 1] = '\0'; |
4526 | memcpy(buf, str, tmp - str); | |
892a6ffc | 4527 | free(str); |
d0c814ec SL |
4528 | return strdup(buf); |
4529 | } | |
4530 | ||
4531 | /* | |
4532 | * Return a copy of the input string with substrings of the form ${VARNAME} | |
4533 | * substituted with the value of the environment variable VARNAME. The | |
4534 | * substitution always occurs, even if VARNAME is empty or the corresponding | |
4535 | * environment variable undefined. | |
4536 | */ | |
4537 | static char *option_dup_subs(const char *opt) | |
4538 | { | |
4539 | char out[OPT_LEN_MAX+1]; | |
4540 | char in[OPT_LEN_MAX+1]; | |
4541 | char *outptr = out; | |
4542 | char *inptr = in; | |
4543 | char *ch1, *ch2, *env; | |
4544 | ssize_t nchr = OPT_LEN_MAX; | |
4545 | size_t envlen; | |
4546 | ||
4547 | if (strlen(opt) + 1 > OPT_LEN_MAX) { | |
4548 | log_err("OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX); | |
4549 | return NULL; | |
4550 | } | |
4551 | ||
4552 | in[OPT_LEN_MAX] = '\0'; | |
4553 | strncpy(in, opt, OPT_LEN_MAX); | |
4554 | ||
4555 | while (*inptr && nchr > 0) { | |
4556 | if (inptr[0] == '$' && inptr[1] == '{') { | |
4557 | ch2 = strchr(inptr, '}'); | |
4558 | if (ch2 && inptr+1 < ch2) { | |
4559 | ch1 = inptr+2; | |
4560 | inptr = ch2+1; | |
4561 | *ch2 = '\0'; | |
4562 | ||
4563 | env = getenv(ch1); | |
4564 | if (env) { | |
4565 | envlen = strlen(env); | |
4566 | if (envlen <= nchr) { | |
4567 | memcpy(outptr, env, envlen); | |
4568 | outptr += envlen; | |
4569 | nchr -= envlen; | |
4570 | } | |
4571 | } | |
4572 | ||
4573 | continue; | |
4574 | } | |
4575 | } | |
4576 | ||
4577 | *outptr++ = *inptr++; | |
4578 | --nchr; | |
4579 | } | |
4580 | ||
4581 | *outptr = '\0'; | |
4582 | return strdup(out); | |
892a6ffc JA |
4583 | } |
4584 | ||
74929ac2 JA |
4585 | /* |
4586 | * Look for reserved variable names and replace them with real values | |
4587 | */ | |
4588 | static char *fio_keyword_replace(char *opt) | |
4589 | { | |
4590 | char *s; | |
4591 | int i; | |
d0c814ec | 4592 | int docalc = 0; |
74929ac2 JA |
4593 | |
4594 | for (i = 0; fio_keywords[i].word != NULL; i++) { | |
4595 | struct fio_keyword *kw = &fio_keywords[i]; | |
4596 | ||
4597 | while ((s = strstr(opt, kw->word)) != NULL) { | |
4598 | char *new = malloc(strlen(opt) + 1); | |
4599 | char *o_org = opt; | |
4600 | int olen = s - opt; | |
4601 | int len; | |
4602 | ||
4603 | /* | |
4604 | * Copy part of the string before the keyword and | |
4605 | * sprintf() the replacement after it. | |
4606 | */ | |
4607 | memcpy(new, opt, olen); | |
4608 | len = sprintf(new + olen, "%s", kw->replace); | |
4609 | ||
4610 | /* | |
4611 | * If there's more in the original string, copy that | |
4612 | * in too | |
4613 | */ | |
4614 | opt += strlen(kw->word) + olen; | |
4615 | if (strlen(opt)) | |
4616 | memcpy(new + olen + len, opt, opt - o_org - 1); | |
4617 | ||
4618 | /* | |
4619 | * replace opt and free the old opt | |
4620 | */ | |
4621 | opt = new; | |
d0c814ec | 4622 | free(o_org); |
7a958bd5 | 4623 | |
d0c814ec | 4624 | docalc = 1; |
74929ac2 JA |
4625 | } |
4626 | } | |
4627 | ||
d0c814ec SL |
4628 | /* |
4629 | * Check for potential math and invoke bc, if possible | |
4630 | */ | |
4631 | if (docalc) | |
4632 | opt = bc_calc(opt); | |
4633 | ||
7a958bd5 | 4634 | return opt; |
74929ac2 JA |
4635 | } |
4636 | ||
d0c814ec SL |
4637 | static char **dup_and_sub_options(char **opts, int num_opts) |
4638 | { | |
4639 | int i; | |
4640 | char **opts_copy = malloc(num_opts * sizeof(*opts)); | |
4641 | for (i = 0; i < num_opts; i++) { | |
4642 | opts_copy[i] = option_dup_subs(opts[i]); | |
4643 | if (!opts_copy[i]) | |
4644 | continue; | |
4645 | opts_copy[i] = fio_keyword_replace(opts_copy[i]); | |
4646 | } | |
4647 | return opts_copy; | |
4648 | } | |
4649 | ||
e15b023b | 4650 | static void show_closest_option(const char *opt) |
a2d027b9 JA |
4651 | { |
4652 | int best_option, best_distance; | |
4653 | int i, distance; | |
e15b023b JA |
4654 | char *name; |
4655 | ||
4656 | if (!strlen(opt)) | |
4657 | return; | |
4658 | ||
4659 | name = strdup(opt); | |
4660 | i = 0; | |
4661 | while (name[i] != '\0' && name[i] != '=') | |
4662 | i++; | |
4663 | name[i] = '\0'; | |
a2d027b9 JA |
4664 | |
4665 | best_option = -1; | |
4666 | best_distance = INT_MAX; | |
4667 | i = 0; | |
4668 | while (fio_options[i].name) { | |
4669 | distance = string_distance(name, fio_options[i].name); | |
4670 | if (distance < best_distance) { | |
4671 | best_distance = distance; | |
4672 | best_option = i; | |
4673 | } | |
4674 | i++; | |
4675 | } | |
4676 | ||
75e6bcba JA |
4677 | if (best_option != -1 && string_distance_ok(name, best_distance) && |
4678 | fio_options[best_option].type != FIO_OPT_UNSUPPORTED) | |
a2d027b9 | 4679 | log_err("Did you mean %s?\n", fio_options[best_option].name); |
e15b023b JA |
4680 | |
4681 | free(name); | |
a2d027b9 JA |
4682 | } |
4683 | ||
c2292325 | 4684 | int fio_options_parse(struct thread_data *td, char **opts, int num_opts) |
214e1eca | 4685 | { |
de890a1e | 4686 | int i, ret, unknown; |
d0c814ec | 4687 | char **opts_copy; |
3b8b7135 | 4688 | |
9af4a244 | 4689 | sort_options(opts, fio_options, num_opts); |
d0c814ec | 4690 | opts_copy = dup_and_sub_options(opts, num_opts); |
3b8b7135 | 4691 | |
de890a1e SL |
4692 | for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) { |
4693 | struct fio_option *o; | |
9af4a244 | 4694 | int newret = parse_option(opts_copy[i], opts[i], fio_options, |
a609f12a | 4695 | &o, &td->o, &td->opt_list); |
d0c814ec | 4696 | |
a8523a6a JA |
4697 | if (!newret && o) |
4698 | fio_option_mark_set(&td->o, o); | |
4699 | ||
de890a1e SL |
4700 | if (opts_copy[i]) { |
4701 | if (newret && !o) { | |
4702 | unknown++; | |
4703 | continue; | |
4704 | } | |
d0c814ec | 4705 | free(opts_copy[i]); |
de890a1e SL |
4706 | opts_copy[i] = NULL; |
4707 | } | |
4708 | ||
4709 | ret |= newret; | |
4710 | } | |
4711 | ||
4712 | if (unknown) { | |
4713 | ret |= ioengine_load(td); | |
4714 | if (td->eo) { | |
4715 | sort_options(opts_copy, td->io_ops->options, num_opts); | |
4716 | opts = opts_copy; | |
4717 | } | |
4718 | for (i = 0; i < num_opts; i++) { | |
4719 | struct fio_option *o = NULL; | |
4720 | int newret = 1; | |
a2d027b9 | 4721 | |
de890a1e SL |
4722 | if (!opts_copy[i]) |
4723 | continue; | |
4724 | ||
4725 | if (td->eo) | |
4726 | newret = parse_option(opts_copy[i], opts[i], | |
4727 | td->io_ops->options, &o, | |
66e19a38 | 4728 | td->eo, &td->opt_list); |
de890a1e SL |
4729 | |
4730 | ret |= newret; | |
a2d027b9 | 4731 | if (!o) { |
de890a1e | 4732 | log_err("Bad option <%s>\n", opts[i]); |
a2d027b9 JA |
4733 | show_closest_option(opts[i]); |
4734 | } | |
de890a1e SL |
4735 | free(opts_copy[i]); |
4736 | opts_copy[i] = NULL; | |
4737 | } | |
74929ac2 | 4738 | } |
3b8b7135 | 4739 | |
d0c814ec | 4740 | free(opts_copy); |
3b8b7135 | 4741 | return ret; |
214e1eca JA |
4742 | } |
4743 | ||
4744 | int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val) | |
4745 | { | |
a8523a6a JA |
4746 | int ret; |
4747 | ||
a609f12a | 4748 | ret = parse_cmd_option(opt, val, fio_options, &td->o, &td->opt_list); |
a8523a6a JA |
4749 | if (!ret) { |
4750 | struct fio_option *o; | |
4751 | ||
4752 | o = find_option(fio_options, opt); | |
4753 | if (o) | |
4754 | fio_option_mark_set(&td->o, o); | |
4755 | } | |
4756 | ||
4757 | return ret; | |
214e1eca JA |
4758 | } |
4759 | ||
de890a1e SL |
4760 | int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt, |
4761 | char *val) | |
4762 | { | |
d8b4f395 JA |
4763 | return parse_cmd_option(opt, val, td->io_ops->options, td->eo, |
4764 | &td->opt_list); | |
de890a1e SL |
4765 | } |
4766 | ||
214e1eca JA |
4767 | void fio_fill_default_options(struct thread_data *td) |
4768 | { | |
cb1402d6 | 4769 | td->o.magic = OPT_MAGIC; |
a609f12a | 4770 | fill_default_options(&td->o, fio_options); |
214e1eca JA |
4771 | } |
4772 | ||
4773 | int fio_show_option_help(const char *opt) | |
4774 | { | |
9af4a244 | 4775 | return show_cmd_help(fio_options, opt); |
214e1eca | 4776 | } |
d23bb327 | 4777 | |
de890a1e SL |
4778 | /* |
4779 | * dupe FIO_OPT_STR_STORE options | |
4780 | */ | |
4781 | void fio_options_mem_dupe(struct thread_data *td) | |
4782 | { | |
53b5693d | 4783 | options_mem_dupe(fio_options, &td->o); |
1647f592 JA |
4784 | |
4785 | if (td->eo && td->io_ops) { | |
de890a1e | 4786 | void *oldeo = td->eo; |
1647f592 | 4787 | |
de890a1e SL |
4788 | td->eo = malloc(td->io_ops->option_struct_size); |
4789 | memcpy(td->eo, oldeo, td->io_ops->option_struct_size); | |
53b5693d | 4790 | options_mem_dupe(td->io_ops->options, td->eo); |
de890a1e SL |
4791 | } |
4792 | } | |
4793 | ||
d6978a32 JA |
4794 | unsigned int fio_get_kb_base(void *data) |
4795 | { | |
a609f12a JA |
4796 | struct thread_data *td = cb_data_to_td(data); |
4797 | struct thread_options *o = &td->o; | |
d6978a32 JA |
4798 | unsigned int kb_base = 0; |
4799 | ||
cb1402d6 JA |
4800 | /* |
4801 | * This is a hack... For private options, *data is not holding | |
4802 | * a pointer to the thread_options, but to private data. This means | |
4803 | * we can't safely dereference it, but magic is first so mem wise | |
4804 | * it is valid. But this also means that if the job first sets | |
4805 | * kb_base and expects that to be honored by private options, | |
4806 | * it will be disappointed. We will return the global default | |
4807 | * for this. | |
4808 | */ | |
4809 | if (o && o->magic == OPT_MAGIC) | |
83ea422a | 4810 | kb_base = o->kb_base; |
d6978a32 JA |
4811 | if (!kb_base) |
4812 | kb_base = 1024; | |
4813 | ||
4814 | return kb_base; | |
4815 | } | |
9f988e2e | 4816 | |
07b3232d | 4817 | int add_option(struct fio_option *o) |
9f988e2e | 4818 | { |
07b3232d JA |
4819 | struct fio_option *__o; |
4820 | int opt_index = 0; | |
4821 | ||
9af4a244 | 4822 | __o = fio_options; |
07b3232d JA |
4823 | while (__o->name) { |
4824 | opt_index++; | |
4825 | __o++; | |
4826 | } | |
4827 | ||
7b504edd JA |
4828 | if (opt_index + 1 == FIO_MAX_OPTS) { |
4829 | log_err("fio: FIO_MAX_OPTS is too small\n"); | |
4830 | return 1; | |
4831 | } | |
4832 | ||
9af4a244 | 4833 | memcpy(&fio_options[opt_index], o, sizeof(*o)); |
7b504edd | 4834 | fio_options[opt_index + 1].name = NULL; |
07b3232d | 4835 | return 0; |
9f988e2e | 4836 | } |
e2de69da | 4837 | |
07b3232d | 4838 | void invalidate_profile_options(const char *prof_name) |
e2de69da | 4839 | { |
07b3232d | 4840 | struct fio_option *o; |
e2de69da | 4841 | |
9af4a244 | 4842 | o = fio_options; |
07b3232d JA |
4843 | while (o->name) { |
4844 | if (o->prof_name && !strcmp(o->prof_name, prof_name)) { | |
4845 | o->type = FIO_OPT_INVALID; | |
4846 | o->prof_name = NULL; | |
4847 | } | |
4848 | o++; | |
e2de69da JA |
4849 | } |
4850 | } | |
f5b6bb85 JA |
4851 | |
4852 | void add_opt_posval(const char *optname, const char *ival, const char *help) | |
4853 | { | |
4854 | struct fio_option *o; | |
4855 | unsigned int i; | |
4856 | ||
9af4a244 | 4857 | o = find_option(fio_options, optname); |
f5b6bb85 JA |
4858 | if (!o) |
4859 | return; | |
4860 | ||
4861 | for (i = 0; i < PARSE_MAX_VP; i++) { | |
4862 | if (o->posval[i].ival) | |
4863 | continue; | |
4864 | ||
4865 | o->posval[i].ival = ival; | |
4866 | o->posval[i].help = help; | |
4867 | break; | |
4868 | } | |
4869 | } | |
4870 | ||
4871 | void del_opt_posval(const char *optname, const char *ival) | |
4872 | { | |
4873 | struct fio_option *o; | |
4874 | unsigned int i; | |
4875 | ||
9af4a244 | 4876 | o = find_option(fio_options, optname); |
f5b6bb85 JA |
4877 | if (!o) |
4878 | return; | |
4879 | ||
4880 | for (i = 0; i < PARSE_MAX_VP; i++) { | |
4881 | if (!o->posval[i].ival) | |
4882 | continue; | |
4883 | if (strcmp(o->posval[i].ival, ival)) | |
4884 | continue; | |
4885 | ||
4886 | o->posval[i].ival = NULL; | |
4887 | o->posval[i].help = NULL; | |
4888 | } | |
4889 | } | |
7e356b2d JA |
4890 | |
4891 | void fio_options_free(struct thread_data *td) | |
4892 | { | |
ca6336a8 | 4893 | options_free(fio_options, &td->o); |
de890a1e SL |
4894 | if (td->eo && td->io_ops && td->io_ops->options) { |
4895 | options_free(td->io_ops->options, td->eo); | |
4896 | free(td->eo); | |
4897 | td->eo = NULL; | |
4898 | } | |
7e356b2d | 4899 | } |
c504ee55 JA |
4900 | |
4901 | struct fio_option *fio_option_find(const char *name) | |
4902 | { | |
4903 | return find_option(fio_options, name); | |
4904 | } | |
4905 | ||
f0e7f45a JA |
4906 | static struct fio_option *find_next_opt(struct thread_options *o, |
4907 | struct fio_option *from, | |
4908 | unsigned int off1) | |
a8523a6a | 4909 | { |
f0e7f45a | 4910 | struct fio_option *opt; |
a8523a6a | 4911 | |
f0e7f45a JA |
4912 | if (!from) |
4913 | from = &fio_options[0]; | |
4914 | else | |
4915 | from++; | |
4916 | ||
4917 | opt = NULL; | |
4918 | do { | |
4919 | if (off1 == from->off1) { | |
4920 | opt = from; | |
a8523a6a JA |
4921 | break; |
4922 | } | |
f0e7f45a JA |
4923 | from++; |
4924 | } while (from->name); | |
a8523a6a | 4925 | |
f0e7f45a JA |
4926 | return opt; |
4927 | } | |
4928 | ||
4929 | static int opt_is_set(struct thread_options *o, struct fio_option *opt) | |
4930 | { | |
4931 | unsigned int opt_off, index, offset; | |
a8523a6a JA |
4932 | |
4933 | opt_off = opt - &fio_options[0]; | |
4934 | index = opt_off / (8 * sizeof(uint64_t)); | |
4935 | offset = opt_off & ((8 * sizeof(uint64_t)) - 1); | |
e9d686d6 | 4936 | return (o->set_options[index] & ((uint64_t)1 << offset)) != 0; |
a8523a6a JA |
4937 | } |
4938 | ||
72f39748 | 4939 | bool __fio_option_is_set(struct thread_options *o, unsigned int off1) |
f0e7f45a JA |
4940 | { |
4941 | struct fio_option *opt, *next; | |
4942 | ||
4943 | next = NULL; | |
4944 | while ((opt = find_next_opt(o, next, off1)) != NULL) { | |
4945 | if (opt_is_set(o, opt)) | |
72f39748 | 4946 | return true; |
f0e7f45a JA |
4947 | |
4948 | next = opt; | |
4949 | } | |
4950 | ||
72f39748 | 4951 | return false; |
f0e7f45a JA |
4952 | } |
4953 | ||
a8523a6a JA |
4954 | void fio_option_mark_set(struct thread_options *o, struct fio_option *opt) |
4955 | { | |
4956 | unsigned int opt_off, index, offset; | |
4957 | ||
4958 | opt_off = opt - &fio_options[0]; | |
4959 | index = opt_off / (8 * sizeof(uint64_t)); | |
4960 | offset = opt_off & ((8 * sizeof(uint64_t)) - 1); | |
e9d686d6 | 4961 | o->set_options[index] |= (uint64_t)1 << offset; |
a8523a6a | 4962 | } |