9 #include <netinet/in.h>
14 #include "lib/pattern.h"
19 char client_sockaddr_str[INET6_ADDRSTRLEN] = { 0 };
21 #define cb_data_to_td(data) container_of(data, struct thread_data, o)
23 static const struct pattern_fmt_desc fmt_desc[] = {
26 .len = FIO_FIELD_SIZE(struct io_u *, offset),
27 .paste = paste_blockoff
33 * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that.
35 static char *get_opt_postfix(const char *str)
37 char *p = strstr(str, ":");
43 strip_blank_front(&p);
48 static bool split_parse_distr(const char *str, double *val, double *center)
62 r = str_to_float(cp, center, 0);
64 r = r && str_to_float(p, val, 0);
69 static int bs_cmp(const void *p1, const void *p2)
71 const struct bssplit *bsp1 = p1;
72 const struct bssplit *bsp2 = p2;
74 return (int) bsp1->perc - (int) bsp2->perc;
77 int split_parse_ddir(struct thread_options *o, struct split *split,
78 char *str, bool absolute, unsigned int max_splits)
80 unsigned long long perc;
88 while ((fname = strsep(&str, ":")) != NULL) {
94 perc_str = strstr(fname, "/");
99 if (str_to_decimal(perc_str, &val, 1, o, 0, 0)) {
100 log_err("fio: split conversion failed\n");
105 perc = atoi(perc_str);
118 if (str_to_decimal(fname, &val, 1, o, 0, 0)) {
119 log_err("fio: split conversion failed\n");
123 split->val1[i] = val;
124 split->val2[i] = perc;
126 if (i == max_splits) {
127 log_err("fio: hit max of %d split entries\n", i);
136 static int bssplit_ddir(struct thread_options *o, void *eo,
137 enum fio_ddir ddir, char *str, bool data)
139 unsigned int i, perc, perc_missing;
140 unsigned long long max_bs, min_bs;
143 memset(&split, 0, sizeof(split));
145 if (split_parse_ddir(o, &split, str, data, BSSPLIT_MAX))
152 o->bssplit[ddir] = malloc(split.nr * sizeof(struct bssplit));
153 o->bssplit_nr[ddir] = split.nr;
154 for (i = 0; i < split.nr; i++) {
155 if (split.val1[i] > max_bs)
156 max_bs = split.val1[i];
157 if (split.val1[i] < min_bs)
158 min_bs = split.val1[i];
160 o->bssplit[ddir][i].bs = split.val1[i];
161 o->bssplit[ddir][i].perc =split.val2[i];
165 * Now check if the percentages add up, and how much is missing
167 perc = perc_missing = 0;
168 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
169 struct bssplit *bsp = &o->bssplit[ddir][i];
171 if (bsp->perc == -1U)
177 if (perc > 100 && perc_missing > 1) {
178 log_err("fio: bssplit percentages add to more than 100%%\n");
179 free(o->bssplit[ddir]);
180 o->bssplit[ddir] = NULL;
185 * If values didn't have a percentage set, divide the remains between
189 if (perc_missing == 1 && o->bssplit_nr[ddir] == 1)
191 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
192 struct bssplit *bsp = &o->bssplit[ddir][i];
194 if (bsp->perc == -1U)
195 bsp->perc = (100 - perc) / perc_missing;
199 o->min_bs[ddir] = min_bs;
200 o->max_bs[ddir] = max_bs;
203 * now sort based on percentages, for ease of lookup
205 qsort(o->bssplit[ddir], o->bssplit_nr[ddir], sizeof(struct bssplit), bs_cmp);
209 int str_split_parse(struct thread_data *td, char *str,
210 split_parse_fn *fn, void *eo, bool data)
215 odir = strchr(str, ',');
217 ddir = strchr(odir + 1, ',');
219 ret = fn(&td->o, eo, DDIR_TRIM, ddir + 1, data);
225 op = strdup(odir + 1);
226 ret = fn(&td->o, eo, DDIR_TRIM, op, data);
231 ret = fn(&td->o, eo, DDIR_WRITE, odir + 1, data);
234 ret = fn(&td->o, eo, DDIR_READ, str, data);
240 ret = fn(&td->o, eo, DDIR_WRITE, op, data);
245 ret = fn(&td->o, eo, DDIR_TRIM, op, data);
249 ret = fn(&td->o, eo, DDIR_READ, str, data);
255 static int fio_fdp_cmp(const void *p1, const void *p2)
257 const uint16_t *t1 = p1;
258 const uint16_t *t2 = p2;
263 static int str_fdp_pli_cb(void *data, const char *input)
265 struct thread_data *td = cb_data_to_td(data);
269 p = str = strdup(input);
270 strip_blank_front(&str);
271 strip_blank_end(str);
273 while ((id1 = strsep(&str, ",")) != NULL) {
275 unsigned int start, end;
282 while ((id2 = strsep(&str2, "-")) != NULL) {
286 end = strtoull(id2, NULL, 0);
289 start = strtoull(id1, NULL, 0);
297 while (start <= end) {
298 if (i >= FIO_MAX_DP_IDS) {
299 log_err("fio: only %d IDs supported\n", FIO_MAX_DP_IDS);
303 if (start > 0xFFFF) {
304 log_err("Placement IDs cannot exceed 0xFFFF\n");
308 td->o.dp_ids[i++] = start++;
317 qsort(td->o.dp_ids, i, sizeof(*td->o.dp_ids), fio_fdp_cmp);
323 /* str_dp_scheme_cb() is a callback function for parsing the fdp_scheme option
324 This function validates the fdp_scheme filename. */
325 static int str_dp_scheme_cb(void *data, const char *input)
327 struct thread_data *td = cb_data_to_td(data);
335 filename = strdup(td->o.dp_scheme_file);
336 strip_blank_front(&filename);
337 strip_blank_end(filename);
339 strcpy(td->o.dp_scheme_file, filename);
341 if (lstat(filename, &sb) < 0){
343 log_err("fio: lstat() error related to %s\n", filename);
344 td_verror(td, ret, "lstat");
348 if (!S_ISREG(sb.st_mode)) {
350 log_err("fio: %s is not a file\n", filename);
351 td_verror(td, ret, "S_ISREG");
360 static int str_bssplit_cb(void *data, const char *input)
362 struct thread_data *td = cb_data_to_td(data);
366 p = str = strdup(input);
368 strip_blank_front(&str);
369 strip_blank_end(str);
371 ret = str_split_parse(td, str, bssplit_ddir, NULL, false);
373 if (parse_dryrun()) {
376 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
377 free(td->o.bssplit[i]);
378 td->o.bssplit[i] = NULL;
379 td->o.bssplit_nr[i] = 0;
387 static int parse_cmdprio_bssplit_entry(struct thread_options *o,
388 struct split_prio *entry, char *str)
393 unsigned int perc = 0, class, level, hint;
396 * valid entry formats:
397 * bs/ - %s/ - set perc to 0, prio to -1.
398 * bs/perc - %s/%u - set prio to -1.
399 * bs/perc/class/level - %s/%u/%u/%u
400 * bs/perc/class/level/hint - %s/%u/%u/%u/%u
402 matches = sscanf(str, "%m[^/]/%u/%u/%u/%u",
403 &bs_str, &perc, &class, &level, &hint);
405 log_err("fio: invalid cmdprio_bssplit format\n");
409 if (str_to_decimal(bs_str, &bs_val, 1, o, 0, 0)) {
410 log_err("fio: split conversion failed\n");
417 entry->perc = min(perc, 100u);
420 case 1: /* bs/ case */
421 case 2: /* bs/perc case */
423 case 4: /* bs/perc/class/level case */
424 case 5: /* bs/perc/class/level/hint case */
425 class = min(class, (unsigned int) IOPRIO_MAX_PRIO_CLASS);
426 level = min(level, (unsigned int) IOPRIO_MAX_PRIO);
428 hint = min(hint, (unsigned int) IOPRIO_MAX_PRIO_HINT);
431 entry->prio = ioprio_value(class, level, hint);
434 log_err("fio: invalid cmdprio_bssplit format\n");
442 * Returns a negative integer if the first argument should be before the second
443 * argument in the sorted list. A positive integer if the first argument should
444 * be after the second argument in the sorted list. A zero if they are equal.
446 static int fio_split_prio_cmp(const void *p1, const void *p2)
448 const struct split_prio *tmp1 = p1;
449 const struct split_prio *tmp2 = p2;
451 if (tmp1->bs > tmp2->bs)
453 if (tmp1->bs < tmp2->bs)
458 int split_parse_prio_ddir(struct thread_options *o, struct split_prio **entries,
459 int *nr_entries, char *str)
461 struct split_prio *tmp_entries;
462 unsigned int nr_bssplits;
463 char *str_cpy, *p, *fname;
465 /* strsep modifies the string, dup it so that we can use strsep twice */
466 p = str_cpy = strdup(str);
471 while ((fname = strsep(&str_cpy, ":")) != NULL) {
478 if (nr_bssplits > BSSPLIT_MAX) {
479 log_err("fio: too many cmdprio_bssplit entries\n");
483 tmp_entries = calloc(nr_bssplits, sizeof(*tmp_entries));
488 while ((fname = strsep(&str, ":")) != NULL) {
489 struct split_prio *entry;
494 entry = &tmp_entries[nr_bssplits];
496 if (parse_cmdprio_bssplit_entry(o, entry, fname)) {
497 log_err("fio: failed to parse cmdprio_bssplit entry\n");
502 /* skip zero perc entries, they provide no useful information */
507 qsort(tmp_entries, nr_bssplits, sizeof(*tmp_entries),
510 *entries = tmp_entries;
511 *nr_entries = nr_bssplits;
516 static int str2error(char *str)
518 const char *err[] = { "EPERM", "ENOENT", "ESRCH", "EINTR", "EIO",
519 "ENXIO", "E2BIG", "ENOEXEC", "EBADF",
520 "ECHILD", "EAGAIN", "ENOMEM", "EACCES",
521 "EFAULT", "ENOTBLK", "EBUSY", "EEXIST",
522 "EXDEV", "ENODEV", "ENOTDIR", "EISDIR",
523 "EINVAL", "ENFILE", "EMFILE", "ENOTTY",
524 "ETXTBSY","EFBIG", "ENOSPC", "ESPIPE",
525 "EROFS","EMLINK", "EPIPE", "EDOM", "ERANGE" };
526 int i = 0, num = sizeof(err) / sizeof(char *);
529 if (!strcmp(err[i], str))
536 static int ignore_error_type(struct thread_data *td, enum error_type_bit etype,
543 if (etype >= ERROR_TYPE_CNT) {
544 log_err("Illegal error type\n");
548 td->o.ignore_error_nr[etype] = 4;
549 error = calloc(4, sizeof(int));
552 while ((fname = strsep(&str, ":")) != NULL) {
558 * grow struct buffer, if needed
560 if (i == td->o.ignore_error_nr[etype]) {
561 td->o.ignore_error_nr[etype] <<= 1;
562 error = realloc(error, td->o.ignore_error_nr[etype]
565 if (fname[0] == 'E') {
566 error[i] = str2error(fname);
569 if (!strncmp(fname, "0x", 2) ||
570 !strncmp(fname, "0X", 2))
572 error[i] = strtol(fname, NULL, base);
574 error[i] = -error[i];
577 log_err("Unknown error %s, please use number value\n",
579 td->o.ignore_error_nr[etype] = 0;
586 td->o.continue_on_error |= 1 << etype;
587 td->o.ignore_error_nr[etype] = i;
588 td->o.ignore_error[etype] = error;
590 td->o.ignore_error_nr[etype] = 0;
598 static int str_replay_skip_cb(void *data, const char *input)
600 struct thread_data *td = cb_data_to_td(data);
607 p = str = strdup(input);
609 strip_blank_front(&str);
610 strip_blank_end(str);
616 if (!strcmp(p, "read"))
617 td->o.replay_skip |= 1u << DDIR_READ;
618 else if (!strcmp(p, "write"))
619 td->o.replay_skip |= 1u << DDIR_WRITE;
620 else if (!strcmp(p, "trim"))
621 td->o.replay_skip |= 1u << DDIR_TRIM;
622 else if (!strcmp(p, "sync"))
623 td->o.replay_skip |= 1u << DDIR_SYNC;
625 log_err("Unknown skip type: %s\n", p);
635 static int str_ignore_error_cb(void *data, const char *input)
637 struct thread_data *td = cb_data_to_td(data);
640 enum error_type_bit type = 0;
645 p = str = strdup(input);
647 strip_blank_front(&str);
648 strip_blank_end(str);
654 ret = ignore_error_type(td, type, p);
664 static int str_rw_cb(void *data, const char *str)
666 struct thread_data *td = cb_data_to_td(data);
667 struct thread_options *o = &td->o;
676 nr = get_opt_postfix(str);
683 if (str_to_decimal(nr, &val, 1, o, 0, 0)) {
684 log_err("fio: randrw postfix parsing failed\n");
688 if ((val <= 0) || (val > UINT_MAX)) {
689 log_err("fio: randrw postfix parsing out of range\n");
693 o->ddir_seq_nr = (unsigned int) val;
697 if (str_to_decimal(nr, &val, 1, o, 0, 0)) {
698 log_err("fio: rw postfix parsing failed\n");
703 o->ddir_seq_add = val;
710 static int str_mem_cb(void *data, const char *mem)
712 struct thread_data *td = cb_data_to_td(data);
714 if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP ||
715 td->o.mem_type == MEM_MMAPSHARED)
716 td->o.mmapfile = get_opt_postfix(mem);
721 static int fio_clock_source_cb(void *data, const char *str)
723 struct thread_data *td = cb_data_to_td(data);
725 fio_clock_source = td->o.clocksource;
726 fio_clock_source_set = 1;
731 static int str_rwmix_read_cb(void *data, long long *val)
733 struct thread_data *td = cb_data_to_td(data);
735 td->o.rwmix[DDIR_READ] = *val;
736 td->o.rwmix[DDIR_WRITE] = 100 - *val;
740 static int str_rwmix_write_cb(void *data, long long *val)
742 struct thread_data *td = cb_data_to_td(data);
744 td->o.rwmix[DDIR_WRITE] = *val;
745 td->o.rwmix[DDIR_READ] = 100 - *val;
749 static int str_exitall_cb(void)
751 exitall_on_terminate = true;
755 #ifdef FIO_HAVE_CPU_AFFINITY
756 int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index)
758 unsigned int i, index, cpus_in_mask;
759 const long max_cpu = cpus_configured();
761 cpus_in_mask = fio_cpu_count(mask);
765 cpu_index = cpu_index % cpus_in_mask;
768 for (i = 0; i < max_cpu; i++) {
769 if (!fio_cpu_isset(mask, i))
772 if (cpu_index != index)
773 fio_cpu_clear(mask, i);
778 return fio_cpu_count(mask);
781 static int str_cpumask_cb(void *data, unsigned long long *val)
783 struct thread_data *td = cb_data_to_td(data);
791 ret = fio_cpuset_init(&td->o.cpumask);
793 log_err("fio: cpuset_init failed\n");
794 td_verror(td, ret, "fio_cpuset_init");
798 max_cpu = cpus_configured();
800 for (i = 0; i < sizeof(int) * 8; i++) {
801 if ((1 << i) & *val) {
803 log_err("fio: CPU %d too large (max=%ld)\n", i,
807 dprint(FD_PARSE, "set cpu allowed %d\n", i);
808 fio_cpu_set(&td->o.cpumask, i);
815 static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask,
822 ret = fio_cpuset_init(mask);
824 log_err("fio: cpuset_init failed\n");
825 td_verror(td, ret, "fio_cpuset_init");
829 p = str = strdup(input);
831 strip_blank_front(&str);
832 strip_blank_end(str);
834 max_cpu = cpus_configured();
836 while ((cpu = strsep(&str, ",")) != NULL) {
845 while ((cpu2 = strsep(&str2, "-")) != NULL) {
855 while (icpu <= icpu2) {
856 if (icpu >= FIO_MAX_CPUS) {
857 log_err("fio: your OS only supports up to"
858 " %d CPUs\n", (int) FIO_MAX_CPUS);
862 if (icpu >= max_cpu) {
863 log_err("fio: CPU %d too large (max=%ld)\n",
869 dprint(FD_PARSE, "set cpu allowed %d\n", icpu);
870 fio_cpu_set(mask, icpu);
881 static int str_cpus_allowed_cb(void *data, const char *input)
883 struct thread_data *td = cb_data_to_td(data);
888 return set_cpus_allowed(td, &td->o.cpumask, input);
891 static int str_verify_cpus_allowed_cb(void *data, const char *input)
893 struct thread_data *td = cb_data_to_td(data);
898 return set_cpus_allowed(td, &td->o.verify_cpumask, input);
902 static int str_log_cpus_allowed_cb(void *data, const char *input)
904 struct thread_data *td = cb_data_to_td(data);
909 return set_cpus_allowed(td, &td->o.log_gz_cpumask, input);
911 #endif /* CONFIG_ZLIB */
913 #endif /* FIO_HAVE_CPU_AFFINITY */
915 #ifdef CONFIG_LIBNUMA
916 static int str_numa_cpunodes_cb(void *data, char *input)
918 struct thread_data *td = cb_data_to_td(data);
919 struct bitmask *verify_bitmask;
924 /* numa_parse_nodestring() parses a character string list
925 * of nodes into a bit mask. The bit mask is allocated by
926 * numa_allocate_nodemask(), so it should be freed by
927 * numa_free_nodemask().
929 verify_bitmask = numa_parse_nodestring(input);
930 if (verify_bitmask == NULL) {
931 log_err("fio: numa_parse_nodestring failed\n");
932 td_verror(td, 1, "str_numa_cpunodes_cb");
935 numa_free_nodemask(verify_bitmask);
937 td->o.numa_cpunodes = strdup(input);
941 static int str_numa_mpol_cb(void *data, char *input)
943 struct thread_data *td = cb_data_to_td(data);
944 const char * const policy_types[] =
945 { "default", "prefer", "bind", "interleave", "local", NULL };
948 struct bitmask *verify_bitmask;
953 nodelist = strchr(input, ':');
955 /* NUL-terminate mode */
959 for (i = 0; i <= MPOL_LOCAL; i++) {
960 if (!strcmp(input, policy_types[i])) {
961 td->o.numa_mem_mode = i;
965 if (i > MPOL_LOCAL) {
966 log_err("fio: memory policy should be: default, prefer, bind, interleave, local\n");
970 switch (td->o.numa_mem_mode) {
973 * Insist on a nodelist of one node only
976 char *rest = nodelist;
977 while (isdigit(*rest))
980 log_err("fio: one node only for \'prefer\'\n");
984 log_err("fio: one node is needed for \'prefer\'\n");
988 case MPOL_INTERLEAVE:
990 * Default to online nodes with memory if no nodelist
993 nodelist = strdup("all");
998 * Don't allow a nodelist
1001 log_err("fio: NO nodelist for \'local\'\n");
1007 * Insist on a nodelist
1010 log_err("fio: a nodelist is needed for \'bind\'\n");
1017 /* numa_parse_nodestring() parses a character string list
1018 * of nodes into a bit mask. The bit mask is allocated by
1019 * numa_allocate_nodemask(), so it should be freed by
1020 * numa_free_nodemask().
1022 switch (td->o.numa_mem_mode) {
1023 case MPOL_PREFERRED:
1024 td->o.numa_mem_prefer_node = atoi(nodelist);
1026 case MPOL_INTERLEAVE:
1028 verify_bitmask = numa_parse_nodestring(nodelist);
1029 if (verify_bitmask == NULL) {
1030 log_err("fio: numa_parse_nodestring failed\n");
1031 td_verror(td, 1, "str_numa_memnodes_cb");
1034 td->o.numa_memnodes = strdup(nodelist);
1035 numa_free_nodemask(verify_bitmask);
1050 static int str_fst_cb(void *data, const char *str)
1052 struct thread_data *td = cb_data_to_td(data);
1058 td->file_service_nr = 1;
1060 switch (td->o.file_service_type) {
1061 case FIO_FSERVICE_RANDOM:
1062 case FIO_FSERVICE_RR:
1063 case FIO_FSERVICE_SEQ:
1064 nr = get_opt_postfix(str);
1066 td->file_service_nr = atoi(nr);
1071 case FIO_FSERVICE_ZIPF:
1074 case FIO_FSERVICE_PARETO:
1075 val = FIO_DEF_PARETO;
1077 case FIO_FSERVICE_GAUSS:
1081 log_err("fio: bad file service type: %d\n", td->o.file_service_type);
1088 nr = get_opt_postfix(str);
1089 if (nr && !split_parse_distr(nr, &val, ¢er)) {
1090 log_err("fio: file service type random postfix parsing failed\n");
1097 if (center != -1 && (center < 0.00 || center > 1.00)) {
1098 log_err("fio: distribution center out of range (0 <= center <= 1.0)\n");
1101 td->random_center = center;
1103 switch (td->o.file_service_type) {
1104 case FIO_FSERVICE_ZIPF:
1106 log_err("fio: zipf theta must be different than 1.0\n");
1111 td->zipf_theta = val;
1113 case FIO_FSERVICE_PARETO:
1114 if (val <= 0.00 || val >= 1.00) {
1115 log_err("fio: pareto input out of range (0 < input < 1.0)\n");
1122 case FIO_FSERVICE_GAUSS:
1123 if (val < 0.00 || val >= 100.00) {
1124 log_err("fio: normal deviation out of range (0 <= input < 100.0)\n");
1129 td->gauss_dev = val;
1136 #ifdef CONFIG_SYNC_FILE_RANGE
1137 static int str_sfr_cb(void *data, const char *str)
1139 struct thread_data *td = cb_data_to_td(data);
1140 char *nr = get_opt_postfix(str);
1142 td->sync_file_range_nr = 1;
1144 td->sync_file_range_nr = atoi(nr);
1152 static int zone_split_ddir(struct thread_options *o, void *eo,
1153 enum fio_ddir ddir, char *str, bool absolute)
1155 unsigned int i, perc, perc_missing, sperc, sperc_missing;
1158 memset(&split, 0, sizeof(split));
1160 if (split_parse_ddir(o, &split, str, absolute, ZONESPLIT_MAX))
1165 o->zone_split[ddir] = malloc(split.nr * sizeof(struct zone_split));
1166 o->zone_split_nr[ddir] = split.nr;
1167 for (i = 0; i < split.nr; i++) {
1168 o->zone_split[ddir][i].access_perc = split.val1[i];
1170 o->zone_split[ddir][i].size = split.val2[i];
1172 o->zone_split[ddir][i].size_perc = split.val2[i];
1176 * Now check if the percentages add up, and how much is missing
1178 perc = perc_missing = 0;
1179 sperc = sperc_missing = 0;
1180 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
1181 struct zone_split *zsp = &o->zone_split[ddir][i];
1183 if (zsp->access_perc == (uint8_t) -1U)
1186 perc += zsp->access_perc;
1189 if (zsp->size_perc == (uint8_t) -1U)
1192 sperc += zsp->size_perc;
1196 if (perc > 100 || sperc > 100) {
1197 log_err("fio: zone_split percentages add to more than 100%%\n");
1198 free(o->zone_split[ddir]);
1199 o->zone_split[ddir] = NULL;
1203 log_err("fio: access percentage don't add up to 100 for zoned "
1204 "random distribution (got=%u)\n", perc);
1205 free(o->zone_split[ddir]);
1206 o->zone_split[ddir] = NULL;
1211 * If values didn't have a percentage set, divide the remains between
1215 if (perc_missing == 1 && o->zone_split_nr[ddir] == 1)
1217 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
1218 struct zone_split *zsp = &o->zone_split[ddir][i];
1220 if (zsp->access_perc == (uint8_t) -1U)
1221 zsp->access_perc = (100 - perc) / perc_missing;
1224 if (sperc_missing) {
1225 if (sperc_missing == 1 && o->zone_split_nr[ddir] == 1)
1227 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
1228 struct zone_split *zsp = &o->zone_split[ddir][i];
1230 if (zsp->size_perc == (uint8_t) -1U)
1231 zsp->size_perc = (100 - sperc) / sperc_missing;
1238 static int parse_zoned_distribution(struct thread_data *td, const char *input,
1241 const char *pre = absolute ? "zoned_abs:" : "zoned:";
1245 p = str = strdup(input);
1247 strip_blank_front(&str);
1248 strip_blank_end(str);
1250 /* We expect it to start like that, bail if not */
1251 if (strncmp(str, pre, strlen(pre))) {
1252 log_err("fio: mismatch in zoned input <%s>\n", str);
1258 ret = str_split_parse(td, str, zone_split_ddir, NULL, absolute);
1262 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
1265 dprint(FD_PARSE, "zone ddir %d (nr=%u): \n", i, td->o.zone_split_nr[i]);
1267 for (j = 0; j < td->o.zone_split_nr[i]; j++) {
1268 struct zone_split *zsp = &td->o.zone_split[i][j];
1271 dprint(FD_PARSE, "\t%d: %u/%llu\n", j,
1273 (unsigned long long) zsp->size);
1275 dprint(FD_PARSE, "\t%d: %u/%u\n", j,
1282 if (parse_dryrun()) {
1283 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
1284 free(td->o.zone_split[i]);
1285 td->o.zone_split[i] = NULL;
1286 td->o.zone_split_nr[i] = 0;
1293 for (i = 0; i < DDIR_RWDIR_CNT; i++)
1294 td->o.zone_split_nr[i] = 0;
1300 static int str_random_distribution_cb(void *data, const char *str)
1302 struct thread_data *td = cb_data_to_td(data);
1307 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
1309 else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
1310 val = FIO_DEF_PARETO;
1311 else if (td->o.random_distribution == FIO_RAND_DIST_GAUSS)
1313 else if (td->o.random_distribution == FIO_RAND_DIST_ZONED)
1314 return parse_zoned_distribution(td, str, false);
1315 else if (td->o.random_distribution == FIO_RAND_DIST_ZONED_ABS)
1316 return parse_zoned_distribution(td, str, true);
1320 nr = get_opt_postfix(str);
1321 if (nr && !split_parse_distr(nr, &val, ¢er)) {
1322 log_err("fio: random postfix parsing failed\n");
1329 if (center != -1 && (center < 0.00 || center > 1.00)) {
1330 log_err("fio: distribution center out of range (0 <= center <= 1.0)\n");
1333 td->o.random_center.u.f = center;
1335 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) {
1337 log_err("fio: zipf theta must different than 1.0\n");
1342 td->o.zipf_theta.u.f = val;
1343 } else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) {
1344 if (val <= 0.00 || val >= 1.00) {
1345 log_err("fio: pareto input out of range (0 < input < 1.0)\n");
1350 td->o.pareto_h.u.f = val;
1352 if (val < 0.00 || val >= 100.0) {
1353 log_err("fio: normal deviation out of range (0 <= input < 100.0)\n");
1358 td->o.gauss_dev.u.f = val;
1364 static int str_steadystate_cb(void *data, const char *str)
1366 struct thread_data *td = cb_data_to_td(data);
1372 if (td->o.ss_state != FIO_SS_IOPS && td->o.ss_state != FIO_SS_IOPS_SLOPE &&
1373 td->o.ss_state != FIO_SS_BW && td->o.ss_state != FIO_SS_BW_SLOPE) {
1374 /* should be impossible to get here */
1375 log_err("fio: unknown steady state criterion\n");
1379 nr = get_opt_postfix(str);
1381 log_err("fio: steadystate threshold must be specified in addition to criterion\n");
1386 /* ENHANCEMENT Allow fio to understand size=10.2% and use here */
1387 pct = strstr(nr, "%");
1390 strip_blank_end(nr);
1391 if (!str_to_float(nr, &val, 0)) {
1392 log_err("fio: could not parse steadystate threshold percentage\n");
1397 dprint(FD_PARSE, "set steady state threshold to %f%%\n", val);
1402 td->o.ss_state |= FIO_SS_PCT;
1403 td->o.ss_limit.u.f = val;
1404 } else if (td->o.ss_state & FIO_SS_IOPS) {
1405 if (!str_to_float(nr, &val, 0)) {
1406 log_err("fio: steadystate IOPS threshold postfix parsing failed\n");
1411 dprint(FD_PARSE, "set steady state IOPS threshold to %f\n", val);
1416 td->o.ss_limit.u.f = val;
1417 } else { /* bandwidth criterion */
1418 if (str_to_decimal(nr, &ll, 1, td, 0, 0)) {
1419 log_err("fio: steadystate BW threshold postfix parsing failed\n");
1424 dprint(FD_PARSE, "set steady state BW threshold to %lld\n", ll);
1429 td->o.ss_limit.u.f = (double) ll;
1432 td->ss.state = td->o.ss_state;
1437 * Return next name in the string. Files are separated with ':'. If the ':'
1438 * is escaped with a '\', then that ':' is part of the filename and does not
1439 * indicate a new file.
1441 char *get_next_str(char **ptr)
1446 if (!str || !strlen(str))
1452 * No colon, we are done
1454 p = strchr(str, ':');
1461 * We got a colon, but it's the first character. Skip and
1469 if (*(p - 1) != '\\') {
1475 memmove(p - 1, p, strlen(p) + 1);
1483 int get_max_str_idx(char *input)
1485 unsigned int cur_idx;
1488 p = str = strdup(input);
1489 for (cur_idx = 0; ; cur_idx++)
1490 if (get_next_str(&str) == NULL)
1498 * Returns the directory at the index, indexes > entries will be
1499 * assigned via modulo division of the index
1501 int set_name_idx(char *target, size_t tlen, char *input, int index,
1502 bool unique_filename)
1504 unsigned int cur_idx;
1506 char *fname, *str, *p;
1508 p = str = strdup(input);
1510 index %= get_max_str_idx(input);
1511 for (cur_idx = 0; cur_idx <= index; cur_idx++)
1512 fname = get_next_str(&str);
1514 if (client_sockaddr_str[0] && unique_filename) {
1515 len = snprintf(target, tlen, "%s/%s.", fname,
1516 client_sockaddr_str);
1518 len = snprintf(target, tlen, "%s%c", fname,
1519 FIO_OS_PATH_SEPARATOR);
1521 target[tlen - 1] = '\0';
1527 char* get_name_by_idx(char *input, int index)
1529 unsigned int cur_idx;
1530 char *fname, *str, *p;
1532 p = str = strdup(input);
1534 index %= get_max_str_idx(input);
1535 for (cur_idx = 0; cur_idx <= index; cur_idx++)
1536 fname = get_next_str(&str);
1538 fname = strdup(fname);
1544 static int str_filename_cb(void *data, const char *input)
1546 struct thread_data *td = cb_data_to_td(data);
1547 char *fname, *str, *p;
1549 p = str = strdup(input);
1551 strip_blank_front(&str);
1552 strip_blank_end(str);
1555 * Ignore what we may already have from nrfiles option.
1557 if (!td->files_index)
1560 while ((fname = get_next_str(&str)) != NULL) {
1563 add_file(td, fname, 0, 1);
1570 static int str_directory_cb(void *data, const char fio_unused *unused)
1572 struct thread_data *td = cb_data_to_td(data);
1574 char *dirname, *str, *p;
1580 p = str = strdup(td->o.directory);
1581 while ((dirname = get_next_str(&str)) != NULL) {
1582 if (lstat(dirname, &sb) < 0) {
1585 log_err("fio: %s is not a directory\n", dirname);
1586 td_verror(td, ret, "lstat");
1589 if (!S_ISDIR(sb.st_mode)) {
1590 log_err("fio: %s is not a directory\n", dirname);
1601 static int str_opendir_cb(void *data, const char fio_unused *str)
1603 struct thread_data *td = cb_data_to_td(data);
1608 if (!td->files_index)
1611 return add_dir_files(td, td->o.opendir);
1614 static int str_buffer_pattern_cb(void *data, const char *input)
1616 struct thread_data *td = cb_data_to_td(data);
1619 /* FIXME: for now buffer pattern does not support formats */
1620 ret = parse_and_fill_pattern_alloc(input, strlen(input),
1621 &td->o.buffer_pattern, NULL, NULL, NULL);
1626 td->o.buffer_pattern_bytes = ret;
1629 * If this job is doing any reading or has compression set,
1630 * ensure that we refill buffers for writes or we could be
1631 * invalidating the pattern through reads.
1633 if (!td->o.compress_percentage && !td_read(td))
1634 td->o.refill_buffers = 0;
1636 td->o.refill_buffers = 1;
1638 td->o.scramble_buffers = 0;
1639 td->o.zero_buffers = 0;
1644 static int str_buffer_compress_cb(void *data, unsigned long long *il)
1646 struct thread_data *td = cb_data_to_td(data);
1648 td->flags |= TD_F_COMPRESS;
1649 td->o.compress_percentage = *il;
1653 static int str_dedupe_cb(void *data, unsigned long long *il)
1655 struct thread_data *td = cb_data_to_td(data);
1657 td->flags |= TD_F_COMPRESS;
1658 td->o.dedupe_percentage = *il;
1659 td->o.refill_buffers = 1;
1663 static int str_verify_pattern_cb(void *data, const char *input)
1665 struct thread_data *td = cb_data_to_td(data);
1668 td->o.verify_fmt_sz = FIO_ARRAY_SIZE(td->o.verify_fmt);
1669 ret = parse_and_fill_pattern_alloc(input, strlen(input),
1670 &td->o.verify_pattern, fmt_desc, td->o.verify_fmt,
1671 &td->o.verify_fmt_sz);
1676 td->o.verify_pattern_bytes = ret;
1678 * VERIFY_* could already be set
1680 if (!fio_option_is_set(&td->o, verify))
1681 td->o.verify = VERIFY_PATTERN;
1686 static int str_gtod_reduce_cb(void *data, int *il)
1688 struct thread_data *td = cb_data_to_td(data);
1692 * Only modify options if gtod_reduce==1
1693 * Otherwise leave settings alone.
1696 td->o.disable_lat = 1;
1697 td->o.disable_clat = 1;
1698 td->o.disable_slat = 1;
1699 td->o.disable_bw = 1;
1700 td->o.clat_percentiles = 0;
1701 td->o.lat_percentiles = 0;
1702 td->o.slat_percentiles = 0;
1703 td->ts_cache_mask = 63;
1709 static int str_offset_cb(void *data, long long *__val)
1711 struct thread_data *td = cb_data_to_td(data);
1712 unsigned long long v = *__val;
1714 if (parse_is_percent(v)) {
1715 td->o.start_offset = 0;
1716 td->o.start_offset_percent = -1ULL - v;
1717 td->o.start_offset_nz = 0;
1718 dprint(FD_PARSE, "SET start_offset_percent %d\n",
1719 td->o.start_offset_percent);
1720 } else if (parse_is_zone(v)) {
1721 td->o.start_offset = 0;
1722 td->o.start_offset_percent = 0;
1723 td->o.start_offset_nz = v - ZONE_BASE_VAL;
1725 td->o.start_offset = v;
1730 static int str_offset_increment_cb(void *data, long long *__val)
1732 struct thread_data *td = cb_data_to_td(data);
1733 unsigned long long v = *__val;
1735 if (parse_is_percent(v)) {
1736 td->o.offset_increment = 0;
1737 td->o.offset_increment_percent = -1ULL - v;
1738 td->o.offset_increment_nz = 0;
1739 dprint(FD_PARSE, "SET offset_increment_percent %d\n",
1740 td->o.offset_increment_percent);
1741 } else if (parse_is_zone(v)) {
1742 td->o.offset_increment = 0;
1743 td->o.offset_increment_percent = 0;
1744 td->o.offset_increment_nz = v - ZONE_BASE_VAL;
1746 td->o.offset_increment = v;
1751 static int str_size_cb(void *data, long long *__val)
1753 struct thread_data *td = cb_data_to_td(data);
1754 unsigned long long v = *__val;
1756 if (parse_is_percent(v)) {
1758 td->o.size_percent = -1ULL - v;
1759 dprint(FD_PARSE, "SET size_percent %d\n",
1760 td->o.size_percent);
1761 } else if (parse_is_zone(v)) {
1763 td->o.size_percent = 0;
1764 td->o.size_nz = v - ZONE_BASE_VAL;
1771 static int str_io_size_cb(void *data, unsigned long long *__val)
1773 struct thread_data *td = cb_data_to_td(data);
1774 unsigned long long v = *__val;
1776 if (parse_is_percent_uncapped(v)) {
1778 td->o.io_size_percent = -1ULL - v;
1779 if (td->o.io_size_percent > 100) {
1780 log_err("fio: io_size values greater than 100%% aren't supported\n");
1783 dprint(FD_PARSE, "SET io_size_percent %d\n",
1784 td->o.io_size_percent);
1785 } else if (parse_is_zone(v)) {
1787 td->o.io_size_percent = 0;
1788 td->o.io_size_nz = v - ZONE_BASE_VAL;
1795 static int str_zoneskip_cb(void *data, long long *__val)
1797 struct thread_data *td = cb_data_to_td(data);
1798 unsigned long long v = *__val;
1800 if (parse_is_zone(v)) {
1801 td->o.zone_skip = 0;
1802 td->o.zone_skip_nz = v - ZONE_BASE_VAL;
1804 td->o.zone_skip = v;
1809 static int str_write_bw_log_cb(void *data, const char *str)
1811 struct thread_data *td = cb_data_to_td(data);
1814 td->o.bw_log_file = strdup(str);
1816 td->o.write_bw_log = 1;
1820 static int str_write_lat_log_cb(void *data, const char *str)
1822 struct thread_data *td = cb_data_to_td(data);
1825 td->o.lat_log_file = strdup(str);
1827 td->o.write_lat_log = 1;
1831 static int str_write_iops_log_cb(void *data, const char *str)
1833 struct thread_data *td = cb_data_to_td(data);
1836 td->o.iops_log_file = strdup(str);
1838 td->o.write_iops_log = 1;
1842 static int str_write_hist_log_cb(void *data, const char *str)
1844 struct thread_data *td = cb_data_to_td(data);
1847 td->o.hist_log_file = strdup(str);
1849 td->o.write_hist_log = 1;
1854 * str is supposed to be a substring of the strdup'd original string,
1855 * and is valid only if it's a regular file path.
1856 * This function keeps the pointer to the path as needed later.
1858 * "external:/path/to/so\0" <- original pointer updated with strdup'd
1859 * "external\0" <- above pointer after parsed, i.e. ->ioengine
1860 * "/path/to/so\0" <- str argument, i.e. ->ioengine_so_path
1862 static int str_ioengine_external_cb(void *data, const char *str)
1864 struct thread_data *td = cb_data_to_td(data);
1869 log_err("fio: null external ioengine path\n");
1873 p = (char *)str; /* str is mutable */
1874 strip_blank_front(&p);
1877 if (stat(p, &sb) || !S_ISREG(sb.st_mode)) {
1878 log_err("fio: invalid external ioengine path \"%s\"\n", p);
1882 td->o.ioengine_so_path = p;
1886 static int rw_verify(const struct fio_option *o, void *data)
1888 struct thread_data *td = cb_data_to_td(data);
1890 if (read_only && (td_write(td) || td_trim(td))) {
1891 log_err("fio: job <%s> has write or trim bit set, but"
1892 " fio is in read-only mode\n", td->o.name);
1899 static int gtod_cpu_verify(const struct fio_option *o, void *data)
1901 #ifndef FIO_HAVE_CPU_AFFINITY
1902 struct thread_data *td = cb_data_to_td(data);
1904 if (td->o.gtod_cpu) {
1905 log_err("fio: platform must support CPU affinity for"
1906 "gettimeofday() offloading\n");
1915 * Map of job/command line options
1917 struct fio_option fio_options[FIO_MAX_OPTS] = {
1919 .name = "description",
1920 .lname = "Description of job",
1921 .type = FIO_OPT_STR_STORE,
1922 .off1 = offsetof(struct thread_options, description),
1923 .help = "Text job description",
1924 .category = FIO_OPT_C_GENERAL,
1925 .group = FIO_OPT_G_DESC,
1929 .lname = "Job name",
1930 .type = FIO_OPT_STR_STORE,
1931 .off1 = offsetof(struct thread_options, name),
1932 .help = "Name of this job",
1933 .category = FIO_OPT_C_GENERAL,
1934 .group = FIO_OPT_G_DESC,
1938 .lname = "Waitee name",
1939 .type = FIO_OPT_STR_STORE,
1940 .off1 = offsetof(struct thread_options, wait_for),
1941 .help = "Name of the job this one wants to wait for before starting",
1942 .category = FIO_OPT_C_GENERAL,
1943 .group = FIO_OPT_G_DESC,
1947 .lname = "Filename(s)",
1948 .type = FIO_OPT_STR_STORE,
1949 .off1 = offsetof(struct thread_options, filename),
1951 .cb = str_filename_cb,
1952 .prio = -1, /* must come after "directory" */
1953 .help = "File(s) to use for the workload",
1954 .category = FIO_OPT_C_FILE,
1955 .group = FIO_OPT_G_FILENAME,
1958 .name = "directory",
1959 .lname = "Directory",
1960 .type = FIO_OPT_STR_STORE,
1961 .off1 = offsetof(struct thread_options, directory),
1962 .cb = str_directory_cb,
1963 .help = "Directory to store files in",
1964 .category = FIO_OPT_C_FILE,
1965 .group = FIO_OPT_G_FILENAME,
1968 .name = "filename_format",
1969 .lname = "Filename Format",
1970 .type = FIO_OPT_STR_STORE,
1971 .off1 = offsetof(struct thread_options, filename_format),
1972 .prio = -1, /* must come after "directory" */
1973 .help = "Override default $jobname.$jobnum.$filenum naming",
1974 .def = "$jobname.$jobnum.$filenum",
1975 .category = FIO_OPT_C_FILE,
1976 .group = FIO_OPT_G_FILENAME,
1979 .name = "unique_filename",
1980 .lname = "Unique Filename",
1981 .type = FIO_OPT_BOOL,
1982 .off1 = offsetof(struct thread_options, unique_filename),
1983 .help = "For network clients, prefix file with source IP",
1985 .category = FIO_OPT_C_FILE,
1986 .group = FIO_OPT_G_FILENAME,
1990 .lname = "Lockfile",
1991 .type = FIO_OPT_STR,
1992 .off1 = offsetof(struct thread_options, file_lock_mode),
1993 .help = "Lock file when doing IO to it",
1995 .parent = "filename",
1998 .category = FIO_OPT_C_FILE,
1999 .group = FIO_OPT_G_FILENAME,
2002 .oval = FILE_LOCK_NONE,
2003 .help = "No file locking",
2005 { .ival = "exclusive",
2006 .oval = FILE_LOCK_EXCLUSIVE,
2007 .help = "Exclusive file lock",
2010 .ival = "readwrite",
2011 .oval = FILE_LOCK_READWRITE,
2012 .help = "Read vs write lock",
2018 .lname = "Open directory",
2019 .type = FIO_OPT_STR_STORE,
2020 .off1 = offsetof(struct thread_options, opendir),
2021 .cb = str_opendir_cb,
2022 .help = "Recursively add files from this directory and down",
2023 .category = FIO_OPT_C_FILE,
2024 .group = FIO_OPT_G_FILENAME,
2028 .lname = "Read/write",
2029 .alias = "readwrite",
2030 .type = FIO_OPT_STR,
2032 .off1 = offsetof(struct thread_options, td_ddir),
2033 .help = "IO direction",
2035 .verify = rw_verify,
2036 .category = FIO_OPT_C_IO,
2037 .group = FIO_OPT_G_IO_BASIC,
2040 .oval = TD_DDIR_READ,
2041 .help = "Sequential read",
2044 .oval = TD_DDIR_WRITE,
2045 .help = "Sequential write",
2048 .oval = TD_DDIR_TRIM,
2049 .help = "Sequential trim",
2051 { .ival = "randread",
2052 .oval = TD_DDIR_RANDREAD,
2053 .help = "Random read",
2055 { .ival = "randwrite",
2056 .oval = TD_DDIR_RANDWRITE,
2057 .help = "Random write",
2059 { .ival = "randtrim",
2060 .oval = TD_DDIR_RANDTRIM,
2061 .help = "Random trim",
2065 .help = "Sequential read and write mix",
2067 { .ival = "readwrite",
2069 .help = "Sequential read and write mix",
2072 .oval = TD_DDIR_RANDRW,
2073 .help = "Random read and write mix"
2075 { .ival = "trimwrite",
2076 .oval = TD_DDIR_TRIMWRITE,
2077 .help = "Trim and write mix, trims preceding writes"
2079 { .ival = "randtrimwrite",
2080 .oval = TD_DDIR_RANDTRIMWRITE,
2081 .help = "Randomly trim and write mix, trims preceding writes"
2086 .name = "rw_sequencer",
2087 .lname = "RW Sequencer",
2088 .type = FIO_OPT_STR,
2089 .off1 = offsetof(struct thread_options, rw_seq),
2090 .help = "IO offset generator modifier",
2091 .def = "sequential",
2092 .category = FIO_OPT_C_IO,
2093 .group = FIO_OPT_G_IO_BASIC,
2095 { .ival = "sequential",
2097 .help = "Generate sequential offsets",
2099 { .ival = "identical",
2100 .oval = RW_SEQ_IDENT,
2101 .help = "Generate identical offsets",
2108 .lname = "IO Engine",
2109 .type = FIO_OPT_STR_STORE,
2110 .off1 = offsetof(struct thread_options, ioengine),
2111 .help = "IO engine to use",
2112 .def = FIO_PREFERRED_ENGINE,
2113 .category = FIO_OPT_C_IO,
2114 .group = FIO_OPT_G_IO_BASIC,
2117 .help = "Use read/write",
2120 .help = "Use pread/pwrite",
2123 .help = "Use readv/writev",
2125 #ifdef CONFIG_PWRITEV
2127 .help = "Use preadv/pwritev",
2130 #ifdef FIO_HAVE_PWRITEV2
2131 { .ival = "pvsync2",
2132 .help = "Use preadv2/pwritev2",
2135 #ifdef CONFIG_LIBAIO
2137 .help = "Linux native asynchronous IO",
2140 #ifdef ARCH_HAVE_IOURING
2141 { .ival = "io_uring",
2142 .help = "Fast Linux native aio",
2145 #ifdef CONFIG_POSIXAIO
2146 { .ival = "posixaio",
2147 .help = "POSIX asynchronous IO",
2150 #ifdef CONFIG_SOLARISAIO
2151 { .ival = "solarisaio",
2152 .help = "Solaris native asynchronous IO",
2155 #ifdef CONFIG_WINDOWSAIO
2156 { .ival = "windowsaio",
2157 .help = "Windows native asynchronous IO"
2162 .help = "Rados Block Device asynchronous IO"
2166 .help = "Memory mapped IO"
2168 #ifdef CONFIG_LINUX_SPLICE
2170 .help = "splice/vmsplice based IO",
2172 { .ival = "netsplice",
2173 .help = "splice/vmsplice to/from the network",
2176 #ifdef FIO_HAVE_SGIO
2178 .help = "SCSI generic v3 IO",
2182 .help = "Testing engine (no data transfer)",
2185 .help = "Network IO",
2188 .help = "CPU cycle burner engine",
2192 .help = "RDMA IO engine",
2195 #ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
2196 { .ival = "e4defrag",
2197 .help = "ext4 defrag engine",
2200 #ifdef CONFIG_LINUX_FALLOCATE
2202 .help = "fallocate() file based engine",
2207 .help = "Glusterfs libgfapi(sync) based engine"
2209 { .ival = "gfapi_async",
2210 .help = "Glusterfs libgfapi(async) based engine"
2213 #ifdef CONFIG_LIBHDFS
2214 { .ival = "libhdfs",
2215 .help = "Hadoop Distributed Filesystem (HDFS) engine"
2219 { .ival = "ime_psync",
2220 .help = "DDN's IME synchronous IO engine",
2222 { .ival = "ime_psyncv",
2223 .help = "DDN's IME synchronous IO engine using iovecs",
2225 { .ival = "ime_aio",
2226 .help = "DDN's IME asynchronous IO engine",
2229 #ifdef CONFIG_LINUX_DEVDAX
2230 { .ival = "dev-dax",
2231 .help = "DAX Device based IO engine",
2235 .ival = "filecreate",
2236 .help = "File creation engine",
2238 { .ival = "external",
2239 .help = "Load external engine (append name)",
2240 .cb = str_ioengine_external_cb,
2242 #ifdef CONFIG_LIBPMEM
2243 { .ival = "libpmem",
2244 .help = "PMDK libpmem based IO engine",
2249 .help = "HTTP (WebDAV/S3) IO engine",
2253 .help = "Network Block Device (NBD) IO engine"
2257 .help = "DAOS File System (dfs) IO engine",
2260 #ifdef CONFIG_LIBNFS
2262 .help = "NFS IO engine",
2265 #ifdef CONFIG_LIBXNVME
2267 .help = "XNVME IO engine",
2274 .lname = "IO Depth",
2275 .type = FIO_OPT_INT,
2276 .off1 = offsetof(struct thread_options, iodepth),
2277 .help = "Number of IO buffers to keep in flight",
2281 .category = FIO_OPT_C_IO,
2282 .group = FIO_OPT_G_IO_BASIC,
2285 .name = "iodepth_batch",
2286 .lname = "IO Depth batch",
2287 .alias = "iodepth_batch_submit",
2288 .type = FIO_OPT_INT,
2289 .off1 = offsetof(struct thread_options, iodepth_batch),
2290 .help = "Number of IO buffers to submit in one go",
2291 .parent = "iodepth",
2295 .category = FIO_OPT_C_IO,
2296 .group = FIO_OPT_G_IO_BASIC,
2299 .name = "iodepth_batch_complete_min",
2300 .lname = "Min IO depth batch complete",
2301 .alias = "iodepth_batch_complete",
2302 .type = FIO_OPT_INT,
2303 .off1 = offsetof(struct thread_options, iodepth_batch_complete_min),
2304 .help = "Min number of IO buffers to retrieve in one go",
2305 .parent = "iodepth",
2310 .category = FIO_OPT_C_IO,
2311 .group = FIO_OPT_G_IO_BASIC,
2314 .name = "iodepth_batch_complete_max",
2315 .lname = "Max IO depth batch complete",
2316 .type = FIO_OPT_INT,
2317 .off1 = offsetof(struct thread_options, iodepth_batch_complete_max),
2318 .help = "Max number of IO buffers to retrieve in one go",
2319 .parent = "iodepth",
2323 .category = FIO_OPT_C_IO,
2324 .group = FIO_OPT_G_IO_BASIC,
2327 .name = "iodepth_low",
2328 .lname = "IO Depth batch low",
2329 .type = FIO_OPT_INT,
2330 .off1 = offsetof(struct thread_options, iodepth_low),
2331 .help = "Low water mark for queuing depth",
2332 .parent = "iodepth",
2335 .category = FIO_OPT_C_IO,
2336 .group = FIO_OPT_G_IO_BASIC,
2339 .name = "serialize_overlap",
2340 .lname = "Serialize overlap",
2341 .off1 = offsetof(struct thread_options, serialize_overlap),
2342 .type = FIO_OPT_BOOL,
2343 .help = "Wait for in-flight IOs that collide to complete",
2344 .parent = "iodepth",
2346 .category = FIO_OPT_C_IO,
2347 .group = FIO_OPT_G_IO_BASIC,
2350 .name = "io_submit_mode",
2351 .lname = "IO submit mode",
2352 .type = FIO_OPT_STR,
2353 .off1 = offsetof(struct thread_options, io_submit_mode),
2354 .help = "How IO submissions and completions are done",
2356 .category = FIO_OPT_C_IO,
2357 .group = FIO_OPT_G_IO_BASIC,
2360 .oval = IO_MODE_INLINE,
2361 .help = "Submit and complete IO inline",
2363 { .ival = "offload",
2364 .oval = IO_MODE_OFFLOAD,
2365 .help = "Offload submit and complete to threads",
2372 .type = FIO_OPT_STR_VAL_ZONE,
2374 .off1 = offsetof(struct thread_options, size),
2375 .help = "Total size of device or files",
2376 .category = FIO_OPT_C_IO,
2377 .group = FIO_OPT_G_INVALID,
2381 .alias = "io_limit",
2383 .type = FIO_OPT_STR_VAL_ZONE,
2384 .cb = str_io_size_cb,
2385 .off1 = offsetof(struct thread_options, io_size),
2386 .help = "Total size of I/O to be performed",
2387 .category = FIO_OPT_C_IO,
2388 .group = FIO_OPT_G_INVALID,
2391 .name = "fill_device",
2392 .lname = "Fill device",
2394 .type = FIO_OPT_BOOL,
2395 .off1 = offsetof(struct thread_options, fill_device),
2396 .help = "Write until an ENOSPC error occurs",
2398 .category = FIO_OPT_C_FILE,
2399 .group = FIO_OPT_G_INVALID,
2403 .lname = "File size",
2404 .type = FIO_OPT_STR_VAL,
2405 .off1 = offsetof(struct thread_options, file_size_low),
2406 .off2 = offsetof(struct thread_options, file_size_high),
2408 .help = "Size of individual files",
2409 .interval = 1024 * 1024,
2410 .category = FIO_OPT_C_FILE,
2411 .group = FIO_OPT_G_INVALID,
2414 .name = "file_append",
2415 .lname = "File append",
2416 .type = FIO_OPT_BOOL,
2417 .off1 = offsetof(struct thread_options, file_append),
2418 .help = "IO will start at the end of the file(s)",
2420 .category = FIO_OPT_C_FILE,
2421 .group = FIO_OPT_G_INVALID,
2425 .lname = "IO offset",
2426 .alias = "fileoffset",
2427 .type = FIO_OPT_STR_VAL_ZONE,
2428 .cb = str_offset_cb,
2429 .off1 = offsetof(struct thread_options, start_offset),
2430 .help = "Start IO from this offset",
2432 .category = FIO_OPT_C_IO,
2433 .group = FIO_OPT_G_INVALID,
2436 .name = "offset_align",
2437 .lname = "IO offset alignment",
2438 .type = FIO_OPT_INT,
2439 .off1 = offsetof(struct thread_options, start_offset_align),
2440 .help = "Start IO from this offset alignment",
2443 .category = FIO_OPT_C_IO,
2444 .group = FIO_OPT_G_INVALID,
2447 .name = "offset_increment",
2448 .lname = "IO offset increment",
2449 .type = FIO_OPT_STR_VAL_ZONE,
2450 .cb = str_offset_increment_cb,
2451 .off1 = offsetof(struct thread_options, offset_increment),
2452 .help = "What is the increment from one offset to the next",
2456 .category = FIO_OPT_C_IO,
2457 .group = FIO_OPT_G_INVALID,
2460 .name = "number_ios",
2461 .lname = "Number of IOs to perform",
2462 .type = FIO_OPT_STR_VAL,
2463 .off1 = offsetof(struct thread_options, number_ios),
2464 .help = "Force job completion after this number of IOs",
2466 .category = FIO_OPT_C_IO,
2467 .group = FIO_OPT_G_INVALID,
2470 .name = "num_range",
2471 .lname = "Number of ranges",
2472 .type = FIO_OPT_INT,
2473 .off1 = offsetof(struct thread_options, num_range),
2474 .maxval = MAX_TRIM_RANGE,
2475 .help = "Number of ranges for trim command",
2477 .category = FIO_OPT_C_IO,
2478 .group = FIO_OPT_G_INVALID,
2482 .lname = "Block size",
2483 .alias = "blocksize",
2484 .type = FIO_OPT_ULL,
2485 .off1 = offsetof(struct thread_options, bs[DDIR_READ]),
2486 .off2 = offsetof(struct thread_options, bs[DDIR_WRITE]),
2487 .off3 = offsetof(struct thread_options, bs[DDIR_TRIM]),
2489 .help = "Block size unit",
2494 .category = FIO_OPT_C_IO,
2495 .group = FIO_OPT_G_INVALID,
2499 .lname = "Block size align",
2500 .alias = "blockalign",
2501 .type = FIO_OPT_ULL,
2502 .off1 = offsetof(struct thread_options, ba[DDIR_READ]),
2503 .off2 = offsetof(struct thread_options, ba[DDIR_WRITE]),
2504 .off3 = offsetof(struct thread_options, ba[DDIR_TRIM]),
2506 .help = "IO block offset alignment",
2510 .category = FIO_OPT_C_IO,
2511 .group = FIO_OPT_G_INVALID,
2515 .lname = "Block size range",
2516 .alias = "blocksize_range",
2517 .type = FIO_OPT_RANGE,
2518 .off1 = offsetof(struct thread_options, min_bs[DDIR_READ]),
2519 .off2 = offsetof(struct thread_options, max_bs[DDIR_READ]),
2520 .off3 = offsetof(struct thread_options, min_bs[DDIR_WRITE]),
2521 .off4 = offsetof(struct thread_options, max_bs[DDIR_WRITE]),
2522 .off5 = offsetof(struct thread_options, min_bs[DDIR_TRIM]),
2523 .off6 = offsetof(struct thread_options, max_bs[DDIR_TRIM]),
2525 .help = "Set block size range (in more detail than bs)",
2529 .category = FIO_OPT_C_IO,
2530 .group = FIO_OPT_G_INVALID,
2534 .lname = "Block size split",
2535 .type = FIO_OPT_STR_ULL,
2536 .cb = str_bssplit_cb,
2537 .off1 = offsetof(struct thread_options, bssplit),
2538 .help = "Set a specific mix of block sizes",
2541 .category = FIO_OPT_C_IO,
2542 .group = FIO_OPT_G_INVALID,
2545 .name = "bs_unaligned",
2546 .lname = "Block size unaligned",
2547 .alias = "blocksize_unaligned",
2548 .type = FIO_OPT_STR_SET,
2549 .off1 = offsetof(struct thread_options, bs_unaligned),
2550 .help = "Don't sector align IO buffer sizes",
2553 .category = FIO_OPT_C_IO,
2554 .group = FIO_OPT_G_INVALID,
2557 .name = "bs_is_seq_rand",
2558 .lname = "Block size division is seq/random (not read/write)",
2559 .type = FIO_OPT_BOOL,
2560 .off1 = offsetof(struct thread_options, bs_is_seq_rand),
2561 .help = "Consider any blocksize setting to be sequential,random",
2563 .parent = "blocksize",
2564 .category = FIO_OPT_C_IO,
2565 .group = FIO_OPT_G_INVALID,
2568 .name = "randrepeat",
2569 .alias = "allrandrepeat",
2570 .lname = "Random repeatable",
2571 .type = FIO_OPT_BOOL,
2572 .off1 = offsetof(struct thread_options, rand_repeatable),
2573 .help = "Use repeatable random IO pattern",
2577 .category = FIO_OPT_C_IO,
2578 .group = FIO_OPT_G_RANDOM,
2582 .lname = "The random generator seed",
2583 .type = FIO_OPT_STR_VAL,
2584 .off1 = offsetof(struct thread_options, rand_seed),
2585 .help = "Set the random generator seed value",
2588 .category = FIO_OPT_C_IO,
2589 .group = FIO_OPT_G_RANDOM,
2592 .name = "norandommap",
2593 .lname = "No randommap",
2594 .type = FIO_OPT_STR_SET,
2595 .off1 = offsetof(struct thread_options, norandommap),
2596 .help = "Accept potential duplicate random blocks",
2600 .category = FIO_OPT_C_IO,
2601 .group = FIO_OPT_G_RANDOM,
2604 .name = "softrandommap",
2605 .lname = "Soft randommap",
2606 .type = FIO_OPT_BOOL,
2607 .off1 = offsetof(struct thread_options, softrandommap),
2608 .help = "Set norandommap if randommap allocation fails",
2609 .parent = "norandommap",
2612 .category = FIO_OPT_C_IO,
2613 .group = FIO_OPT_G_RANDOM,
2616 .name = "random_generator",
2617 .lname = "Random Generator",
2618 .type = FIO_OPT_STR,
2619 .off1 = offsetof(struct thread_options, random_generator),
2620 .help = "Type of random number generator to use",
2621 .def = "tausworthe",
2623 { .ival = "tausworthe",
2624 .oval = FIO_RAND_GEN_TAUSWORTHE,
2625 .help = "Strong Tausworthe generator",
2628 .oval = FIO_RAND_GEN_LFSR,
2629 .help = "Variable length LFSR",
2632 .ival = "tausworthe64",
2633 .oval = FIO_RAND_GEN_TAUSWORTHE64,
2634 .help = "64-bit Tausworthe variant",
2637 .category = FIO_OPT_C_IO,
2638 .group = FIO_OPT_G_RANDOM,
2641 .name = "random_distribution",
2642 .lname = "Random Distribution",
2643 .type = FIO_OPT_STR,
2644 .off1 = offsetof(struct thread_options, random_distribution),
2645 .cb = str_random_distribution_cb,
2646 .help = "Random offset distribution generator",
2650 .oval = FIO_RAND_DIST_RANDOM,
2651 .help = "Completely random",
2654 .oval = FIO_RAND_DIST_ZIPF,
2655 .help = "Zipf distribution",
2658 .oval = FIO_RAND_DIST_PARETO,
2659 .help = "Pareto distribution",
2662 .oval = FIO_RAND_DIST_GAUSS,
2663 .help = "Normal (Gaussian) distribution",
2666 .oval = FIO_RAND_DIST_ZONED,
2667 .help = "Zoned random distribution",
2669 { .ival = "zoned_abs",
2670 .oval = FIO_RAND_DIST_ZONED_ABS,
2671 .help = "Zoned absolute random distribution",
2674 .category = FIO_OPT_C_IO,
2675 .group = FIO_OPT_G_RANDOM,
2678 .name = "percentage_random",
2679 .lname = "Percentage Random",
2680 .type = FIO_OPT_INT,
2681 .off1 = offsetof(struct thread_options, perc_rand[DDIR_READ]),
2682 .off2 = offsetof(struct thread_options, perc_rand[DDIR_WRITE]),
2683 .off3 = offsetof(struct thread_options, perc_rand[DDIR_TRIM]),
2685 .help = "Percentage of seq/random mix that should be random",
2686 .def = "100,100,100",
2688 .inverse = "percentage_sequential",
2689 .category = FIO_OPT_C_IO,
2690 .group = FIO_OPT_G_RANDOM,
2693 .name = "percentage_sequential",
2694 .lname = "Percentage Sequential",
2695 .type = FIO_OPT_DEPRECATED,
2696 .category = FIO_OPT_C_IO,
2697 .group = FIO_OPT_G_RANDOM,
2701 .lname = "Number of files",
2702 .alias = "nr_files",
2703 .type = FIO_OPT_INT,
2704 .off1 = offsetof(struct thread_options, nr_files),
2705 .help = "Split job workload between this number of files",
2708 .category = FIO_OPT_C_FILE,
2709 .group = FIO_OPT_G_INVALID,
2712 .name = "openfiles",
2713 .lname = "Number of open files",
2714 .type = FIO_OPT_INT,
2715 .off1 = offsetof(struct thread_options, open_files),
2716 .help = "Number of files to keep open at the same time",
2717 .category = FIO_OPT_C_FILE,
2718 .group = FIO_OPT_G_INVALID,
2721 .name = "file_service_type",
2722 .lname = "File service type",
2723 .type = FIO_OPT_STR,
2725 .off1 = offsetof(struct thread_options, file_service_type),
2726 .help = "How to select which file to service next",
2727 .def = "roundrobin",
2728 .category = FIO_OPT_C_FILE,
2729 .group = FIO_OPT_G_INVALID,
2732 .oval = FIO_FSERVICE_RANDOM,
2733 .help = "Choose a file at random (uniform)",
2736 .oval = FIO_FSERVICE_ZIPF,
2737 .help = "Zipf randomized",
2740 .oval = FIO_FSERVICE_PARETO,
2741 .help = "Pareto randomized",
2744 .oval = FIO_FSERVICE_GAUSS,
2745 .help = "Normal (Gaussian) randomized",
2748 .oval = FIO_FSERVICE_GAUSS,
2749 .help = "Alias for normal",
2751 { .ival = "roundrobin",
2752 .oval = FIO_FSERVICE_RR,
2753 .help = "Round robin select files",
2755 { .ival = "sequential",
2756 .oval = FIO_FSERVICE_SEQ,
2757 .help = "Finish one file before moving to the next",
2760 .parent = "nrfiles",
2764 .name = "fallocate",
2765 .lname = "Fallocate",
2766 .type = FIO_OPT_STR,
2767 .off1 = offsetof(struct thread_options, fallocate_mode),
2768 .help = "Whether pre-allocation is performed when laying out files",
2769 #ifdef FIO_HAVE_DEFAULT_FALLOCATE
2774 .category = FIO_OPT_C_FILE,
2775 .group = FIO_OPT_G_INVALID,
2778 .oval = FIO_FALLOCATE_NONE,
2779 .help = "Do not pre-allocate space",
2782 .oval = FIO_FALLOCATE_NATIVE,
2783 .help = "Use native pre-allocation if possible",
2785 #ifdef CONFIG_POSIX_FALLOCATE
2787 .oval = FIO_FALLOCATE_POSIX,
2788 .help = "Use posix_fallocate()",
2791 #ifdef CONFIG_LINUX_FALLOCATE
2793 .oval = FIO_FALLOCATE_KEEP_SIZE,
2794 .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)",
2797 { .ival = "truncate",
2798 .oval = FIO_FALLOCATE_TRUNCATE,
2799 .help = "Truncate file to final size instead of allocating"
2801 /* Compatibility with former boolean values */
2803 .oval = FIO_FALLOCATE_NONE,
2804 .help = "Alias for 'none'",
2806 #ifdef CONFIG_POSIX_FALLOCATE
2808 .oval = FIO_FALLOCATE_POSIX,
2809 .help = "Alias for 'posix'",
2815 .name = "fadvise_hint",
2816 .lname = "Fadvise hint",
2817 .type = FIO_OPT_STR,
2818 .off1 = offsetof(struct thread_options, fadvise_hint),
2822 .help = "Don't issue fadvise/madvise",
2826 .help = "Advise using fio IO pattern",
2829 .oval = F_ADV_RANDOM,
2830 .help = "Advise using FADV_RANDOM",
2832 { .ival = "sequential",
2833 .oval = F_ADV_SEQUENTIAL,
2834 .help = "Advise using FADV_SEQUENTIAL",
2836 #ifdef POSIX_FADV_NOREUSE
2837 { .ival = "noreuse",
2838 .oval = F_ADV_NOREUSE,
2839 .help = "Advise using FADV_NOREUSE",
2843 .help = "Use fadvise() to advise the kernel on IO pattern",
2845 .category = FIO_OPT_C_FILE,
2846 .group = FIO_OPT_G_INVALID,
2851 .type = FIO_OPT_INT,
2852 .off1 = offsetof(struct thread_options, fsync_blocks),
2853 .help = "Issue fsync for writes every given number of blocks",
2856 .category = FIO_OPT_C_FILE,
2857 .group = FIO_OPT_G_INVALID,
2860 .name = "fdatasync",
2861 .lname = "Fdatasync",
2862 .type = FIO_OPT_INT,
2863 .off1 = offsetof(struct thread_options, fdatasync_blocks),
2864 .help = "Issue fdatasync for writes every given number of blocks",
2867 .category = FIO_OPT_C_FILE,
2868 .group = FIO_OPT_G_INVALID,
2871 .name = "write_barrier",
2872 .lname = "Write barrier",
2873 .type = FIO_OPT_INT,
2874 .off1 = offsetof(struct thread_options, barrier_blocks),
2875 .help = "Make every Nth write a barrier write",
2878 .category = FIO_OPT_C_IO,
2879 .group = FIO_OPT_G_INVALID,
2881 #ifdef CONFIG_SYNC_FILE_RANGE
2883 .name = "sync_file_range",
2884 .lname = "Sync file range",
2886 { .ival = "wait_before",
2887 .oval = SYNC_FILE_RANGE_WAIT_BEFORE,
2888 .help = "SYNC_FILE_RANGE_WAIT_BEFORE",
2892 .oval = SYNC_FILE_RANGE_WRITE,
2893 .help = "SYNC_FILE_RANGE_WRITE",
2897 .ival = "wait_after",
2898 .oval = SYNC_FILE_RANGE_WAIT_AFTER,
2899 .help = "SYNC_FILE_RANGE_WAIT_AFTER",
2903 .type = FIO_OPT_STR_MULTI,
2905 .off1 = offsetof(struct thread_options, sync_file_range),
2906 .help = "Use sync_file_range()",
2907 .category = FIO_OPT_C_FILE,
2908 .group = FIO_OPT_G_INVALID,
2912 .name = "sync_file_range",
2913 .lname = "Sync file range",
2914 .type = FIO_OPT_UNSUPPORTED,
2915 .help = "Your platform does not support sync_file_range",
2920 .lname = "Direct I/O",
2921 .type = FIO_OPT_BOOL,
2922 .off1 = offsetof(struct thread_options, odirect),
2923 .help = "Use O_DIRECT IO (negates buffered)",
2925 .inverse = "buffered",
2926 .category = FIO_OPT_C_IO,
2927 .group = FIO_OPT_G_IO_TYPE,
2929 #ifdef FIO_HAVE_RWF_ATOMIC
2932 .lname = "Atomic I/O",
2933 .type = FIO_OPT_BOOL,
2934 .off1 = offsetof(struct thread_options, oatomic),
2935 .help = "Use Atomic IO with O_DIRECT (implies O_DIRECT)",
2937 .category = FIO_OPT_C_IO,
2938 .group = FIO_OPT_G_IO_TYPE,
2943 .lname = "Buffered I/O",
2944 .type = FIO_OPT_BOOL,
2945 .off1 = offsetof(struct thread_options, odirect),
2947 .help = "Use buffered IO (negates direct)",
2949 .inverse = "direct",
2950 .category = FIO_OPT_C_IO,
2951 .group = FIO_OPT_G_IO_TYPE,
2954 .name = "overwrite",
2955 .lname = "Overwrite",
2956 .type = FIO_OPT_BOOL,
2957 .off1 = offsetof(struct thread_options, overwrite),
2958 .help = "When writing, set whether to overwrite current data",
2960 .category = FIO_OPT_C_FILE,
2961 .group = FIO_OPT_G_INVALID,
2966 .type = FIO_OPT_INT,
2967 .off1 = offsetof(struct thread_options, loops),
2968 .help = "Number of times to run the job",
2971 .category = FIO_OPT_C_GENERAL,
2972 .group = FIO_OPT_G_RUNTIME,
2976 .lname = "Number of jobs",
2977 .type = FIO_OPT_INT,
2978 .off1 = offsetof(struct thread_options, numjobs),
2979 .help = "Duplicate this job this many times",
2982 .category = FIO_OPT_C_GENERAL,
2983 .group = FIO_OPT_G_RUNTIME,
2986 .name = "startdelay",
2987 .lname = "Start delay",
2988 .type = FIO_OPT_STR_VAL_TIME,
2989 .off1 = offsetof(struct thread_options, start_delay),
2990 .off2 = offsetof(struct thread_options, start_delay_high),
2991 .help = "Only start job when this period has passed",
2995 .category = FIO_OPT_C_GENERAL,
2996 .group = FIO_OPT_G_RUNTIME,
3002 .type = FIO_OPT_STR_VAL_TIME,
3003 .off1 = offsetof(struct thread_options, timeout),
3004 .help = "Stop workload when this amount of time has passed",
3008 .category = FIO_OPT_C_GENERAL,
3009 .group = FIO_OPT_G_RUNTIME,
3012 .name = "time_based",
3013 .lname = "Time based",
3014 .type = FIO_OPT_STR_SET,
3015 .off1 = offsetof(struct thread_options, time_based),
3016 .help = "Keep running until runtime/timeout is met",
3017 .category = FIO_OPT_C_GENERAL,
3018 .group = FIO_OPT_G_RUNTIME,
3021 .name = "verify_only",
3022 .lname = "Verify only",
3023 .type = FIO_OPT_STR_SET,
3024 .off1 = offsetof(struct thread_options, verify_only),
3025 .help = "Verifies previously written data is still valid",
3026 .category = FIO_OPT_C_GENERAL,
3027 .group = FIO_OPT_G_RUNTIME,
3030 .name = "ramp_time",
3031 .lname = "Ramp time",
3032 .type = FIO_OPT_STR_VAL_TIME,
3033 .off1 = offsetof(struct thread_options, ramp_time),
3034 .help = "Ramp up time before measuring performance",
3037 .category = FIO_OPT_C_GENERAL,
3038 .group = FIO_OPT_G_RUNTIME,
3041 .name = "clocksource",
3042 .lname = "Clock source",
3043 .type = FIO_OPT_STR,
3044 .cb = fio_clock_source_cb,
3045 .off1 = offsetof(struct thread_options, clocksource),
3046 .help = "What type of timing source to use",
3047 .category = FIO_OPT_C_GENERAL,
3048 .group = FIO_OPT_G_CLOCK,
3050 #ifdef CONFIG_GETTIMEOFDAY
3051 { .ival = "gettimeofday",
3053 .help = "Use gettimeofday(2) for timing",
3056 #ifdef CONFIG_CLOCK_GETTIME
3057 { .ival = "clock_gettime",
3058 .oval = CS_CGETTIME,
3059 .help = "Use clock_gettime(2) for timing",
3062 #ifdef ARCH_HAVE_CPU_CLOCK
3064 .oval = CS_CPUCLOCK,
3065 .help = "Use CPU private clock",
3073 .lname = "I/O Memory",
3074 .type = FIO_OPT_STR,
3076 .off1 = offsetof(struct thread_options, mem_type),
3077 .help = "Backing type for IO buffers",
3079 .category = FIO_OPT_C_IO,
3080 .group = FIO_OPT_G_INVALID,
3084 .help = "Use malloc(3) for IO buffers",
3086 #ifndef CONFIG_NO_SHM
3089 .help = "Use shared memory segments for IO buffers",
3091 #ifdef FIO_HAVE_HUGETLB
3092 { .ival = "shmhuge",
3093 .oval = MEM_SHMHUGE,
3094 .help = "Like shm, but use huge pages",
3100 .help = "Use mmap(2) (file or anon) for IO buffers",
3102 { .ival = "mmapshared",
3103 .oval = MEM_MMAPSHARED,
3104 .help = "Like mmap, but use the shared flag",
3106 #ifdef FIO_HAVE_HUGETLB
3107 { .ival = "mmaphuge",
3108 .oval = MEM_MMAPHUGE,
3109 .help = "Like mmap, but use huge pages",
3113 { .ival = "cudamalloc",
3114 .oval = MEM_CUDA_MALLOC,
3115 .help = "Allocate GPU device memory for GPUDirect RDMA",
3121 .name = "iomem_align",
3122 .alias = "mem_align",
3123 .lname = "I/O memory alignment",
3124 .type = FIO_OPT_INT,
3125 .off1 = offsetof(struct thread_options, mem_align),
3127 .help = "IO memory buffer offset alignment",
3131 .category = FIO_OPT_C_IO,
3132 .group = FIO_OPT_G_INVALID,
3137 .type = FIO_OPT_STR,
3138 .off1 = offsetof(struct thread_options, verify),
3139 .help = "Verify data written",
3141 .category = FIO_OPT_C_IO,
3142 .group = FIO_OPT_G_VERIFY,
3145 .oval = VERIFY_NONE,
3146 .help = "Don't do IO verification",
3150 .help = "Use md5 checksums for verification",
3153 .oval = VERIFY_CRC64,
3154 .help = "Use crc64 checksums for verification",
3157 .oval = VERIFY_CRC32,
3158 .help = "Use crc32 checksums for verification",
3160 { .ival = "crc32c-intel",
3161 .oval = VERIFY_CRC32C,
3162 .help = "Use crc32c checksums for verification (hw assisted, if available)",
3165 .oval = VERIFY_CRC32C,
3166 .help = "Use crc32c checksums for verification (hw assisted, if available)",
3169 .oval = VERIFY_CRC16,
3170 .help = "Use crc16 checksums for verification",
3173 .oval = VERIFY_CRC7,
3174 .help = "Use crc7 checksums for verification",
3177 .oval = VERIFY_SHA1,
3178 .help = "Use sha1 checksums for verification",
3181 .oval = VERIFY_SHA256,
3182 .help = "Use sha256 checksums for verification",
3185 .oval = VERIFY_SHA512,
3186 .help = "Use sha512 checksums for verification",
3188 { .ival = "sha3-224",
3189 .oval = VERIFY_SHA3_224,
3190 .help = "Use sha3-224 checksums for verification",
3192 { .ival = "sha3-256",
3193 .oval = VERIFY_SHA3_256,
3194 .help = "Use sha3-256 checksums for verification",
3196 { .ival = "sha3-384",
3197 .oval = VERIFY_SHA3_384,
3198 .help = "Use sha3-384 checksums for verification",
3200 { .ival = "sha3-512",
3201 .oval = VERIFY_SHA3_512,
3202 .help = "Use sha3-512 checksums for verification",
3205 .oval = VERIFY_XXHASH,
3206 .help = "Use xxhash checksums for verification",
3208 /* Meta information was included into verify_header,
3209 * 'meta' verification is implied by default. */
3211 .oval = VERIFY_HDR_ONLY,
3212 .help = "Use io information for verification. "
3213 "Now is implied by default, thus option is obsolete, "
3216 { .ival = "pattern",
3217 .oval = VERIFY_PATTERN_NO_HDR,
3218 .help = "Verify strict pattern",
3220 { .ival = "pattern_hdr",
3221 .oval = VERIFY_PATTERN,
3222 .help = "Verify pattern with header",
3226 .oval = VERIFY_NULL,
3227 .help = "Pretend to verify",
3232 .name = "do_verify",
3233 .lname = "Perform verify step",
3234 .type = FIO_OPT_BOOL,
3235 .off1 = offsetof(struct thread_options, do_verify),
3236 .help = "Run verification stage after write",
3240 .category = FIO_OPT_C_IO,
3241 .group = FIO_OPT_G_VERIFY,
3244 .name = "verifysort",
3245 .lname = "Verify sort",
3246 .type = FIO_OPT_SOFT_DEPRECATED,
3247 .category = FIO_OPT_C_IO,
3248 .group = FIO_OPT_G_VERIFY,
3251 .name = "verifysort_nr",
3252 .lname = "Verify Sort Nr",
3253 .type = FIO_OPT_SOFT_DEPRECATED,
3254 .category = FIO_OPT_C_IO,
3255 .group = FIO_OPT_G_VERIFY,
3258 .name = "verify_interval",
3259 .lname = "Verify interval",
3260 .type = FIO_OPT_INT,
3261 .off1 = offsetof(struct thread_options, verify_interval),
3262 .minval = 2 * sizeof(struct verify_header),
3263 .help = "Store verify buffer header every N bytes",
3266 .interval = 2 * sizeof(struct verify_header),
3267 .category = FIO_OPT_C_IO,
3268 .group = FIO_OPT_G_VERIFY,
3271 .name = "verify_offset",
3272 .lname = "Verify offset",
3273 .type = FIO_OPT_INT,
3274 .help = "Offset verify header location by N bytes",
3275 .off1 = offsetof(struct thread_options, verify_offset),
3276 .minval = sizeof(struct verify_header),
3279 .category = FIO_OPT_C_IO,
3280 .group = FIO_OPT_G_VERIFY,
3283 .name = "verify_pattern",
3284 .lname = "Verify pattern",
3285 .type = FIO_OPT_STR,
3286 .cb = str_verify_pattern_cb,
3287 .off1 = offsetof(struct thread_options, verify_pattern),
3288 .help = "Fill pattern for IO buffers",
3291 .category = FIO_OPT_C_IO,
3292 .group = FIO_OPT_G_VERIFY,
3295 .name = "verify_pattern_interval",
3296 .lname = "Running verify pattern",
3297 .type = FIO_OPT_INT,
3298 .off1 = offsetof(struct thread_options, verify_pattern_interval),
3300 .help = "Re-create verify pattern every N bytes",
3303 .category = FIO_OPT_C_IO,
3304 .group = FIO_OPT_G_VERIFY,
3307 .name = "verify_fatal",
3308 .lname = "Verify fatal",
3309 .type = FIO_OPT_BOOL,
3310 .off1 = offsetof(struct thread_options, verify_fatal),
3312 .help = "Exit on a single verify failure, don't continue",
3315 .category = FIO_OPT_C_IO,
3316 .group = FIO_OPT_G_VERIFY,
3319 .name = "verify_dump",
3320 .lname = "Verify dump",
3321 .type = FIO_OPT_BOOL,
3322 .off1 = offsetof(struct thread_options, verify_dump),
3324 .help = "Dump contents of good and bad blocks on failure",
3327 .category = FIO_OPT_C_IO,
3328 .group = FIO_OPT_G_VERIFY,
3331 .name = "verify_async",
3332 .lname = "Verify asynchronously",
3333 .type = FIO_OPT_INT,
3334 .off1 = offsetof(struct thread_options, verify_async),
3336 .help = "Number of async verifier threads to use",
3339 .category = FIO_OPT_C_IO,
3340 .group = FIO_OPT_G_VERIFY,
3343 .name = "verify_backlog",
3344 .lname = "Verify backlog",
3345 .type = FIO_OPT_STR_VAL,
3346 .off1 = offsetof(struct thread_options, verify_backlog),
3347 .help = "Verify after this number of blocks are written",
3350 .category = FIO_OPT_C_IO,
3351 .group = FIO_OPT_G_VERIFY,
3354 .name = "verify_backlog_batch",
3355 .lname = "Verify backlog batch",
3356 .type = FIO_OPT_INT,
3357 .off1 = offsetof(struct thread_options, verify_batch),
3358 .help = "Verify this number of IO blocks",
3361 .category = FIO_OPT_C_IO,
3362 .group = FIO_OPT_G_VERIFY,
3364 #ifdef FIO_HAVE_CPU_AFFINITY
3366 .name = "verify_async_cpus",
3367 .lname = "Async verify CPUs",
3368 .type = FIO_OPT_STR,
3369 .cb = str_verify_cpus_allowed_cb,
3370 .off1 = offsetof(struct thread_options, verify_cpumask),
3371 .help = "Set CPUs allowed for async verify threads",
3372 .parent = "verify_async",
3374 .category = FIO_OPT_C_IO,
3375 .group = FIO_OPT_G_VERIFY,
3379 .name = "verify_async_cpus",
3380 .lname = "Async verify CPUs",
3381 .type = FIO_OPT_UNSUPPORTED,
3382 .help = "Your platform does not support CPU affinities",
3386 .name = "experimental_verify",
3387 .lname = "Experimental Verify",
3388 .off1 = offsetof(struct thread_options, experimental_verify),
3389 .type = FIO_OPT_BOOL,
3390 .help = "Enable experimental verification",
3392 .category = FIO_OPT_C_IO,
3393 .group = FIO_OPT_G_VERIFY,
3396 .name = "verify_state_load",
3397 .lname = "Load verify state",
3398 .off1 = offsetof(struct thread_options, verify_state),
3399 .type = FIO_OPT_BOOL,
3400 .help = "Load verify termination state",
3402 .category = FIO_OPT_C_IO,
3403 .group = FIO_OPT_G_VERIFY,
3406 .name = "verify_state_save",
3407 .lname = "Save verify state",
3408 .off1 = offsetof(struct thread_options, verify_state_save),
3409 .type = FIO_OPT_BOOL,
3411 .help = "Save verify state on termination",
3413 .category = FIO_OPT_C_IO,
3414 .group = FIO_OPT_G_VERIFY,
3417 .name = "verify_write_sequence",
3418 .lname = "Verify write sequence number",
3419 .off1 = offsetof(struct thread_options, verify_write_sequence),
3420 .type = FIO_OPT_BOOL,
3422 .help = "Verify header write sequence number",
3424 .category = FIO_OPT_C_IO,
3425 .group = FIO_OPT_G_VERIFY,
3428 .name = "verify_header_seed",
3429 .lname = "Verify header seed",
3430 .off1 = offsetof(struct thread_options, verify_header_seed),
3431 .type = FIO_OPT_BOOL,
3433 .help = "Verify the header seed used to generate the buffer contents",
3435 .category = FIO_OPT_C_IO,
3436 .group = FIO_OPT_G_VERIFY,
3438 #ifdef FIO_HAVE_TRIM
3440 .name = "trim_percentage",
3441 .lname = "Trim percentage",
3442 .type = FIO_OPT_INT,
3443 .off1 = offsetof(struct thread_options, trim_percentage),
3446 .help = "Number of verify blocks to trim (i.e., discard)",
3451 .category = FIO_OPT_C_IO,
3452 .group = FIO_OPT_G_TRIM,
3455 .name = "trim_verify_zero",
3456 .lname = "Verify trim zero",
3457 .type = FIO_OPT_BOOL,
3458 .help = "Verify that trimmed (i.e., discarded) blocks are returned as zeroes",
3459 .off1 = offsetof(struct thread_options, trim_zero),
3460 .parent = "trim_percentage",
3463 .category = FIO_OPT_C_IO,
3464 .group = FIO_OPT_G_TRIM,
3467 .name = "trim_backlog",
3468 .lname = "Trim backlog",
3469 .type = FIO_OPT_STR_VAL,
3470 .off1 = offsetof(struct thread_options, trim_backlog),
3471 .help = "Trim after this number of blocks are written",
3472 .parent = "trim_percentage",
3475 .category = FIO_OPT_C_IO,
3476 .group = FIO_OPT_G_TRIM,
3479 .name = "trim_backlog_batch",
3480 .lname = "Trim backlog batch",
3481 .type = FIO_OPT_INT,
3482 .off1 = offsetof(struct thread_options, trim_batch),
3483 .help = "Trim this number of IO blocks",
3484 .parent = "trim_percentage",
3487 .category = FIO_OPT_C_IO,
3488 .group = FIO_OPT_G_TRIM,
3492 .name = "trim_percentage",
3493 .lname = "Trim percentage",
3494 .type = FIO_OPT_UNSUPPORTED,
3495 .help = "Fio does not support TRIM on your platform",
3498 .name = "trim_verify_zero",
3499 .lname = "Verify trim zero",
3500 .type = FIO_OPT_UNSUPPORTED,
3501 .help = "Fio does not support TRIM on your platform",
3504 .name = "trim_backlog",
3505 .lname = "Trim backlog",
3506 .type = FIO_OPT_UNSUPPORTED,
3507 .help = "Fio does not support TRIM on your platform",
3510 .name = "trim_backlog_batch",
3511 .lname = "Trim backlog batch",
3512 .type = FIO_OPT_UNSUPPORTED,
3513 .help = "Fio does not support TRIM on your platform",
3517 .name = "write_iolog",
3518 .lname = "Write I/O log",
3519 .type = FIO_OPT_STR_STORE,
3520 .off1 = offsetof(struct thread_options, write_iolog_file),
3521 .help = "Store IO pattern to file",
3522 .category = FIO_OPT_C_IO,
3523 .group = FIO_OPT_G_IOLOG,
3526 .name = "read_iolog",
3527 .lname = "Read I/O log",
3528 .type = FIO_OPT_STR_STORE,
3529 .off1 = offsetof(struct thread_options, read_iolog_file),
3530 .help = "Playback IO pattern from file",
3531 .category = FIO_OPT_C_IO,
3532 .group = FIO_OPT_G_IOLOG,
3535 .name = "read_iolog_chunked",
3536 .lname = "Read I/O log in parts",
3537 .type = FIO_OPT_BOOL,
3538 .off1 = offsetof(struct thread_options, read_iolog_chunked),
3540 .parent = "read_iolog",
3541 .help = "Parse IO pattern in chunks",
3542 .category = FIO_OPT_C_IO,
3543 .group = FIO_OPT_G_IOLOG,
3546 .name = "replay_no_stall",
3547 .lname = "Don't stall on replay",
3548 .type = FIO_OPT_BOOL,
3549 .off1 = offsetof(struct thread_options, no_stall),
3551 .parent = "read_iolog",
3553 .help = "Playback IO pattern file as fast as possible without stalls",
3554 .category = FIO_OPT_C_IO,
3555 .group = FIO_OPT_G_IOLOG,
3558 .name = "replay_redirect",
3559 .lname = "Redirect device for replay",
3560 .type = FIO_OPT_STR_STORE,
3561 .off1 = offsetof(struct thread_options, replay_redirect),
3562 .parent = "read_iolog",
3564 .help = "Replay all I/O onto this device, regardless of trace device",
3565 .category = FIO_OPT_C_IO,
3566 .group = FIO_OPT_G_IOLOG,
3569 .name = "replay_scale",
3570 .lname = "Replace offset scale factor",
3571 .type = FIO_OPT_INT,
3572 .off1 = offsetof(struct thread_options, replay_scale),
3573 .parent = "read_iolog",
3575 .help = "Align offsets to this blocksize",
3576 .category = FIO_OPT_C_IO,
3577 .group = FIO_OPT_G_IOLOG,
3580 .name = "replay_align",
3581 .lname = "Replace alignment",
3582 .type = FIO_OPT_INT,
3583 .off1 = offsetof(struct thread_options, replay_align),
3584 .parent = "read_iolog",
3585 .help = "Scale offset down by this factor",
3586 .category = FIO_OPT_C_IO,
3587 .group = FIO_OPT_G_IOLOG,
3591 .name = "replay_time_scale",
3592 .lname = "Replay Time Scale",
3593 .type = FIO_OPT_INT,
3594 .off1 = offsetof(struct thread_options, replay_time_scale),
3597 .parent = "read_iolog",
3599 .help = "Scale time for replay events",
3600 .category = FIO_OPT_C_IO,
3601 .group = FIO_OPT_G_IOLOG,
3604 .name = "replay_skip",
3605 .lname = "Replay Skip",
3606 .type = FIO_OPT_STR,
3607 .cb = str_replay_skip_cb,
3608 .off1 = offsetof(struct thread_options, replay_skip),
3609 .parent = "read_iolog",
3610 .help = "Skip certain IO types (read,write,trim,flush)",
3611 .category = FIO_OPT_C_IO,
3612 .group = FIO_OPT_G_IOLOG,
3615 .name = "merge_blktrace_file",
3616 .lname = "Merged blktrace output filename",
3617 .type = FIO_OPT_STR_STORE,
3618 .off1 = offsetof(struct thread_options, merge_blktrace_file),
3619 .help = "Merged blktrace output filename",
3620 .category = FIO_OPT_C_IO,
3621 .group = FIO_OPT_G_IOLOG,
3624 .name = "merge_blktrace_scalars",
3625 .lname = "Percentage to scale each trace",
3626 .type = FIO_OPT_FLOAT_LIST,
3627 .off1 = offsetof(struct thread_options, merge_blktrace_scalars),
3628 .maxlen = FIO_IO_U_LIST_MAX_LEN,
3629 .help = "Percentage to scale each trace",
3630 .category = FIO_OPT_C_IO,
3631 .group = FIO_OPT_G_IOLOG,
3634 .name = "merge_blktrace_iters",
3635 .lname = "Number of iterations to run per trace",
3636 .type = FIO_OPT_FLOAT_LIST,
3637 .off1 = offsetof(struct thread_options, merge_blktrace_iters),
3638 .maxlen = FIO_IO_U_LIST_MAX_LEN,
3639 .help = "Number of iterations to run per trace",
3640 .category = FIO_OPT_C_IO,
3641 .group = FIO_OPT_G_IOLOG,
3644 .name = "exec_prerun",
3645 .lname = "Pre-execute runnable",
3646 .type = FIO_OPT_STR_STORE,
3647 .off1 = offsetof(struct thread_options, exec_prerun),
3648 .help = "Execute this file prior to running job",
3649 .category = FIO_OPT_C_GENERAL,
3650 .group = FIO_OPT_G_INVALID,
3653 .name = "exec_postrun",
3654 .lname = "Post-execute runnable",
3655 .type = FIO_OPT_STR_STORE,
3656 .off1 = offsetof(struct thread_options, exec_postrun),
3657 .help = "Execute this file after running job",
3658 .category = FIO_OPT_C_GENERAL,
3659 .group = FIO_OPT_G_INVALID,
3661 #ifdef FIO_HAVE_IOSCHED_SWITCH
3663 .name = "ioscheduler",
3664 .lname = "I/O scheduler",
3665 .type = FIO_OPT_STR_STORE,
3666 .off1 = offsetof(struct thread_options, ioscheduler),
3667 .help = "Use this IO scheduler on the backing device",
3668 .category = FIO_OPT_C_FILE,
3669 .group = FIO_OPT_G_INVALID,
3673 .name = "ioscheduler",
3674 .lname = "I/O scheduler",
3675 .type = FIO_OPT_UNSUPPORTED,
3676 .help = "Your platform does not support IO scheduler switching",
3681 .lname = "Zone mode",
3682 .help = "Mode for the zonesize, zonerange and zoneskip parameters",
3683 .type = FIO_OPT_STR,
3684 .off1 = offsetof(struct thread_options, zone_mode),
3686 .category = FIO_OPT_C_IO,
3687 .group = FIO_OPT_G_ZONE,
3690 .oval = ZONE_MODE_NONE,
3691 .help = "no zoning",
3693 { .ival = "strided",
3694 .oval = ZONE_MODE_STRIDED,
3695 .help = "strided mode - random I/O is restricted to a single zone",
3698 .oval = ZONE_MODE_ZBD,
3699 .help = "zoned block device mode - random I/O selects one of multiple zones randomly",
3705 .lname = "Zone size",
3706 .type = FIO_OPT_STR_VAL,
3707 .off1 = offsetof(struct thread_options, zone_size),
3708 .help = "Amount of data to read per zone",
3710 .interval = 1024 * 1024,
3711 .category = FIO_OPT_C_IO,
3712 .group = FIO_OPT_G_ZONE,
3715 .name = "zonecapacity",
3716 .lname = "Zone capacity",
3717 .type = FIO_OPT_STR_VAL,
3718 .off1 = offsetof(struct thread_options, zone_capacity),
3719 .help = "Capacity per zone",
3721 .interval = 1024 * 1024,
3722 .category = FIO_OPT_C_IO,
3723 .group = FIO_OPT_G_ZONE,
3726 .name = "zonerange",
3727 .lname = "Zone range",
3728 .type = FIO_OPT_STR_VAL,
3729 .off1 = offsetof(struct thread_options, zone_range),
3730 .help = "Give size of an IO zone",
3732 .interval = 1024 * 1024,
3733 .category = FIO_OPT_C_IO,
3734 .group = FIO_OPT_G_ZONE,
3738 .lname = "Zone skip",
3739 .type = FIO_OPT_STR_VAL_ZONE,
3740 .cb = str_zoneskip_cb,
3741 .off1 = offsetof(struct thread_options, zone_skip),
3742 .help = "Space between IO zones",
3744 .category = FIO_OPT_C_IO,
3745 .group = FIO_OPT_G_ZONE,
3748 .name = "read_beyond_wp",
3749 .lname = "Allow reads beyond the zone write pointer",
3750 .type = FIO_OPT_BOOL,
3751 .off1 = offsetof(struct thread_options, read_beyond_wp),
3752 .help = "Allow reads beyond the zone write pointer",
3754 .category = FIO_OPT_C_IO,
3755 .group = FIO_OPT_G_INVALID,
3758 .name = "max_open_zones",
3759 .lname = "Per device/file maximum number of open zones",
3760 .type = FIO_OPT_INT,
3761 .off1 = offsetof(struct thread_options, max_open_zones),
3762 .maxval = ZBD_MAX_WRITE_ZONES,
3763 .help = "Limit on the number of simultaneously opened sequential write zones with zonemode=zbd",
3765 .category = FIO_OPT_C_IO,
3766 .group = FIO_OPT_G_INVALID,
3769 .name = "job_max_open_zones",
3770 .lname = "Job maximum number of open zones",
3771 .type = FIO_OPT_INT,
3772 .off1 = offsetof(struct thread_options, job_max_open_zones),
3773 .maxval = ZBD_MAX_WRITE_ZONES,
3774 .help = "Limit on the number of simultaneously opened sequential write zones with zonemode=zbd by one thread/process",
3776 .category = FIO_OPT_C_IO,
3777 .group = FIO_OPT_G_INVALID,
3780 .name = "ignore_zone_limits",
3781 .lname = "Ignore zone resource limits",
3782 .type = FIO_OPT_BOOL,
3783 .off1 = offsetof(struct thread_options, ignore_zone_limits),
3785 .help = "Ignore the zone resource limits (max open/active zones) reported by the device",
3786 .category = FIO_OPT_C_IO,
3787 .group = FIO_OPT_G_INVALID,
3790 .name = "zone_reset_threshold",
3791 .lname = "Zone reset threshold",
3792 .help = "Zoned block device reset threshold",
3793 .type = FIO_OPT_FLOAT_LIST,
3795 .off1 = offsetof(struct thread_options, zrt),
3798 .category = FIO_OPT_C_IO,
3799 .group = FIO_OPT_G_ZONE,
3802 .name = "zone_reset_frequency",
3803 .lname = "Zone reset frequency",
3804 .help = "Zoned block device zone reset frequency in HZ",
3805 .type = FIO_OPT_FLOAT_LIST,
3807 .off1 = offsetof(struct thread_options, zrf),
3810 .category = FIO_OPT_C_IO,
3811 .group = FIO_OPT_G_ZONE,
3814 .name = "recover_zbd_write_error",
3815 .lname = "Recover write errors when zonemode=zbd is set",
3816 .type = FIO_OPT_BOOL,
3817 .off1 = offsetof(struct thread_options, recover_zbd_write_error),
3819 .help = "Continue writes for sequential write required zones after recovering write errors with care for partial write pointer move",
3820 .category = FIO_OPT_C_IO,
3821 .group = FIO_OPT_G_ZONE,
3825 .lname = "Flexible data placement",
3826 .type = FIO_OPT_BOOL,
3827 .off1 = offsetof(struct thread_options, fdp),
3828 .help = "Use Data placement directive (FDP)",
3830 .category = FIO_OPT_C_IO,
3831 .group = FIO_OPT_G_INVALID,
3834 .name = "dataplacement",
3835 .alias = "data_placement",
3836 .lname = "Data Placement interface",
3837 .type = FIO_OPT_STR,
3838 .off1 = offsetof(struct thread_options, dp_type),
3839 .help = "Data Placement interface to use",
3841 .category = FIO_OPT_C_IO,
3842 .group = FIO_OPT_G_INVALID,
3845 .oval = FIO_DP_NONE,
3846 .help = "Do not specify a data placement interface",
3850 .help = "Use Flexible Data Placement interface",
3852 { .ival = "streams",
3853 .oval = FIO_DP_STREAMS,
3854 .help = "Use Streams interface",
3859 .name = "plid_select",
3860 .alias = "fdp_pli_select",
3861 .lname = "Data Placement ID selection strategy",
3862 .type = FIO_OPT_STR,
3863 .off1 = offsetof(struct thread_options, dp_id_select),
3864 .help = "Strategy for selecting next Data Placement ID",
3865 .def = "roundrobin",
3866 .category = FIO_OPT_C_IO,
3867 .group = FIO_OPT_G_INVALID,
3870 .oval = FIO_DP_RANDOM,
3871 .help = "Choose a Placement ID at random (uniform)",
3873 { .ival = "roundrobin",
3875 .help = "Round robin select Placement IDs",
3878 .oval = FIO_DP_SCHEME,
3879 .help = "Use a scheme(based on LBA) to select Placement IDs",
3886 .lname = "Stream IDs/Data Placement ID indices",
3887 .type = FIO_OPT_STR,
3888 .cb = str_fdp_pli_cb,
3889 .off1 = offsetof(struct thread_options, dp_ids),
3890 .help = "Sets which Data Placement ids to use (defaults to all for FDP)",
3892 .category = FIO_OPT_C_IO,
3893 .group = FIO_OPT_G_INVALID,
3896 .name = "dp_scheme",
3897 .lname = "Data Placement Scheme",
3898 .type = FIO_OPT_STR_STORE,
3899 .cb = str_dp_scheme_cb,
3900 .off1 = offsetof(struct thread_options, dp_scheme_file),
3902 .help = "scheme file that specifies offset-RUH mapping",
3903 .category = FIO_OPT_C_IO,
3904 .group = FIO_OPT_G_INVALID,
3908 .lname = "Lock memory",
3909 .type = FIO_OPT_STR_VAL,
3910 .off1 = offsetof(struct thread_options, lockmem),
3911 .help = "Lock down this amount of memory (per worker)",
3913 .interval = 1024 * 1024,
3914 .category = FIO_OPT_C_GENERAL,
3915 .group = FIO_OPT_G_INVALID,
3918 .name = "rwmixread",
3919 .lname = "Read/write mix read",
3920 .type = FIO_OPT_INT,
3921 .cb = str_rwmix_read_cb,
3922 .off1 = offsetof(struct thread_options, rwmix[DDIR_READ]),
3924 .help = "Percentage of mixed workload that is reads",
3927 .inverse = "rwmixwrite",
3928 .category = FIO_OPT_C_IO,
3929 .group = FIO_OPT_G_RWMIX,
3932 .name = "rwmixwrite",
3933 .lname = "Read/write mix write",
3934 .type = FIO_OPT_INT,
3935 .cb = str_rwmix_write_cb,
3936 .off1 = offsetof(struct thread_options, rwmix[DDIR_WRITE]),
3938 .help = "Percentage of mixed workload that is writes",
3941 .inverse = "rwmixread",
3942 .category = FIO_OPT_C_IO,
3943 .group = FIO_OPT_G_RWMIX,
3946 .name = "rwmixcycle",
3947 .lname = "Read/write mix cycle",
3948 .type = FIO_OPT_DEPRECATED,
3949 .category = FIO_OPT_C_IO,
3950 .group = FIO_OPT_G_RWMIX,
3955 .type = FIO_OPT_INT,
3956 .off1 = offsetof(struct thread_options, nice),
3957 .help = "Set job CPU nice value",
3962 .category = FIO_OPT_C_GENERAL,
3963 .group = FIO_OPT_G_CRED,
3965 #ifdef FIO_HAVE_IOPRIO
3968 .lname = "I/O nice priority",
3969 .type = FIO_OPT_INT,
3970 .off1 = offsetof(struct thread_options, ioprio),
3971 .help = "Set job IO priority value",
3972 .minval = IOPRIO_MIN_PRIO,
3973 .maxval = IOPRIO_MAX_PRIO,
3975 .category = FIO_OPT_C_GENERAL,
3976 .group = FIO_OPT_G_CRED,
3981 .lname = "I/O nice priority",
3982 .type = FIO_OPT_UNSUPPORTED,
3983 .help = "Your platform does not support IO priorities",
3986 #ifdef FIO_HAVE_IOPRIO_CLASS
3987 #ifndef FIO_HAVE_IOPRIO
3988 #error "FIO_HAVE_IOPRIO_CLASS requires FIO_HAVE_IOPRIO"
3991 .name = "prioclass",
3992 .lname = "I/O nice priority class",
3993 .type = FIO_OPT_INT,
3994 .off1 = offsetof(struct thread_options, ioprio_class),
3995 .help = "Set job IO priority class",
3996 .minval = IOPRIO_MIN_PRIO_CLASS,
3997 .maxval = IOPRIO_MAX_PRIO_CLASS,
3999 .category = FIO_OPT_C_GENERAL,
4000 .group = FIO_OPT_G_CRED,
4004 .lname = "I/O nice priority hint",
4005 .type = FIO_OPT_INT,
4006 .off1 = offsetof(struct thread_options, ioprio_hint),
4007 .help = "Set job IO priority hint",
4008 .minval = IOPRIO_MIN_PRIO_HINT,
4009 .maxval = IOPRIO_MAX_PRIO_HINT,
4011 .category = FIO_OPT_C_GENERAL,
4012 .group = FIO_OPT_G_CRED,
4016 .name = "prioclass",
4017 .lname = "I/O nice priority class",
4018 .type = FIO_OPT_UNSUPPORTED,
4019 .help = "Your platform does not support IO priority classes",
4023 .lname = "I/O nice priority hint",
4024 .type = FIO_OPT_UNSUPPORTED,
4025 .help = "Your platform does not support IO priority hints",
4029 .name = "thinktime",
4030 .lname = "Thinktime",
4031 .type = FIO_OPT_INT,
4032 .off1 = offsetof(struct thread_options, thinktime),
4033 .help = "Idle time between IO buffers (usec)",
4036 .category = FIO_OPT_C_IO,
4037 .group = FIO_OPT_G_THINKTIME,
4040 .name = "thinktime_spin",
4041 .lname = "Thinktime spin",
4042 .type = FIO_OPT_INT,
4043 .off1 = offsetof(struct thread_options, thinktime_spin),
4044 .help = "Start think time by spinning this amount (usec)",
4047 .parent = "thinktime",
4049 .category = FIO_OPT_C_IO,
4050 .group = FIO_OPT_G_THINKTIME,
4053 .name = "thinkcycles",
4054 .lname = "Think cycles",
4055 .type = FIO_OPT_INT,
4056 .off1 = offsetof(struct thread_options, thinkcycles),
4057 .help = "Spin for a constant amount of cycles between requests",
4059 .parent = "thinktime",
4061 .category = FIO_OPT_C_IO,
4062 .group = FIO_OPT_G_THINKTIME,
4065 .name = "thinktime_blocks",
4066 .lname = "Thinktime blocks",
4067 .type = FIO_OPT_INT,
4068 .off1 = offsetof(struct thread_options, thinktime_blocks),
4069 .help = "IO buffer period between 'thinktime'",
4071 .parent = "thinktime",
4073 .category = FIO_OPT_C_IO,
4074 .group = FIO_OPT_G_THINKTIME,
4077 .name = "thinktime_blocks_type",
4078 .lname = "Thinktime blocks type",
4079 .type = FIO_OPT_STR,
4080 .off1 = offsetof(struct thread_options, thinktime_blocks_type),
4081 .help = "How thinktime_blocks takes effect",
4083 .category = FIO_OPT_C_IO,
4084 .group = FIO_OPT_G_THINKTIME,
4086 { .ival = "complete",
4087 .oval = THINKTIME_BLOCKS_TYPE_COMPLETE,
4088 .help = "thinktime_blocks takes effect at the completion side",
4092 .oval = THINKTIME_BLOCKS_TYPE_ISSUE,
4093 .help = "thinktime_blocks takes effect at the issue side",
4096 .parent = "thinktime",
4099 .name = "thinktime_iotime",
4100 .lname = "Thinktime interval",
4101 .type = FIO_OPT_INT,
4102 .off1 = offsetof(struct thread_options, thinktime_iotime),
4103 .help = "IO time interval between 'thinktime'",
4105 .parent = "thinktime",
4109 .category = FIO_OPT_C_IO,
4110 .group = FIO_OPT_G_THINKTIME,
4114 .lname = "I/O rate",
4115 .type = FIO_OPT_ULL,
4116 .off1 = offsetof(struct thread_options, rate[DDIR_READ]),
4117 .off2 = offsetof(struct thread_options, rate[DDIR_WRITE]),
4118 .off3 = offsetof(struct thread_options, rate[DDIR_TRIM]),
4119 .help = "Set bandwidth rate",
4120 .category = FIO_OPT_C_IO,
4121 .group = FIO_OPT_G_RATE,
4126 .lname = "I/O min rate",
4127 .type = FIO_OPT_ULL,
4128 .off1 = offsetof(struct thread_options, ratemin[DDIR_READ]),
4129 .off2 = offsetof(struct thread_options, ratemin[DDIR_WRITE]),
4130 .off3 = offsetof(struct thread_options, ratemin[DDIR_TRIM]),
4131 .help = "Job must meet this rate or it will be shutdown",
4134 .category = FIO_OPT_C_IO,
4135 .group = FIO_OPT_G_RATE,
4138 .name = "rate_iops",
4139 .lname = "I/O rate IOPS",
4140 .type = FIO_OPT_INT,
4141 .off1 = offsetof(struct thread_options, rate_iops[DDIR_READ]),
4142 .off2 = offsetof(struct thread_options, rate_iops[DDIR_WRITE]),
4143 .off3 = offsetof(struct thread_options, rate_iops[DDIR_TRIM]),
4144 .help = "Limit IO used to this number of IO operations/sec",
4146 .category = FIO_OPT_C_IO,
4147 .group = FIO_OPT_G_RATE,
4150 .name = "rate_iops_min",
4151 .lname = "I/O min rate IOPS",
4152 .type = FIO_OPT_INT,
4153 .off1 = offsetof(struct thread_options, rate_iops_min[DDIR_READ]),
4154 .off2 = offsetof(struct thread_options, rate_iops_min[DDIR_WRITE]),
4155 .off3 = offsetof(struct thread_options, rate_iops_min[DDIR_TRIM]),
4156 .help = "Job must meet this rate or it will be shut down",
4157 .parent = "rate_iops",
4159 .category = FIO_OPT_C_IO,
4160 .group = FIO_OPT_G_RATE,
4163 .name = "rate_process",
4164 .lname = "Rate Process",
4165 .type = FIO_OPT_STR,
4166 .off1 = offsetof(struct thread_options, rate_process),
4167 .help = "What process controls how rated IO is managed",
4169 .category = FIO_OPT_C_IO,
4170 .group = FIO_OPT_G_RATE,
4173 .oval = RATE_PROCESS_LINEAR,
4174 .help = "Linear rate of IO",
4178 .oval = RATE_PROCESS_POISSON,
4179 .help = "Rate follows Poisson process",
4185 .name = "rate_cycle",
4186 .alias = "ratecycle",
4187 .lname = "I/O rate cycle",
4188 .type = FIO_OPT_INT,
4189 .off1 = offsetof(struct thread_options, ratecycle),
4190 .help = "Window average for rate limits (msec)",
4194 .category = FIO_OPT_C_IO,
4195 .group = FIO_OPT_G_RATE,
4198 .name = "rate_ignore_thinktime",
4199 .lname = "Rate ignore thinktime",
4200 .type = FIO_OPT_BOOL,
4201 .off1 = offsetof(struct thread_options, rate_ign_think),
4202 .help = "Rated IO ignores thinktime settings",
4204 .category = FIO_OPT_C_IO,
4205 .group = FIO_OPT_G_RATE,
4208 .name = "max_latency",
4209 .lname = "Max Latency (usec)",
4210 .type = FIO_OPT_ULL,
4211 .off1 = offsetof(struct thread_options, max_latency[DDIR_READ]),
4212 .off2 = offsetof(struct thread_options, max_latency[DDIR_WRITE]),
4213 .off3 = offsetof(struct thread_options, max_latency[DDIR_TRIM]),
4214 .help = "Maximum tolerated IO latency (usec)",
4216 .category = FIO_OPT_C_IO,
4217 .group = FIO_OPT_G_LATPROF,
4220 .name = "latency_target",
4221 .lname = "Latency Target (usec)",
4222 .type = FIO_OPT_STR_VAL_TIME,
4223 .off1 = offsetof(struct thread_options, latency_target),
4224 .help = "Ramp to max queue depth supporting this latency",
4226 .category = FIO_OPT_C_IO,
4227 .group = FIO_OPT_G_LATPROF,
4230 .name = "latency_window",
4231 .lname = "Latency Window (usec)",
4232 .type = FIO_OPT_STR_VAL_TIME,
4233 .off1 = offsetof(struct thread_options, latency_window),
4234 .help = "Time to sustain latency_target",
4236 .category = FIO_OPT_C_IO,
4237 .group = FIO_OPT_G_LATPROF,
4240 .name = "latency_percentile",
4241 .lname = "Latency Percentile",
4242 .type = FIO_OPT_FLOAT_LIST,
4243 .off1 = offsetof(struct thread_options, latency_percentile),
4244 .help = "Percentile of IOs must be below latency_target",
4249 .category = FIO_OPT_C_IO,
4250 .group = FIO_OPT_G_LATPROF,
4253 .name = "latency_run",
4254 .lname = "Latency Run",
4255 .type = FIO_OPT_BOOL,
4256 .off1 = offsetof(struct thread_options, latency_run),
4257 .help = "Keep adjusting queue depth to match latency_target",
4259 .category = FIO_OPT_C_IO,
4260 .group = FIO_OPT_G_LATPROF,
4263 .name = "invalidate",
4264 .lname = "Cache invalidate",
4265 .type = FIO_OPT_BOOL,
4266 .off1 = offsetof(struct thread_options, invalidate_cache),
4267 .help = "Invalidate buffer/page cache prior to running job",
4269 .category = FIO_OPT_C_IO,
4270 .group = FIO_OPT_G_IO_TYPE,
4274 .lname = "Synchronous I/O",
4275 .type = FIO_OPT_STR,
4276 .off1 = offsetof(struct thread_options, sync_io),
4277 .help = "Use synchronous write IO",
4280 .category = FIO_OPT_C_IO,
4281 .group = FIO_OPT_G_IO_TYPE,
4302 #ifdef FIO_HAVE_WRITE_HINT
4304 .name = "write_hint",
4305 .lname = "Write hint",
4306 .type = FIO_OPT_STR,
4307 .off1 = offsetof(struct thread_options, write_hint),
4308 .help = "Set expected write life time",
4309 .category = FIO_OPT_C_ENGINE,
4310 .group = FIO_OPT_G_INVALID,
4313 .oval = RWH_WRITE_LIFE_NONE,
4316 .oval = RWH_WRITE_LIFE_SHORT,
4319 .oval = RWH_WRITE_LIFE_MEDIUM,
4322 .oval = RWH_WRITE_LIFE_LONG,
4324 { .ival = "extreme",
4325 .oval = RWH_WRITE_LIFE_EXTREME,
4331 .name = "create_serialize",
4332 .lname = "Create serialize",
4333 .type = FIO_OPT_BOOL,
4334 .off1 = offsetof(struct thread_options, create_serialize),
4335 .help = "Serialize creation of job files",
4337 .category = FIO_OPT_C_FILE,
4338 .group = FIO_OPT_G_INVALID,
4341 .name = "create_fsync",
4342 .lname = "Create fsync",
4343 .type = FIO_OPT_BOOL,
4344 .off1 = offsetof(struct thread_options, create_fsync),
4345 .help = "fsync file after creation",
4347 .category = FIO_OPT_C_FILE,
4348 .group = FIO_OPT_G_INVALID,
4351 .name = "create_on_open",
4352 .lname = "Create on open",
4353 .type = FIO_OPT_BOOL,
4354 .off1 = offsetof(struct thread_options, create_on_open),
4355 .help = "Create files when they are opened for IO",
4357 .category = FIO_OPT_C_FILE,
4358 .group = FIO_OPT_G_INVALID,
4361 .name = "create_only",
4362 .lname = "Create Only",
4363 .type = FIO_OPT_BOOL,
4364 .off1 = offsetof(struct thread_options, create_only),
4365 .help = "Only perform file creation phase",
4366 .category = FIO_OPT_C_FILE,
4370 .name = "allow_file_create",
4371 .lname = "Allow file create",
4372 .type = FIO_OPT_BOOL,
4373 .off1 = offsetof(struct thread_options, allow_create),
4374 .help = "Permit fio to create files, if they don't exist",
4376 .category = FIO_OPT_C_FILE,
4377 .group = FIO_OPT_G_FILENAME,
4380 .name = "allow_mounted_write",
4381 .lname = "Allow mounted write",
4382 .type = FIO_OPT_BOOL,
4383 .off1 = offsetof(struct thread_options, allow_mounted_write),
4384 .help = "Allow writes to a mounted partition",
4386 .category = FIO_OPT_C_FILE,
4387 .group = FIO_OPT_G_FILENAME,
4391 .lname = "Pre-read files",
4392 .type = FIO_OPT_BOOL,
4393 .off1 = offsetof(struct thread_options, pre_read),
4394 .help = "Pre-read files before starting official testing",
4396 .category = FIO_OPT_C_FILE,
4397 .group = FIO_OPT_G_INVALID,
4399 #ifdef FIO_HAVE_CPU_AFFINITY
4402 .lname = "CPU mask",
4403 .type = FIO_OPT_INT,
4404 .cb = str_cpumask_cb,
4405 .off1 = offsetof(struct thread_options, cpumask),
4406 .help = "CPU affinity mask",
4407 .category = FIO_OPT_C_GENERAL,
4408 .group = FIO_OPT_G_CRED,
4411 .name = "cpus_allowed",
4412 .lname = "CPUs allowed",
4413 .type = FIO_OPT_STR,
4414 .cb = str_cpus_allowed_cb,
4415 .off1 = offsetof(struct thread_options, cpumask),
4416 .help = "Set CPUs allowed",
4417 .category = FIO_OPT_C_GENERAL,
4418 .group = FIO_OPT_G_CRED,
4421 .name = "cpus_allowed_policy",
4422 .lname = "CPUs allowed distribution policy",
4423 .type = FIO_OPT_STR,
4424 .off1 = offsetof(struct thread_options, cpus_allowed_policy),
4425 .help = "Distribution policy for cpus_allowed",
4426 .parent = "cpus_allowed",
4430 .oval = FIO_CPUS_SHARED,
4431 .help = "Mask shared between threads",
4434 .oval = FIO_CPUS_SPLIT,
4435 .help = "Mask split between threads",
4438 .category = FIO_OPT_C_GENERAL,
4439 .group = FIO_OPT_G_CRED,
4444 .lname = "CPU mask",
4445 .type = FIO_OPT_UNSUPPORTED,
4446 .help = "Your platform does not support CPU affinities",
4449 .name = "cpus_allowed",
4450 .lname = "CPUs allowed",
4451 .type = FIO_OPT_UNSUPPORTED,
4452 .help = "Your platform does not support CPU affinities",
4455 .name = "cpus_allowed_policy",
4456 .lname = "CPUs allowed distribution policy",
4457 .type = FIO_OPT_UNSUPPORTED,
4458 .help = "Your platform does not support CPU affinities",
4461 #ifdef CONFIG_LIBNUMA
4463 .name = "numa_cpu_nodes",
4464 .lname = "NUMA CPU Nodes",
4465 .type = FIO_OPT_STR,
4466 .cb = str_numa_cpunodes_cb,
4467 .off1 = offsetof(struct thread_options, numa_cpunodes),
4468 .help = "NUMA CPU nodes bind",
4469 .category = FIO_OPT_C_GENERAL,
4470 .group = FIO_OPT_G_INVALID,
4473 .name = "numa_mem_policy",
4474 .lname = "NUMA Memory Policy",
4475 .type = FIO_OPT_STR,
4476 .cb = str_numa_mpol_cb,
4477 .off1 = offsetof(struct thread_options, numa_memnodes),
4478 .help = "NUMA memory policy setup",
4479 .category = FIO_OPT_C_GENERAL,
4480 .group = FIO_OPT_G_INVALID,
4484 .name = "numa_cpu_nodes",
4485 .lname = "NUMA CPU Nodes",
4486 .type = FIO_OPT_UNSUPPORTED,
4487 .help = "Build fio with libnuma-dev(el) to enable this option",
4490 .name = "numa_mem_policy",
4491 .lname = "NUMA Memory Policy",
4492 .type = FIO_OPT_UNSUPPORTED,
4493 .help = "Build fio with libnuma-dev(el) to enable this option",
4498 .name = "gpu_dev_id",
4499 .lname = "GPU device ID",
4500 .type = FIO_OPT_INT,
4501 .off1 = offsetof(struct thread_options, gpu_dev_id),
4502 .help = "Set GPU device ID for GPUDirect RDMA",
4504 .category = FIO_OPT_C_GENERAL,
4505 .group = FIO_OPT_G_INVALID,
4509 .name = "end_fsync",
4510 .lname = "End fsync",
4511 .type = FIO_OPT_BOOL,
4512 .off1 = offsetof(struct thread_options, end_fsync),
4513 .help = "Include fsync at the end of job",
4515 .category = FIO_OPT_C_FILE,
4516 .group = FIO_OPT_G_INVALID,
4519 .name = "fsync_on_close",
4520 .lname = "Fsync on close",
4521 .type = FIO_OPT_BOOL,
4522 .off1 = offsetof(struct thread_options, fsync_on_close),
4523 .help = "fsync files on close",
4525 .category = FIO_OPT_C_FILE,
4526 .group = FIO_OPT_G_INVALID,
4530 .lname = "Unlink file",
4531 .type = FIO_OPT_BOOL,
4532 .off1 = offsetof(struct thread_options, unlink),
4533 .help = "Unlink created files after job has completed",
4535 .category = FIO_OPT_C_FILE,
4536 .group = FIO_OPT_G_INVALID,
4539 .name = "unlink_each_loop",
4540 .lname = "Unlink file after each loop of a job",
4541 .type = FIO_OPT_BOOL,
4542 .off1 = offsetof(struct thread_options, unlink_each_loop),
4543 .help = "Unlink created files after each loop in a job has completed",
4545 .category = FIO_OPT_C_FILE,
4546 .group = FIO_OPT_G_INVALID,
4550 .lname = "Exit-all on terminate",
4551 .type = FIO_OPT_STR_SET,
4552 .cb = str_exitall_cb,
4553 .help = "Terminate all jobs when one exits",
4554 .category = FIO_OPT_C_GENERAL,
4555 .group = FIO_OPT_G_PROCESS,
4558 .name = "exit_what",
4559 .lname = "What jobs to quit on terminate",
4560 .type = FIO_OPT_STR,
4561 .off1 = offsetof(struct thread_options, exit_what),
4562 .help = "Fine-grained control for exitall",
4564 .category = FIO_OPT_C_GENERAL,
4565 .group = FIO_OPT_G_PROCESS,
4568 .oval = TERMINATE_GROUP,
4569 .help = "exit_all=1 default behaviour",
4571 { .ival = "stonewall",
4572 .oval = TERMINATE_STONEWALL,
4573 .help = "quit all currently running jobs; continue with next stonewall",
4576 .oval = TERMINATE_ALL,
4577 .help = "Quit everything",
4582 .name = "exitall_on_error",
4583 .lname = "Exit-all on terminate in error",
4584 .type = FIO_OPT_STR_SET,
4585 .off1 = offsetof(struct thread_options, exitall_error),
4586 .help = "Terminate all jobs when one exits in error",
4587 .category = FIO_OPT_C_GENERAL,
4588 .group = FIO_OPT_G_PROCESS,
4591 .name = "stonewall",
4592 .lname = "Wait for previous",
4593 .alias = "wait_for_previous",
4594 .type = FIO_OPT_STR_SET,
4595 .off1 = offsetof(struct thread_options, stonewall),
4596 .help = "Insert a hard barrier between this job and previous",
4597 .category = FIO_OPT_C_GENERAL,
4598 .group = FIO_OPT_G_PROCESS,
4601 .name = "new_group",
4602 .lname = "New group",
4603 .type = FIO_OPT_STR_SET,
4604 .off1 = offsetof(struct thread_options, new_group),
4605 .help = "Mark the start of a new group (for reporting)",
4606 .category = FIO_OPT_C_GENERAL,
4607 .group = FIO_OPT_G_PROCESS,
4612 .type = FIO_OPT_STR_SET,
4613 .off1 = offsetof(struct thread_options, use_thread),
4614 .help = "Use threads instead of processes",
4615 #ifdef CONFIG_NO_SHM
4619 .category = FIO_OPT_C_GENERAL,
4620 .group = FIO_OPT_G_PROCESS,
4623 .name = "per_job_logs",
4624 .lname = "Per Job Logs",
4625 .type = FIO_OPT_BOOL,
4626 .off1 = offsetof(struct thread_options, per_job_logs),
4627 .help = "Include job number in generated log files or not",
4629 .category = FIO_OPT_C_LOG,
4630 .group = FIO_OPT_G_INVALID,
4633 .name = "write_bw_log",
4634 .lname = "Write bandwidth log",
4635 .type = FIO_OPT_STR,
4636 .off1 = offsetof(struct thread_options, bw_log_file),
4637 .cb = str_write_bw_log_cb,
4638 .help = "Write log of bandwidth during run",
4639 .category = FIO_OPT_C_LOG,
4640 .group = FIO_OPT_G_INVALID,
4643 .name = "write_lat_log",
4644 .lname = "Write latency log",
4645 .type = FIO_OPT_STR,
4646 .off1 = offsetof(struct thread_options, lat_log_file),
4647 .cb = str_write_lat_log_cb,
4648 .help = "Write log of latency during run",
4649 .category = FIO_OPT_C_LOG,
4650 .group = FIO_OPT_G_INVALID,
4653 .name = "write_iops_log",
4654 .lname = "Write IOPS log",
4655 .type = FIO_OPT_STR,
4656 .off1 = offsetof(struct thread_options, iops_log_file),
4657 .cb = str_write_iops_log_cb,
4658 .help = "Write log of IOPS during run",
4659 .category = FIO_OPT_C_LOG,
4660 .group = FIO_OPT_G_INVALID,
4663 .name = "log_entries",
4664 .lname = "Log entries",
4665 .type = FIO_OPT_INT,
4666 .off1 = offsetof(struct thread_options, log_entries),
4667 .help = "Initial number of entries in a job IO log",
4668 .def = __fio_stringify(DEF_LOG_ENTRIES),
4669 .minval = DEF_LOG_ENTRIES,
4670 .maxval = MAX_LOG_ENTRIES,
4671 .category = FIO_OPT_C_LOG,
4672 .group = FIO_OPT_G_INVALID,
4675 .name = "log_avg_msec",
4676 .lname = "Log averaging (msec)",
4677 .type = FIO_OPT_INT,
4678 .off1 = offsetof(struct thread_options, log_avg_msec),
4679 .help = "Average bw/iops/lat logs over this period of time",
4681 .category = FIO_OPT_C_LOG,
4682 .group = FIO_OPT_G_INVALID,
4685 .name = "log_hist_msec",
4686 .lname = "Log histograms (msec)",
4687 .type = FIO_OPT_INT,
4688 .off1 = offsetof(struct thread_options, log_hist_msec),
4689 .help = "Dump completion latency histograms at frequency of this time value",
4691 .category = FIO_OPT_C_LOG,
4692 .group = FIO_OPT_G_INVALID,
4695 .name = "log_hist_coarseness",
4696 .lname = "Histogram logs coarseness",
4697 .type = FIO_OPT_INT,
4698 .off1 = offsetof(struct thread_options, log_hist_coarseness),
4699 .help = "Integer in range [0,6]. Higher coarseness outputs"
4700 " fewer histogram bins per sample. The number of bins for"
4701 " these are [1216, 608, 304, 152, 76, 38, 19] respectively.",
4703 .category = FIO_OPT_C_LOG,
4704 .group = FIO_OPT_G_INVALID,
4707 .name = "write_hist_log",
4708 .lname = "Write latency histogram logs",
4709 .type = FIO_OPT_STR,
4710 .off1 = offsetof(struct thread_options, hist_log_file),
4711 .cb = str_write_hist_log_cb,
4712 .help = "Write log of latency histograms during run",
4713 .category = FIO_OPT_C_LOG,
4714 .group = FIO_OPT_G_INVALID,
4717 .name = "log_window_value",
4718 .alias = "log_max_value",
4719 .lname = "Log maximum, average or both values",
4720 .type = FIO_OPT_STR,
4721 .off1 = offsetof(struct thread_options, log_max),
4722 .help = "Log max, average or both sample in a window",
4724 .category = FIO_OPT_C_LOG,
4725 .group = FIO_OPT_G_INVALID,
4728 .oval = IO_LOG_SAMPLE_AVG,
4729 .help = "Log average value over the window",
4732 .oval = IO_LOG_SAMPLE_MAX,
4733 .help = "Log maximum value in the window",
4736 .oval = IO_LOG_SAMPLE_BOTH,
4737 .help = "Log both average and maximum values over the window"
4739 /* Compatibility with former boolean values */
4741 .oval = IO_LOG_SAMPLE_AVG,
4742 .help = "Alias for 'avg'",
4745 .oval = IO_LOG_SAMPLE_MAX,
4746 .help = "Alias for 'max'",
4751 .name = "log_offset",
4752 .lname = "Log offset of IO",
4753 .type = FIO_OPT_BOOL,
4754 .off1 = offsetof(struct thread_options, log_offset),
4755 .help = "Include offset of IO for each log entry",
4757 .category = FIO_OPT_C_LOG,
4758 .group = FIO_OPT_G_INVALID,
4762 .lname = "Log priority of IO",
4763 .type = FIO_OPT_BOOL,
4764 .off1 = offsetof(struct thread_options, log_prio),
4765 .help = "Include priority value of IO for each log entry",
4767 .category = FIO_OPT_C_LOG,
4768 .group = FIO_OPT_G_INVALID,
4771 .name = "log_issue_time",
4772 .lname = "Log IO issue time",
4773 .type = FIO_OPT_BOOL,
4774 .off1 = offsetof(struct thread_options, log_issue_time),
4775 .help = "Include IO issue time for each log entry",
4777 .category = FIO_OPT_C_LOG,
4778 .group = FIO_OPT_G_INVALID,
4782 .name = "log_compression",
4783 .lname = "Log compression",
4784 .type = FIO_OPT_INT,
4785 .off1 = offsetof(struct thread_options, log_gz),
4786 .help = "Log in compressed chunks of this size",
4788 .maxval = 512 * 1024 * 1024ULL,
4789 .category = FIO_OPT_C_LOG,
4790 .group = FIO_OPT_G_INVALID,
4792 #ifdef FIO_HAVE_CPU_AFFINITY
4794 .name = "log_compression_cpus",
4795 .lname = "Log Compression CPUs",
4796 .type = FIO_OPT_STR,
4797 .cb = str_log_cpus_allowed_cb,
4798 .off1 = offsetof(struct thread_options, log_gz_cpumask),
4799 .parent = "log_compression",
4800 .help = "Limit log compression to these CPUs",
4801 .category = FIO_OPT_C_LOG,
4802 .group = FIO_OPT_G_INVALID,
4806 .name = "log_compression_cpus",
4807 .lname = "Log Compression CPUs",
4808 .type = FIO_OPT_UNSUPPORTED,
4809 .help = "Your platform does not support CPU affinities",
4813 .name = "log_store_compressed",
4814 .lname = "Log store compressed",
4815 .type = FIO_OPT_BOOL,
4816 .off1 = offsetof(struct thread_options, log_gz_store),
4817 .help = "Store logs in a compressed format",
4818 .category = FIO_OPT_C_LOG,
4819 .group = FIO_OPT_G_INVALID,
4823 .name = "log_compression",
4824 .lname = "Log compression",
4825 .type = FIO_OPT_UNSUPPORTED,
4826 .help = "Install libz-dev(el) to get compression support",
4829 .name = "log_store_compressed",
4830 .lname = "Log store compressed",
4831 .type = FIO_OPT_UNSUPPORTED,
4832 .help = "Install libz-dev(el) to get compression support",
4836 .name = "log_alternate_epoch",
4837 .alias = "log_unix_epoch",
4838 .lname = "Log epoch alternate",
4839 .type = FIO_OPT_BOOL,
4840 .off1 = offsetof(struct thread_options, log_alternate_epoch),
4841 .help = "Use alternate epoch time in log files. Uses the same epoch as that is used by clock_gettime with specified log_alternate_epoch_clock_id.",
4842 .category = FIO_OPT_C_LOG,
4843 .group = FIO_OPT_G_INVALID,
4846 .name = "log_alternate_epoch_clock_id",
4847 .lname = "Log alternate epoch clock_id",
4848 .type = FIO_OPT_INT,
4849 .off1 = offsetof(struct thread_options, log_alternate_epoch_clock_id),
4850 .help = "If log_alternate_epoch is true, this option specifies the clock_id from clock_gettime whose epoch should be used. If log_alternate_epoch is false, this option has no effect. Default value is 0, or CLOCK_REALTIME",
4851 .category = FIO_OPT_C_LOG,
4852 .group = FIO_OPT_G_INVALID,
4855 .name = "block_error_percentiles",
4856 .lname = "Block error percentiles",
4857 .type = FIO_OPT_BOOL,
4858 .off1 = offsetof(struct thread_options, block_error_hist),
4859 .help = "Record trim block errors and make a histogram",
4861 .category = FIO_OPT_C_LOG,
4862 .group = FIO_OPT_G_INVALID,
4865 .name = "bwavgtime",
4866 .lname = "Bandwidth average time",
4867 .type = FIO_OPT_INT,
4868 .off1 = offsetof(struct thread_options, bw_avg_time),
4869 .help = "Time window over which to calculate bandwidth"
4872 .parent = "write_bw_log",
4875 .category = FIO_OPT_C_LOG,
4876 .group = FIO_OPT_G_INVALID,
4879 .name = "iopsavgtime",
4880 .lname = "IOPS average time",
4881 .type = FIO_OPT_INT,
4882 .off1 = offsetof(struct thread_options, iops_avg_time),
4883 .help = "Time window over which to calculate IOPS (msec)",
4885 .parent = "write_iops_log",
4888 .category = FIO_OPT_C_LOG,
4889 .group = FIO_OPT_G_INVALID,
4892 .name = "group_reporting",
4893 .lname = "Group reporting",
4894 .type = FIO_OPT_STR_SET,
4895 .off1 = offsetof(struct thread_options, group_reporting),
4896 .help = "Do reporting on a per-group basis",
4897 .category = FIO_OPT_C_STAT,
4898 .group = FIO_OPT_G_INVALID,
4903 .type = FIO_OPT_BOOL,
4904 .off1 = offsetof(struct thread_options, stats),
4905 .help = "Enable collection of stats",
4907 .category = FIO_OPT_C_STAT,
4908 .group = FIO_OPT_G_INVALID,
4911 .name = "zero_buffers",
4912 .lname = "Zero I/O buffers",
4913 .type = FIO_OPT_STR_SET,
4914 .off1 = offsetof(struct thread_options, zero_buffers),
4915 .help = "Init IO buffers to all zeroes",
4916 .category = FIO_OPT_C_IO,
4917 .group = FIO_OPT_G_IO_BUF,
4920 .name = "refill_buffers",
4921 .lname = "Refill I/O buffers",
4922 .type = FIO_OPT_STR_SET,
4923 .off1 = offsetof(struct thread_options, refill_buffers),
4924 .help = "Refill IO buffers on every IO submit",
4925 .category = FIO_OPT_C_IO,
4926 .group = FIO_OPT_G_IO_BUF,
4929 .name = "scramble_buffers",
4930 .lname = "Scramble I/O buffers",
4931 .type = FIO_OPT_BOOL,
4932 .off1 = offsetof(struct thread_options, scramble_buffers),
4933 .help = "Slightly scramble buffers on every IO submit",
4935 .category = FIO_OPT_C_IO,
4936 .group = FIO_OPT_G_IO_BUF,
4939 .name = "buffer_pattern",
4940 .lname = "Buffer pattern",
4941 .type = FIO_OPT_STR,
4942 .cb = str_buffer_pattern_cb,
4943 .off1 = offsetof(struct thread_options, buffer_pattern),
4944 .help = "Fill pattern for IO buffers",
4945 .category = FIO_OPT_C_IO,
4946 .group = FIO_OPT_G_IO_BUF,
4949 .name = "buffer_compress_percentage",
4950 .lname = "Buffer compression percentage",
4951 .type = FIO_OPT_INT,
4952 .cb = str_buffer_compress_cb,
4953 .off1 = offsetof(struct thread_options, compress_percentage),
4956 .help = "How compressible the buffer is (approximately)",
4958 .category = FIO_OPT_C_IO,
4959 .group = FIO_OPT_G_IO_BUF,
4962 .name = "buffer_compress_chunk",
4963 .lname = "Buffer compression chunk size",
4964 .type = FIO_OPT_INT,
4965 .off1 = offsetof(struct thread_options, compress_chunk),
4966 .parent = "buffer_compress_percentage",
4968 .help = "Size of compressible region in buffer",
4971 .category = FIO_OPT_C_IO,
4972 .group = FIO_OPT_G_IO_BUF,
4975 .name = "dedupe_percentage",
4976 .lname = "Dedupe percentage",
4977 .type = FIO_OPT_INT,
4978 .cb = str_dedupe_cb,
4979 .off1 = offsetof(struct thread_options, dedupe_percentage),
4982 .help = "Percentage of buffers that are dedupable",
4984 .category = FIO_OPT_C_IO,
4985 .group = FIO_OPT_G_IO_BUF,
4988 .name = "dedupe_global",
4989 .lname = "Global deduplication",
4990 .type = FIO_OPT_BOOL,
4991 .off1 = offsetof(struct thread_options, dedupe_global),
4992 .help = "Share deduplication buffers across jobs",
4994 .category = FIO_OPT_C_IO,
4995 .group = FIO_OPT_G_IO_BUF,
4998 .name = "dedupe_mode",
4999 .lname = "Dedupe mode",
5000 .help = "Mode for the deduplication buffer generation",
5001 .type = FIO_OPT_STR,
5002 .off1 = offsetof(struct thread_options, dedupe_mode),
5003 .parent = "dedupe_percentage",
5005 .category = FIO_OPT_C_IO,
5006 .group = FIO_OPT_G_IO_BUF,
5009 .oval = DEDUPE_MODE_REPEAT,
5010 .help = "repeat previous page",
5012 { .ival = "working_set",
5013 .oval = DEDUPE_MODE_WORKING_SET,
5014 .help = "choose a page randomly from limited working set defined in dedupe_working_set_percentage",
5019 .name = "dedupe_working_set_percentage",
5020 .lname = "Dedupe working set percentage",
5021 .help = "Dedupe working set size in percentages from file or device size used to generate dedupe patterns from",
5022 .type = FIO_OPT_INT,
5023 .off1 = offsetof(struct thread_options, dedupe_working_set_percentage),
5024 .parent = "dedupe_percentage",
5028 .category = FIO_OPT_C_IO,
5029 .group = FIO_OPT_G_IO_BUF,
5032 .name = "clat_percentiles",
5033 .lname = "Completion latency percentiles",
5034 .type = FIO_OPT_BOOL,
5035 .off1 = offsetof(struct thread_options, clat_percentiles),
5036 .help = "Enable the reporting of completion latency percentiles",
5038 .category = FIO_OPT_C_STAT,
5039 .group = FIO_OPT_G_INVALID,
5042 .name = "lat_percentiles",
5043 .lname = "IO latency percentiles",
5044 .type = FIO_OPT_BOOL,
5045 .off1 = offsetof(struct thread_options, lat_percentiles),
5046 .help = "Enable the reporting of IO latency percentiles",
5048 .category = FIO_OPT_C_STAT,
5049 .group = FIO_OPT_G_INVALID,
5052 .name = "slat_percentiles",
5053 .lname = "Submission latency percentiles",
5054 .type = FIO_OPT_BOOL,
5055 .off1 = offsetof(struct thread_options, slat_percentiles),
5056 .help = "Enable the reporting of submission latency percentiles",
5058 .category = FIO_OPT_C_STAT,
5059 .group = FIO_OPT_G_INVALID,
5062 .name = "percentile_list",
5063 .lname = "Percentile list",
5064 .type = FIO_OPT_FLOAT_LIST,
5065 .off1 = offsetof(struct thread_options, percentile_list),
5066 .off2 = offsetof(struct thread_options, percentile_precision),
5067 .help = "Specify a custom list of percentiles to report for "
5068 "completion latency and block errors",
5069 .def = "1:5:10:20:30:40:50:60:70:80:90:95:99:99.5:99.9:99.95:99.99",
5070 .maxlen = FIO_IO_U_LIST_MAX_LEN,
5073 .category = FIO_OPT_C_STAT,
5074 .group = FIO_OPT_G_INVALID,
5077 .name = "significant_figures",
5078 .lname = "Significant figures",
5079 .type = FIO_OPT_INT,
5080 .off1 = offsetof(struct thread_options, sig_figs),
5083 .help = "Significant figures for output-format set to normal",
5086 .category = FIO_OPT_C_STAT,
5087 .group = FIO_OPT_G_INVALID,
5090 #ifdef FIO_HAVE_DISK_UTIL
5092 .name = "disk_util",
5093 .lname = "Disk utilization",
5094 .type = FIO_OPT_BOOL,
5095 .off1 = offsetof(struct thread_options, do_disk_util),
5096 .help = "Log disk utilization statistics",
5098 .category = FIO_OPT_C_STAT,
5099 .group = FIO_OPT_G_INVALID,
5103 .name = "disk_util",
5104 .lname = "Disk utilization",
5105 .type = FIO_OPT_UNSUPPORTED,
5106 .help = "Your platform does not support disk utilization",
5110 .name = "gtod_reduce",
5111 .lname = "Reduce gettimeofday() calls",
5112 .type = FIO_OPT_BOOL,
5113 .help = "Greatly reduce number of gettimeofday() calls",
5114 .cb = str_gtod_reduce_cb,
5117 .category = FIO_OPT_C_STAT,
5118 .group = FIO_OPT_G_INVALID,
5121 .name = "disable_lat",
5122 .lname = "Disable all latency stats",
5123 .type = FIO_OPT_BOOL,
5124 .off1 = offsetof(struct thread_options, disable_lat),
5125 .help = "Disable latency numbers",
5126 .parent = "gtod_reduce",
5129 .category = FIO_OPT_C_STAT,
5130 .group = FIO_OPT_G_INVALID,
5133 .name = "disable_clat",
5134 .lname = "Disable completion latency stats",
5135 .type = FIO_OPT_BOOL,
5136 .off1 = offsetof(struct thread_options, disable_clat),
5137 .help = "Disable completion latency numbers",
5138 .parent = "gtod_reduce",
5141 .category = FIO_OPT_C_STAT,
5142 .group = FIO_OPT_G_INVALID,
5145 .name = "disable_slat",
5146 .lname = "Disable submission latency stats",
5147 .type = FIO_OPT_BOOL,
5148 .off1 = offsetof(struct thread_options, disable_slat),
5149 .help = "Disable submission latency numbers",
5150 .parent = "gtod_reduce",
5153 .category = FIO_OPT_C_STAT,
5154 .group = FIO_OPT_G_INVALID,
5157 .name = "disable_bw_measurement",
5158 .alias = "disable_bw",
5159 .lname = "Disable bandwidth stats",
5160 .type = FIO_OPT_BOOL,
5161 .off1 = offsetof(struct thread_options, disable_bw),
5162 .help = "Disable bandwidth logging",
5163 .parent = "gtod_reduce",
5166 .category = FIO_OPT_C_STAT,
5167 .group = FIO_OPT_G_INVALID,
5171 .lname = "Dedicated gettimeofday() CPU",
5172 .type = FIO_OPT_INT,
5173 .off1 = offsetof(struct thread_options, gtod_cpu),
5174 .help = "Set up dedicated gettimeofday() thread on this CPU",
5175 .verify = gtod_cpu_verify,
5176 .category = FIO_OPT_C_GENERAL,
5177 .group = FIO_OPT_G_CLOCK,
5180 .name = "job_start_clock_id",
5181 .lname = "Job start clock_id",
5182 .type = FIO_OPT_INT,
5183 .off1 = offsetof(struct thread_options, job_start_clock_id),
5184 .help = "The clock_id passed to the call to clock_gettime used to record job_start in the json output format. Default is 0, or CLOCK_REALTIME",
5185 .verify = gtod_cpu_verify,
5186 .category = FIO_OPT_C_GENERAL,
5187 .group = FIO_OPT_G_CLOCK,
5190 .name = "unified_rw_reporting",
5191 .lname = "Unified RW Reporting",
5192 .type = FIO_OPT_STR,
5193 .off1 = offsetof(struct thread_options, unified_rw_rep),
5194 .help = "Unify reporting across data direction",
5196 .category = FIO_OPT_C_GENERAL,
5197 .group = FIO_OPT_G_INVALID,
5200 .oval = UNIFIED_SPLIT,
5201 .help = "Normal statistics reporting",
5204 .oval = UNIFIED_MIXED,
5205 .help = "Statistics are summed per data direction and reported together",
5208 .oval = UNIFIED_BOTH,
5209 .help = "Statistics are reported normally, followed by the mixed statistics"
5211 /* Compatibility with former boolean values */
5213 .oval = UNIFIED_SPLIT,
5214 .help = "Alias for 'none'",
5217 .oval = UNIFIED_MIXED,
5218 .help = "Alias for 'mixed'",
5221 .oval = UNIFIED_BOTH,
5222 .help = "Alias for 'both'",
5227 .name = "continue_on_error",
5228 .lname = "Continue on error",
5229 .type = FIO_OPT_STR,
5230 .off1 = offsetof(struct thread_options, continue_on_error),
5231 .help = "Continue on non-fatal errors during IO",
5233 .category = FIO_OPT_C_GENERAL,
5234 .group = FIO_OPT_G_ERR,
5237 .oval = ERROR_TYPE_NONE,
5238 .help = "Exit when an error is encountered",
5241 .oval = ERROR_TYPE_READ,
5242 .help = "Continue on read errors only",
5245 .oval = ERROR_TYPE_WRITE,
5246 .help = "Continue on write errors only",
5249 .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE,
5250 .help = "Continue on any IO errors",
5253 .oval = ERROR_TYPE_VERIFY,
5254 .help = "Continue on verify errors only",
5257 .oval = ERROR_TYPE_ANY,
5258 .help = "Continue on all io and verify errors",
5261 .oval = ERROR_TYPE_NONE,
5262 .help = "Alias for 'none'",
5265 .oval = ERROR_TYPE_ANY,
5266 .help = "Alias for 'all'",
5271 .name = "ignore_error",
5272 .lname = "Ignore Error",
5273 .type = FIO_OPT_STR,
5274 .cb = str_ignore_error_cb,
5275 .off1 = offsetof(struct thread_options, ignore_error_nr),
5276 .help = "Set a specific list of errors to ignore",
5278 .category = FIO_OPT_C_GENERAL,
5279 .group = FIO_OPT_G_ERR,
5282 .name = "error_dump",
5283 .lname = "Error Dump",
5284 .type = FIO_OPT_BOOL,
5285 .off1 = offsetof(struct thread_options, error_dump),
5287 .help = "Dump info on each error",
5288 .category = FIO_OPT_C_GENERAL,
5289 .group = FIO_OPT_G_ERR,
5294 .type = FIO_OPT_STR_STORE,
5295 .off1 = offsetof(struct thread_options, profile),
5296 .help = "Select a specific builtin performance test",
5297 .category = FIO_OPT_C_PROFILE,
5298 .group = FIO_OPT_G_INVALID,
5303 .type = FIO_OPT_STR_STORE,
5304 .off1 = offsetof(struct thread_options, cgroup),
5305 .help = "Add job to cgroup of this name",
5306 .category = FIO_OPT_C_GENERAL,
5307 .group = FIO_OPT_G_CGROUP,
5310 .name = "cgroup_nodelete",
5311 .lname = "Cgroup no-delete",
5312 .type = FIO_OPT_BOOL,
5313 .off1 = offsetof(struct thread_options, cgroup_nodelete),
5314 .help = "Do not delete cgroups after job completion",
5317 .category = FIO_OPT_C_GENERAL,
5318 .group = FIO_OPT_G_CGROUP,
5321 .name = "cgroup_weight",
5322 .lname = "Cgroup weight",
5323 .type = FIO_OPT_INT,
5324 .off1 = offsetof(struct thread_options, cgroup_weight),
5325 .help = "Use given weight for cgroup",
5329 .category = FIO_OPT_C_GENERAL,
5330 .group = FIO_OPT_G_CGROUP,
5335 .type = FIO_OPT_INT,
5336 .off1 = offsetof(struct thread_options, uid),
5337 .help = "Run job with this user ID",
5338 .category = FIO_OPT_C_GENERAL,
5339 .group = FIO_OPT_G_CRED,
5343 .lname = "Group ID",
5344 .type = FIO_OPT_INT,
5345 .off1 = offsetof(struct thread_options, gid),
5346 .help = "Run job with this group ID",
5347 .category = FIO_OPT_C_GENERAL,
5348 .group = FIO_OPT_G_CRED,
5353 .type = FIO_OPT_STR,
5354 .off1 = offsetof(struct thread_options, kb_base),
5360 .help = "Inputs invert IEC and SI prefixes (for compatibility); outputs prefer binary",
5364 .help = "Inputs use IEC and SI prefixes; outputs prefer SI",
5367 .help = "Unit prefix interpretation for quantities of data (IEC and SI)",
5368 .category = FIO_OPT_C_GENERAL,
5369 .group = FIO_OPT_G_INVALID,
5372 .name = "unit_base",
5373 .lname = "Unit for quantities of data (Bits or Bytes)",
5374 .type = FIO_OPT_STR,
5375 .off1 = offsetof(struct thread_options, unit_base),
5380 .help = "Auto-detect",
5383 .oval = N2S_BYTEPERSEC,
5384 .help = "Normal (byte based)",
5387 .oval = N2S_BITPERSEC,
5388 .help = "Bit based",
5391 .help = "Bit multiple of result summary data (8 for byte, 1 for bit)",
5392 .category = FIO_OPT_C_GENERAL,
5393 .group = FIO_OPT_G_INVALID,
5396 .name = "hugepage-size",
5397 .lname = "Hugepage size",
5398 .type = FIO_OPT_INT,
5399 .off1 = offsetof(struct thread_options, hugepage_size),
5400 .help = "When using hugepages, specify size of each page",
5401 .def = __fio_stringify(FIO_HUGE_PAGE),
5402 .interval = 1024 * 1024,
5403 .category = FIO_OPT_C_GENERAL,
5404 .group = FIO_OPT_G_INVALID,
5408 .lname = "I/O flow ID",
5409 .type = FIO_OPT_INT,
5410 .off1 = offsetof(struct thread_options, flow_id),
5411 .help = "The flow index ID to use",
5413 .category = FIO_OPT_C_IO,
5414 .group = FIO_OPT_G_IO_FLOW,
5418 .lname = "I/O flow weight",
5419 .type = FIO_OPT_INT,
5420 .off1 = offsetof(struct thread_options, flow),
5421 .help = "Weight for flow control of this job",
5422 .parent = "flow_id",
5425 .maxval = FLOW_MAX_WEIGHT,
5426 .category = FIO_OPT_C_IO,
5427 .group = FIO_OPT_G_IO_FLOW,
5430 .name = "flow_watermark",
5431 .lname = "I/O flow watermark",
5432 .type = FIO_OPT_SOFT_DEPRECATED,
5433 .category = FIO_OPT_C_IO,
5434 .group = FIO_OPT_G_IO_FLOW,
5437 .name = "flow_sleep",
5438 .lname = "I/O flow sleep",
5439 .type = FIO_OPT_INT,
5440 .off1 = offsetof(struct thread_options, flow_sleep),
5441 .help = "How many microseconds to sleep after being held"
5442 " back by the flow control mechanism",
5443 .parent = "flow_id",
5446 .category = FIO_OPT_C_IO,
5447 .group = FIO_OPT_G_IO_FLOW,
5450 .name = "steadystate",
5451 .lname = "Steady state threshold",
5453 .type = FIO_OPT_STR,
5454 .off1 = offsetof(struct thread_options, ss_state),
5455 .cb = str_steadystate_cb,
5456 .help = "Define the criterion and limit to judge when a job has reached steady state",
5457 .def = "iops_slope:0.01%",
5460 .oval = FIO_SS_IOPS,
5461 .help = "maximum mean deviation of IOPS measurements",
5463 { .ival = "iops_slope",
5464 .oval = FIO_SS_IOPS_SLOPE,
5465 .help = "slope calculated from IOPS measurements",
5469 .help = "maximum mean deviation of bandwidth measurements",
5473 .oval = FIO_SS_BW_SLOPE,
5474 .help = "slope calculated from bandwidth measurements",
5477 .category = FIO_OPT_C_GENERAL,
5478 .group = FIO_OPT_G_RUNTIME,
5481 .name = "steadystate_duration",
5482 .lname = "Steady state duration",
5484 .parent = "steadystate",
5485 .type = FIO_OPT_STR_VAL_TIME,
5486 .off1 = offsetof(struct thread_options, ss_dur),
5487 .help = "Stop workload upon attaining steady state for specified duration",
5491 .category = FIO_OPT_C_GENERAL,
5492 .group = FIO_OPT_G_RUNTIME,
5495 .name = "steadystate_ramp_time",
5496 .lname = "Steady state ramp time",
5498 .parent = "steadystate",
5499 .type = FIO_OPT_STR_VAL_TIME,
5500 .off1 = offsetof(struct thread_options, ss_ramp_time),
5501 .help = "Delay before initiation of data collection for steady state job termination testing",
5505 .category = FIO_OPT_C_GENERAL,
5506 .group = FIO_OPT_G_RUNTIME,
5509 .name = "steadystate_check_interval",
5510 .lname = "Steady state check interval",
5511 .alias = "ss_interval",
5512 .parent = "steadystate",
5513 .type = FIO_OPT_STR_VAL_TIME,
5514 .off1 = offsetof(struct thread_options, ss_check_interval),
5515 .help = "Polling interval for the steady state check (too low means steadystate will not converge)",
5519 .category = FIO_OPT_C_GENERAL,
5520 .group = FIO_OPT_G_RUNTIME,
5527 static void add_to_lopt(struct option *lopt, struct fio_option *o,
5528 const char *name, int val)
5530 lopt->name = (char *) name;
5532 if (o->type == FIO_OPT_STR_SET)
5533 lopt->has_arg = optional_argument;
5535 lopt->has_arg = required_argument;
5538 static void options_to_lopts(struct fio_option *opts,
5539 struct option *long_options,
5540 int i, int option_type)
5542 struct fio_option *o = &opts[0];
5544 add_to_lopt(&long_options[i], o, o->name, option_type);
5547 add_to_lopt(&long_options[i], o, o->alias, option_type);
5552 assert(i < FIO_NR_OPTIONS);
5556 void fio_options_set_ioengine_opts(struct option *long_options,
5557 struct thread_data *td)
5562 while (long_options[i].name) {
5563 if (long_options[i].val == FIO_GETOPT_IOENGINE) {
5564 memset(&long_options[i], 0, sizeof(*long_options));
5571 * Just clear out the prior ioengine options.
5576 options_to_lopts(td->io_ops->options, long_options, i,
5577 FIO_GETOPT_IOENGINE);
5580 void fio_options_dup_and_init(struct option *long_options)
5584 options_init(fio_options);
5587 while (long_options[i].name)
5590 options_to_lopts(fio_options, long_options, i, FIO_GETOPT_JOB);
5593 struct fio_keyword {
5599 static struct fio_keyword fio_keywords[] = {
5601 .word = "$pagesize",
5602 .desc = "Page size in the system",
5605 .word = "$mb_memory",
5606 .desc = "Megabytes of memory online",
5610 .desc = "Number of CPUs online in the system",
5617 void fio_keywords_exit(void)
5619 struct fio_keyword *kw;
5621 kw = &fio_keywords[0];
5629 void fio_keywords_init(void)
5631 unsigned long long mb_memory;
5635 sprintf(buf, "%lu", (unsigned long) page_size);
5636 fio_keywords[0].replace = strdup(buf);
5638 mb_memory = os_phys_mem() / (1024 * 1024);
5639 sprintf(buf, "%llu", mb_memory);
5640 fio_keywords[1].replace = strdup(buf);
5642 l = cpus_configured();
5643 sprintf(buf, "%lu", l);
5644 fio_keywords[2].replace = strdup(buf);
5649 static char *bc_calc(char *str)
5651 char buf[128], *tmp;
5656 * No math, just return string
5658 if ((!strchr(str, '+') && !strchr(str, '-') && !strchr(str, '*') &&
5659 !strchr(str, '/')) || strchr(str, '\''))
5663 * Split option from value, we only need to calculate the value
5665 tmp = strchr(str, '=');
5672 * Prevent buffer overflows; such a case isn't reasonable anyway
5674 if (strlen(str) >= 128 || strlen(tmp) > 100)
5677 sprintf(buf, "which %s > /dev/null", BC_APP);
5679 log_err("fio: bc is needed for performing math\n");
5683 sprintf(buf, "echo '%s' | %s", tmp, BC_APP);
5684 f = popen(buf, "r");
5688 ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f);
5695 buf[(tmp - str) + ret - 1] = '\0';
5696 memcpy(buf, str, tmp - str);
5702 * Return a copy of the input string with substrings of the form ${VARNAME}
5703 * substituted with the value of the environment variable VARNAME. The
5704 * substitution always occurs, even if VARNAME is empty or the corresponding
5705 * environment variable undefined.
5707 char *fio_option_dup_subs(const char *opt)
5709 char out[OPT_LEN_MAX+1];
5710 char in[OPT_LEN_MAX+1];
5713 char *ch1, *ch2, *env;
5714 ssize_t nchr = OPT_LEN_MAX;
5717 if (strlen(opt) + 1 > OPT_LEN_MAX) {
5718 log_err("OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX);
5722 snprintf(in, sizeof(in), "%s", opt);
5724 while (*inptr && nchr > 0) {
5725 if (inptr[0] == '$' && inptr[1] == '{') {
5726 ch2 = strchr(inptr, '}');
5727 if (ch2 && inptr+1 < ch2) {
5734 envlen = strlen(env);
5735 if (envlen <= nchr) {
5736 memcpy(outptr, env, envlen);
5746 *outptr++ = *inptr++;
5755 * Look for reserved variable names and replace them with real values
5757 static char *fio_keyword_replace(char *opt)
5763 for (i = 0; fio_keywords[i].word != NULL; i++) {
5764 struct fio_keyword *kw = &fio_keywords[i];
5766 while ((s = strstr(opt, kw->word)) != NULL) {
5767 char *new = calloc(strlen(opt) + 1, 1);
5773 * Copy part of the string before the keyword and
5774 * sprintf() the replacement after it.
5776 memcpy(new, opt, olen);
5777 len = sprintf(new + olen, "%s", kw->replace);
5780 * If there's more in the original string, copy that
5783 opt += olen + strlen(kw->word);
5784 /* keeps final zero thanks to calloc */
5786 memcpy(new + olen + len, opt, strlen(opt));
5789 * replace opt and free the old opt
5799 * Check for potential math and invoke bc, if possible
5807 static char **dup_and_sub_options(char **opts, int num_opts)
5810 char **opts_copy = malloc(num_opts * sizeof(*opts));
5811 for (i = 0; i < num_opts; i++) {
5812 opts_copy[i] = fio_option_dup_subs(opts[i]);
5815 opts_copy[i] = fio_keyword_replace(opts_copy[i]);
5820 static void show_closest_option(const char *opt)
5822 int best_option, best_distance;
5831 while (name[i] != '\0' && name[i] != '=')
5836 best_distance = INT_MAX;
5838 while (fio_options[i].name) {
5839 distance = string_distance(name, fio_options[i].name);
5840 if (distance < best_distance) {
5841 best_distance = distance;
5847 if (best_option != -1 && string_distance_ok(name, best_distance) &&
5848 fio_options[best_option].type != FIO_OPT_UNSUPPORTED)
5849 log_err("Did you mean %s?\n", fio_options[best_option].name);
5854 int fio_options_parse(struct thread_data *td, char **opts, int num_opts)
5856 int i, ret, unknown;
5859 sort_options(opts, fio_options, num_opts);
5860 opts_copy = dup_and_sub_options(opts, num_opts);
5862 for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) {
5863 const struct fio_option *o;
5864 int newret = parse_option(opts_copy[i], opts[i], fio_options,
5865 &o, &td->o, &td->opt_list);
5868 fio_option_mark_set(&td->o, o);
5876 opts_copy[i] = NULL;
5883 ret |= ioengine_load(td);
5885 sort_options(opts_copy, td->io_ops->options, num_opts);
5888 for (i = 0; i < num_opts; i++) {
5889 const struct fio_option *o = NULL;
5896 newret = parse_option(opts_copy[i], opts[i],
5897 td->io_ops->options, &o,
5898 td->eo, &td->opt_list);
5902 log_err("Bad option <%s>\n", opts[i]);
5903 show_closest_option(opts[i]);
5906 opts_copy[i] = NULL;
5914 int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val)
5918 ret = parse_cmd_option(opt, val, fio_options, &td->o, &td->opt_list);
5920 const struct fio_option *o;
5922 o = find_option_c(fio_options, opt);
5924 fio_option_mark_set(&td->o, o);
5930 int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt,
5933 return parse_cmd_option(opt, val, td->io_ops->options, td->eo,
5937 void fio_fill_default_options(struct thread_data *td)
5939 td->o.magic = OPT_MAGIC;
5940 fill_default_options(&td->o, fio_options);
5943 int fio_show_option_help(const char *opt)
5945 return show_cmd_help(fio_options, opt);
5949 * dupe FIO_OPT_STR_STORE options
5951 void fio_options_mem_dupe(struct thread_data *td)
5953 options_mem_dupe(fio_options, &td->o);
5955 if (td->eo && td->io_ops) {
5956 void *oldeo = td->eo;
5958 td->eo = malloc(td->io_ops->option_struct_size);
5959 memcpy(td->eo, oldeo, td->io_ops->option_struct_size);
5960 options_mem_dupe(td->io_ops->options, td->eo);
5964 unsigned int fio_get_kb_base(void *data)
5966 struct thread_data *td = cb_data_to_td(data);
5967 struct thread_options *o = &td->o;
5968 unsigned int kb_base = 0;
5971 * This is a hack... For private options, *data is not holding
5972 * a pointer to the thread_options, but to private data. This means
5973 * we can't safely dereference it, but magic is first so mem wise
5974 * it is valid. But this also means that if the job first sets
5975 * kb_base and expects that to be honored by private options,
5976 * it will be disappointed. We will return the global default
5979 if (o && o->magic == OPT_MAGIC)
5980 kb_base = o->kb_base;
5987 int add_option(const struct fio_option *o)
5989 struct fio_option *__o;
5998 if (opt_index + 1 == FIO_MAX_OPTS) {
5999 log_err("fio: FIO_MAX_OPTS is too small\n");
6003 memcpy(&fio_options[opt_index], o, sizeof(*o));
6004 fio_options[opt_index + 1].name = NULL;
6008 void invalidate_profile_options(const char *prof_name)
6010 struct fio_option *o;
6014 if (o->prof_name && !strcmp(o->prof_name, prof_name)) {
6015 o->type = FIO_OPT_INVALID;
6016 o->prof_name = NULL;
6022 void add_opt_posval(const char *optname, const char *ival, const char *help)
6024 struct fio_option *o;
6027 o = find_option(fio_options, optname);
6031 for (i = 0; i < PARSE_MAX_VP; i++) {
6032 if (o->posval[i].ival)
6035 o->posval[i].ival = ival;
6036 o->posval[i].help = help;
6041 void del_opt_posval(const char *optname, const char *ival)
6043 struct fio_option *o;
6046 o = find_option(fio_options, optname);
6050 for (i = 0; i < PARSE_MAX_VP; i++) {
6051 if (!o->posval[i].ival)
6053 if (strcmp(o->posval[i].ival, ival))
6056 o->posval[i].ival = NULL;
6057 o->posval[i].help = NULL;
6061 void fio_options_free(struct thread_data *td)
6063 options_free(fio_options, &td->o);
6064 if (td->eo && td->io_ops && td->io_ops->options) {
6065 options_free(td->io_ops->options, td->eo);
6071 void fio_dump_options_free(struct thread_data *td)
6073 while (!flist_empty(&td->opt_list)) {
6074 struct print_option *p;
6076 p = flist_first_entry(&td->opt_list, struct print_option, list);
6077 flist_del_init(&p->list);
6084 struct fio_option *fio_option_find(const char *name)
6086 return find_option(fio_options, name);
6089 static struct fio_option *find_next_opt(struct fio_option *from,
6092 struct fio_option *opt;
6095 from = &fio_options[0];
6101 if (off1 == from->off1) {
6106 } while (from->name);
6111 static int opt_is_set(struct thread_options *o, struct fio_option *opt)
6113 unsigned int opt_off, index, offset;
6115 opt_off = opt - &fio_options[0];
6116 index = opt_off / (8 * sizeof(uint64_t));
6117 offset = opt_off & ((8 * sizeof(uint64_t)) - 1);
6118 return (o->set_options[index] & ((uint64_t)1 << offset)) != 0;
6121 bool __fio_option_is_set(struct thread_options *o, unsigned int off1)
6123 struct fio_option *opt, *next;
6126 while ((opt = find_next_opt(next, off1)) != NULL) {
6127 if (opt_is_set(o, opt))
6136 void fio_option_mark_set(struct thread_options *o, const struct fio_option *opt)
6138 unsigned int opt_off, index, offset;
6140 opt_off = opt - &fio_options[0];
6141 index = opt_off / (8 * sizeof(uint64_t));
6142 offset = opt_off & ((8 * sizeof(uint64_t)) - 1);
6143 o->set_options[index] |= (uint64_t)1 << offset;