8 #include <netinet/in.h>
13 #include "lib/pattern.h"
18 char client_sockaddr_str[INET6_ADDRSTRLEN] = { 0 };
20 #define cb_data_to_td(data) container_of(data, struct thread_data, o)
22 static const struct pattern_fmt_desc fmt_desc[] = {
25 .len = FIO_FIELD_SIZE(struct io_u *, offset),
26 .paste = paste_blockoff
32 * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that.
34 static char *get_opt_postfix(const char *str)
36 char *p = strstr(str, ":");
42 strip_blank_front(&p);
47 static bool split_parse_distr(const char *str, double *val, double *center)
61 r = str_to_float(cp, center, 0);
63 r = r && str_to_float(p, val, 0);
68 static int bs_cmp(const void *p1, const void *p2)
70 const struct bssplit *bsp1 = p1;
71 const struct bssplit *bsp2 = p2;
73 return (int) bsp1->perc - (int) bsp2->perc;
78 unsigned long long val1[ZONESPLIT_MAX];
79 unsigned long long val2[ZONESPLIT_MAX];
82 static int split_parse_ddir(struct thread_options *o, struct split *split,
83 char *str, bool absolute, unsigned int max_splits)
85 unsigned long long perc;
93 while ((fname = strsep(&str, ":")) != NULL) {
99 perc_str = strstr(fname, "/");
104 if (str_to_decimal(perc_str, &val, 1, o, 0, 0)) {
105 log_err("fio: split conversion failed\n");
110 perc = atoi(perc_str);
123 if (str_to_decimal(fname, &val, 1, o, 0, 0)) {
124 log_err("fio: split conversion failed\n");
128 split->val1[i] = val;
129 split->val2[i] = perc;
131 if (i == max_splits) {
132 log_err("fio: hit max of %d split entries\n", i);
141 static int bssplit_ddir(struct thread_options *o, enum fio_ddir ddir, char *str,
144 unsigned int i, perc, perc_missing;
145 unsigned long long max_bs, min_bs;
148 memset(&split, 0, sizeof(split));
150 if (split_parse_ddir(o, &split, str, data, BSSPLIT_MAX))
157 o->bssplit[ddir] = malloc(split.nr * sizeof(struct bssplit));
158 o->bssplit_nr[ddir] = split.nr;
159 for (i = 0; i < split.nr; i++) {
160 if (split.val1[i] > max_bs)
161 max_bs = split.val1[i];
162 if (split.val1[i] < min_bs)
163 min_bs = split.val1[i];
165 o->bssplit[ddir][i].bs = split.val1[i];
166 o->bssplit[ddir][i].perc =split.val2[i];
170 * Now check if the percentages add up, and how much is missing
172 perc = perc_missing = 0;
173 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
174 struct bssplit *bsp = &o->bssplit[ddir][i];
176 if (bsp->perc == -1U)
182 if (perc > 100 && perc_missing > 1) {
183 log_err("fio: bssplit percentages add to more than 100%%\n");
184 free(o->bssplit[ddir]);
185 o->bssplit[ddir] = NULL;
190 * If values didn't have a percentage set, divide the remains between
194 if (perc_missing == 1 && o->bssplit_nr[ddir] == 1)
196 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
197 struct bssplit *bsp = &o->bssplit[ddir][i];
199 if (bsp->perc == -1U)
200 bsp->perc = (100 - perc) / perc_missing;
204 o->min_bs[ddir] = min_bs;
205 o->max_bs[ddir] = max_bs;
208 * now sort based on percentages, for ease of lookup
210 qsort(o->bssplit[ddir], o->bssplit_nr[ddir], sizeof(struct bssplit), bs_cmp);
214 typedef int (split_parse_fn)(struct thread_options *, enum fio_ddir, char *, bool);
216 static int str_split_parse(struct thread_data *td, char *str,
217 split_parse_fn *fn, bool data)
222 odir = strchr(str, ',');
224 ddir = strchr(odir + 1, ',');
226 ret = fn(&td->o, DDIR_TRIM, ddir + 1, data);
232 op = strdup(odir + 1);
233 ret = fn(&td->o, DDIR_TRIM, op, data);
238 ret = fn(&td->o, DDIR_WRITE, odir + 1, data);
241 ret = fn(&td->o, DDIR_READ, str, data);
247 ret = fn(&td->o, DDIR_WRITE, op, data);
252 ret = fn(&td->o, DDIR_TRIM, op, data);
256 ret = fn(&td->o, DDIR_READ, str, data);
262 static int str_bssplit_cb(void *data, const char *input)
264 struct thread_data *td = cb_data_to_td(data);
268 p = str = strdup(input);
270 strip_blank_front(&str);
271 strip_blank_end(str);
273 ret = str_split_parse(td, str, bssplit_ddir, false);
275 if (parse_dryrun()) {
278 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
279 free(td->o.bssplit[i]);
280 td->o.bssplit[i] = NULL;
281 td->o.bssplit_nr[i] = 0;
289 static int str2error(char *str)
291 const char *err[] = { "EPERM", "ENOENT", "ESRCH", "EINTR", "EIO",
292 "ENXIO", "E2BIG", "ENOEXEC", "EBADF",
293 "ECHILD", "EAGAIN", "ENOMEM", "EACCES",
294 "EFAULT", "ENOTBLK", "EBUSY", "EEXIST",
295 "EXDEV", "ENODEV", "ENOTDIR", "EISDIR",
296 "EINVAL", "ENFILE", "EMFILE", "ENOTTY",
297 "ETXTBSY","EFBIG", "ENOSPC", "ESPIPE",
298 "EROFS","EMLINK", "EPIPE", "EDOM", "ERANGE" };
299 int i = 0, num = sizeof(err) / sizeof(char *);
302 if (!strcmp(err[i], str))
309 static int ignore_error_type(struct thread_data *td, enum error_type_bit etype,
316 if (etype >= ERROR_TYPE_CNT) {
317 log_err("Illegal error type\n");
321 td->o.ignore_error_nr[etype] = 4;
322 error = calloc(4, sizeof(int));
325 while ((fname = strsep(&str, ":")) != NULL) {
331 * grow struct buffer, if needed
333 if (i == td->o.ignore_error_nr[etype]) {
334 td->o.ignore_error_nr[etype] <<= 1;
335 error = realloc(error, td->o.ignore_error_nr[etype]
338 if (fname[0] == 'E') {
339 error[i] = str2error(fname);
341 error[i] = atoi(fname);
343 error[i] = -error[i];
346 log_err("Unknown error %s, please use number value\n",
348 td->o.ignore_error_nr[etype] = 0;
355 td->o.continue_on_error |= 1 << etype;
356 td->o.ignore_error_nr[etype] = i;
357 td->o.ignore_error[etype] = error;
359 td->o.ignore_error_nr[etype] = 0;
367 static int str_replay_skip_cb(void *data, const char *input)
369 struct thread_data *td = cb_data_to_td(data);
376 p = str = strdup(input);
378 strip_blank_front(&str);
379 strip_blank_end(str);
385 if (!strcmp(p, "read"))
386 td->o.replay_skip |= 1u << DDIR_READ;
387 else if (!strcmp(p, "write"))
388 td->o.replay_skip |= 1u << DDIR_WRITE;
389 else if (!strcmp(p, "trim"))
390 td->o.replay_skip |= 1u << DDIR_TRIM;
391 else if (!strcmp(p, "sync"))
392 td->o.replay_skip |= 1u << DDIR_SYNC;
394 log_err("Unknown skip type: %s\n", p);
404 static int str_ignore_error_cb(void *data, const char *input)
406 struct thread_data *td = cb_data_to_td(data);
409 enum error_type_bit type = 0;
414 p = str = strdup(input);
416 strip_blank_front(&str);
417 strip_blank_end(str);
423 ret = ignore_error_type(td, type, p);
433 static int str_rw_cb(void *data, const char *str)
435 struct thread_data *td = cb_data_to_td(data);
436 struct thread_options *o = &td->o;
445 nr = get_opt_postfix(str);
450 o->ddir_seq_nr = atoi(nr);
454 if (str_to_decimal(nr, &val, 1, o, 0, 0)) {
455 log_err("fio: rw postfix parsing failed\n");
460 o->ddir_seq_add = val;
467 static int str_mem_cb(void *data, const char *mem)
469 struct thread_data *td = cb_data_to_td(data);
471 if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP ||
472 td->o.mem_type == MEM_MMAPSHARED)
473 td->o.mmapfile = get_opt_postfix(mem);
478 static int fio_clock_source_cb(void *data, const char *str)
480 struct thread_data *td = cb_data_to_td(data);
482 fio_clock_source = td->o.clocksource;
483 fio_clock_source_set = 1;
488 static int str_rwmix_read_cb(void *data, unsigned long long *val)
490 struct thread_data *td = cb_data_to_td(data);
492 td->o.rwmix[DDIR_READ] = *val;
493 td->o.rwmix[DDIR_WRITE] = 100 - *val;
497 static int str_rwmix_write_cb(void *data, unsigned long long *val)
499 struct thread_data *td = cb_data_to_td(data);
501 td->o.rwmix[DDIR_WRITE] = *val;
502 td->o.rwmix[DDIR_READ] = 100 - *val;
506 static int str_exitall_cb(void)
508 exitall_on_terminate = true;
512 #ifdef FIO_HAVE_CPU_AFFINITY
513 int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index)
515 unsigned int i, index, cpus_in_mask;
516 const long max_cpu = cpus_online();
518 cpus_in_mask = fio_cpu_count(mask);
522 cpu_index = cpu_index % cpus_in_mask;
525 for (i = 0; i < max_cpu; i++) {
526 if (!fio_cpu_isset(mask, i))
529 if (cpu_index != index)
530 fio_cpu_clear(mask, i);
535 return fio_cpu_count(mask);
538 static int str_cpumask_cb(void *data, unsigned long long *val)
540 struct thread_data *td = cb_data_to_td(data);
548 ret = fio_cpuset_init(&td->o.cpumask);
550 log_err("fio: cpuset_init failed\n");
551 td_verror(td, ret, "fio_cpuset_init");
555 max_cpu = cpus_online();
557 for (i = 0; i < sizeof(int) * 8; i++) {
558 if ((1 << i) & *val) {
560 log_err("fio: CPU %d too large (max=%ld)\n", i,
564 dprint(FD_PARSE, "set cpu allowed %d\n", i);
565 fio_cpu_set(&td->o.cpumask, i);
572 static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask,
579 ret = fio_cpuset_init(mask);
581 log_err("fio: cpuset_init failed\n");
582 td_verror(td, ret, "fio_cpuset_init");
586 p = str = strdup(input);
588 strip_blank_front(&str);
589 strip_blank_end(str);
591 max_cpu = cpus_online();
593 while ((cpu = strsep(&str, ",")) != NULL) {
602 while ((cpu2 = strsep(&str2, "-")) != NULL) {
612 while (icpu <= icpu2) {
613 if (icpu >= FIO_MAX_CPUS) {
614 log_err("fio: your OS only supports up to"
615 " %d CPUs\n", (int) FIO_MAX_CPUS);
619 if (icpu >= max_cpu) {
620 log_err("fio: CPU %d too large (max=%ld)\n",
626 dprint(FD_PARSE, "set cpu allowed %d\n", icpu);
627 fio_cpu_set(mask, icpu);
638 static int str_cpus_allowed_cb(void *data, const char *input)
640 struct thread_data *td = cb_data_to_td(data);
645 return set_cpus_allowed(td, &td->o.cpumask, input);
648 static int str_verify_cpus_allowed_cb(void *data, const char *input)
650 struct thread_data *td = cb_data_to_td(data);
655 return set_cpus_allowed(td, &td->o.verify_cpumask, input);
659 static int str_log_cpus_allowed_cb(void *data, const char *input)
661 struct thread_data *td = cb_data_to_td(data);
666 return set_cpus_allowed(td, &td->o.log_gz_cpumask, input);
668 #endif /* CONFIG_ZLIB */
670 #endif /* FIO_HAVE_CPU_AFFINITY */
672 #ifdef CONFIG_LIBNUMA
673 static int str_numa_cpunodes_cb(void *data, char *input)
675 struct thread_data *td = cb_data_to_td(data);
676 struct bitmask *verify_bitmask;
681 /* numa_parse_nodestring() parses a character string list
682 * of nodes into a bit mask. The bit mask is allocated by
683 * numa_allocate_nodemask(), so it should be freed by
684 * numa_free_nodemask().
686 verify_bitmask = numa_parse_nodestring(input);
687 if (verify_bitmask == NULL) {
688 log_err("fio: numa_parse_nodestring failed\n");
689 td_verror(td, 1, "str_numa_cpunodes_cb");
692 numa_free_nodemask(verify_bitmask);
694 td->o.numa_cpunodes = strdup(input);
698 static int str_numa_mpol_cb(void *data, char *input)
700 struct thread_data *td = cb_data_to_td(data);
701 const char * const policy_types[] =
702 { "default", "prefer", "bind", "interleave", "local", NULL };
705 struct bitmask *verify_bitmask;
710 nodelist = strchr(input, ':');
712 /* NUL-terminate mode */
716 for (i = 0; i <= MPOL_LOCAL; i++) {
717 if (!strcmp(input, policy_types[i])) {
718 td->o.numa_mem_mode = i;
722 if (i > MPOL_LOCAL) {
723 log_err("fio: memory policy should be: default, prefer, bind, interleave, local\n");
727 switch (td->o.numa_mem_mode) {
730 * Insist on a nodelist of one node only
733 char *rest = nodelist;
734 while (isdigit(*rest))
737 log_err("fio: one node only for \'prefer\'\n");
741 log_err("fio: one node is needed for \'prefer\'\n");
745 case MPOL_INTERLEAVE:
747 * Default to online nodes with memory if no nodelist
750 nodelist = strdup("all");
755 * Don't allow a nodelist
758 log_err("fio: NO nodelist for \'local\'\n");
764 * Insist on a nodelist
767 log_err("fio: a nodelist is needed for \'bind\'\n");
774 /* numa_parse_nodestring() parses a character string list
775 * of nodes into a bit mask. The bit mask is allocated by
776 * numa_allocate_nodemask(), so it should be freed by
777 * numa_free_nodemask().
779 switch (td->o.numa_mem_mode) {
781 td->o.numa_mem_prefer_node = atoi(nodelist);
783 case MPOL_INTERLEAVE:
785 verify_bitmask = numa_parse_nodestring(nodelist);
786 if (verify_bitmask == NULL) {
787 log_err("fio: numa_parse_nodestring failed\n");
788 td_verror(td, 1, "str_numa_memnodes_cb");
791 td->o.numa_memnodes = strdup(nodelist);
792 numa_free_nodemask(verify_bitmask);
807 static int str_fst_cb(void *data, const char *str)
809 struct thread_data *td = cb_data_to_td(data);
815 td->file_service_nr = 1;
817 switch (td->o.file_service_type) {
818 case FIO_FSERVICE_RANDOM:
819 case FIO_FSERVICE_RR:
820 case FIO_FSERVICE_SEQ:
821 nr = get_opt_postfix(str);
823 td->file_service_nr = atoi(nr);
828 case FIO_FSERVICE_ZIPF:
831 case FIO_FSERVICE_PARETO:
832 val = FIO_DEF_PARETO;
834 case FIO_FSERVICE_GAUSS:
838 log_err("fio: bad file service type: %d\n", td->o.file_service_type);
845 nr = get_opt_postfix(str);
846 if (nr && !split_parse_distr(nr, &val, ¢er)) {
847 log_err("fio: file service type random postfix parsing failed\n");
854 if (center != -1 && (center < 0.00 || center > 1.00)) {
855 log_err("fio: distribution center out of range (0 <= center <= 1.0)\n");
858 td->random_center = center;
860 switch (td->o.file_service_type) {
861 case FIO_FSERVICE_ZIPF:
863 log_err("fio: zipf theta must be different than 1.0\n");
868 td->zipf_theta = val;
870 case FIO_FSERVICE_PARETO:
871 if (val <= 0.00 || val >= 1.00) {
872 log_err("fio: pareto input out of range (0 < input < 1.0)\n");
879 case FIO_FSERVICE_GAUSS:
880 if (val < 0.00 || val >= 100.00) {
881 log_err("fio: normal deviation out of range (0 <= input < 100.0)\n");
893 #ifdef CONFIG_SYNC_FILE_RANGE
894 static int str_sfr_cb(void *data, const char *str)
896 struct thread_data *td = cb_data_to_td(data);
897 char *nr = get_opt_postfix(str);
899 td->sync_file_range_nr = 1;
901 td->sync_file_range_nr = atoi(nr);
909 static int zone_split_ddir(struct thread_options *o, enum fio_ddir ddir,
910 char *str, bool absolute)
912 unsigned int i, perc, perc_missing, sperc, sperc_missing;
915 memset(&split, 0, sizeof(split));
917 if (split_parse_ddir(o, &split, str, absolute, ZONESPLIT_MAX))
922 o->zone_split[ddir] = malloc(split.nr * sizeof(struct zone_split));
923 o->zone_split_nr[ddir] = split.nr;
924 for (i = 0; i < split.nr; i++) {
925 o->zone_split[ddir][i].access_perc = split.val1[i];
927 o->zone_split[ddir][i].size = split.val2[i];
929 o->zone_split[ddir][i].size_perc = split.val2[i];
933 * Now check if the percentages add up, and how much is missing
935 perc = perc_missing = 0;
936 sperc = sperc_missing = 0;
937 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
938 struct zone_split *zsp = &o->zone_split[ddir][i];
940 if (zsp->access_perc == (uint8_t) -1U)
943 perc += zsp->access_perc;
946 if (zsp->size_perc == (uint8_t) -1U)
949 sperc += zsp->size_perc;
953 if (perc > 100 || sperc > 100) {
954 log_err("fio: zone_split percentages add to more than 100%%\n");
955 free(o->zone_split[ddir]);
956 o->zone_split[ddir] = NULL;
960 log_err("fio: access percentage don't add up to 100 for zoned "
961 "random distribution (got=%u)\n", perc);
962 free(o->zone_split[ddir]);
963 o->zone_split[ddir] = NULL;
968 * If values didn't have a percentage set, divide the remains between
972 if (perc_missing == 1 && o->zone_split_nr[ddir] == 1)
974 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
975 struct zone_split *zsp = &o->zone_split[ddir][i];
977 if (zsp->access_perc == (uint8_t) -1U)
978 zsp->access_perc = (100 - perc) / perc_missing;
982 if (sperc_missing == 1 && o->zone_split_nr[ddir] == 1)
984 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
985 struct zone_split *zsp = &o->zone_split[ddir][i];
987 if (zsp->size_perc == (uint8_t) -1U)
988 zsp->size_perc = (100 - sperc) / sperc_missing;
995 static int parse_zoned_distribution(struct thread_data *td, const char *input,
998 const char *pre = absolute ? "zoned_abs:" : "zoned:";
1002 p = str = strdup(input);
1004 strip_blank_front(&str);
1005 strip_blank_end(str);
1007 /* We expect it to start like that, bail if not */
1008 if (strncmp(str, pre, strlen(pre))) {
1009 log_err("fio: mismatch in zoned input <%s>\n", str);
1015 ret = str_split_parse(td, str, zone_split_ddir, absolute);
1019 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
1022 dprint(FD_PARSE, "zone ddir %d (nr=%u): \n", i, td->o.zone_split_nr[i]);
1024 for (j = 0; j < td->o.zone_split_nr[i]; j++) {
1025 struct zone_split *zsp = &td->o.zone_split[i][j];
1028 dprint(FD_PARSE, "\t%d: %u/%llu\n", j,
1030 (unsigned long long) zsp->size);
1032 dprint(FD_PARSE, "\t%d: %u/%u\n", j,
1039 if (parse_dryrun()) {
1040 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
1041 free(td->o.zone_split[i]);
1042 td->o.zone_split[i] = NULL;
1043 td->o.zone_split_nr[i] = 0;
1050 for (i = 0; i < DDIR_RWDIR_CNT; i++)
1051 td->o.zone_split_nr[i] = 0;
1057 static int str_random_distribution_cb(void *data, const char *str)
1059 struct thread_data *td = cb_data_to_td(data);
1064 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
1066 else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
1067 val = FIO_DEF_PARETO;
1068 else if (td->o.random_distribution == FIO_RAND_DIST_GAUSS)
1070 else if (td->o.random_distribution == FIO_RAND_DIST_ZONED)
1071 return parse_zoned_distribution(td, str, false);
1072 else if (td->o.random_distribution == FIO_RAND_DIST_ZONED_ABS)
1073 return parse_zoned_distribution(td, str, true);
1077 nr = get_opt_postfix(str);
1078 if (nr && !split_parse_distr(nr, &val, ¢er)) {
1079 log_err("fio: random postfix parsing failed\n");
1086 if (center != -1 && (center < 0.00 || center > 1.00)) {
1087 log_err("fio: distribution center out of range (0 <= center <= 1.0)\n");
1090 td->o.random_center.u.f = center;
1092 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) {
1094 log_err("fio: zipf theta must different than 1.0\n");
1099 td->o.zipf_theta.u.f = val;
1100 } else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) {
1101 if (val <= 0.00 || val >= 1.00) {
1102 log_err("fio: pareto input out of range (0 < input < 1.0)\n");
1107 td->o.pareto_h.u.f = val;
1109 if (val < 0.00 || val >= 100.0) {
1110 log_err("fio: normal deviation out of range (0 <= input < 100.0)\n");
1115 td->o.gauss_dev.u.f = val;
1121 static int str_steadystate_cb(void *data, const char *str)
1123 struct thread_data *td = cb_data_to_td(data);
1129 if (td->o.ss_state != FIO_SS_IOPS && td->o.ss_state != FIO_SS_IOPS_SLOPE &&
1130 td->o.ss_state != FIO_SS_BW && td->o.ss_state != FIO_SS_BW_SLOPE) {
1131 /* should be impossible to get here */
1132 log_err("fio: unknown steady state criterion\n");
1136 nr = get_opt_postfix(str);
1138 log_err("fio: steadystate threshold must be specified in addition to criterion\n");
1143 /* ENHANCEMENT Allow fio to understand size=10.2% and use here */
1144 pct = strstr(nr, "%");
1147 strip_blank_end(nr);
1148 if (!str_to_float(nr, &val, 0)) {
1149 log_err("fio: could not parse steadystate threshold percentage\n");
1154 dprint(FD_PARSE, "set steady state threshold to %f%%\n", val);
1159 td->o.ss_state |= FIO_SS_PCT;
1160 td->o.ss_limit.u.f = val;
1161 } else if (td->o.ss_state & FIO_SS_IOPS) {
1162 if (!str_to_float(nr, &val, 0)) {
1163 log_err("fio: steadystate IOPS threshold postfix parsing failed\n");
1168 dprint(FD_PARSE, "set steady state IOPS threshold to %f\n", val);
1173 td->o.ss_limit.u.f = val;
1174 } else { /* bandwidth criterion */
1175 if (str_to_decimal(nr, &ll, 1, td, 0, 0)) {
1176 log_err("fio: steadystate BW threshold postfix parsing failed\n");
1181 dprint(FD_PARSE, "set steady state BW threshold to %lld\n", ll);
1186 td->o.ss_limit.u.f = (double) ll;
1189 td->ss.state = td->o.ss_state;
1194 * Return next name in the string. Files are separated with ':'. If the ':'
1195 * is escaped with a '\', then that ':' is part of the filename and does not
1196 * indicate a new file.
1198 char *get_next_str(char **ptr)
1203 if (!str || !strlen(str))
1209 * No colon, we are done
1211 p = strchr(str, ':');
1218 * We got a colon, but it's the first character. Skip and
1226 if (*(p - 1) != '\\') {
1232 memmove(p - 1, p, strlen(p) + 1);
1240 int get_max_str_idx(char *input)
1242 unsigned int cur_idx;
1245 p = str = strdup(input);
1246 for (cur_idx = 0; ; cur_idx++)
1247 if (get_next_str(&str) == NULL)
1255 * Returns the directory at the index, indexes > entires will be
1256 * assigned via modulo division of the index
1258 int set_name_idx(char *target, size_t tlen, char *input, int index,
1259 bool unique_filename)
1261 unsigned int cur_idx;
1263 char *fname, *str, *p;
1265 p = str = strdup(input);
1267 index %= get_max_str_idx(input);
1268 for (cur_idx = 0; cur_idx <= index; cur_idx++)
1269 fname = get_next_str(&str);
1271 if (client_sockaddr_str[0] && unique_filename) {
1272 len = snprintf(target, tlen, "%s/%s.", fname,
1273 client_sockaddr_str);
1275 len = snprintf(target, tlen, "%s%c", fname,
1276 FIO_OS_PATH_SEPARATOR);
1278 target[tlen - 1] = '\0';
1284 char* get_name_by_idx(char *input, int index)
1286 unsigned int cur_idx;
1287 char *fname, *str, *p;
1289 p = str = strdup(input);
1291 index %= get_max_str_idx(input);
1292 for (cur_idx = 0; cur_idx <= index; cur_idx++)
1293 fname = get_next_str(&str);
1295 fname = strdup(fname);
1301 static int str_filename_cb(void *data, const char *input)
1303 struct thread_data *td = cb_data_to_td(data);
1304 char *fname, *str, *p;
1306 p = str = strdup(input);
1308 strip_blank_front(&str);
1309 strip_blank_end(str);
1312 * Ignore what we may already have from nrfiles option.
1314 if (!td->files_index)
1317 while ((fname = get_next_str(&str)) != NULL) {
1320 add_file(td, fname, 0, 1);
1327 static int str_directory_cb(void *data, const char fio_unused *unused)
1329 struct thread_data *td = cb_data_to_td(data);
1331 char *dirname, *str, *p;
1337 p = str = strdup(td->o.directory);
1338 while ((dirname = get_next_str(&str)) != NULL) {
1339 if (lstat(dirname, &sb) < 0) {
1342 log_err("fio: %s is not a directory\n", dirname);
1343 td_verror(td, ret, "lstat");
1346 if (!S_ISDIR(sb.st_mode)) {
1347 log_err("fio: %s is not a directory\n", dirname);
1358 static int str_opendir_cb(void *data, const char fio_unused *str)
1360 struct thread_data *td = cb_data_to_td(data);
1365 if (!td->files_index)
1368 return add_dir_files(td, td->o.opendir);
1371 static int str_buffer_pattern_cb(void *data, const char *input)
1373 struct thread_data *td = cb_data_to_td(data);
1376 /* FIXME: for now buffer pattern does not support formats */
1377 ret = parse_and_fill_pattern(input, strlen(input), td->o.buffer_pattern,
1378 MAX_PATTERN_SIZE, NULL, NULL, NULL);
1383 td->o.buffer_pattern_bytes = ret;
1386 * If this job is doing any reading or has compression set,
1387 * ensure that we refill buffers for writes or we could be
1388 * invalidating the pattern through reads.
1390 if (!td->o.compress_percentage && !td_read(td))
1391 td->o.refill_buffers = 0;
1393 td->o.refill_buffers = 1;
1395 td->o.scramble_buffers = 0;
1396 td->o.zero_buffers = 0;
1401 static int str_buffer_compress_cb(void *data, unsigned long long *il)
1403 struct thread_data *td = cb_data_to_td(data);
1405 td->flags |= TD_F_COMPRESS;
1406 td->o.compress_percentage = *il;
1410 static int str_dedupe_cb(void *data, unsigned long long *il)
1412 struct thread_data *td = cb_data_to_td(data);
1414 td->flags |= TD_F_COMPRESS;
1415 td->o.dedupe_percentage = *il;
1416 td->o.refill_buffers = 1;
1420 static int str_verify_pattern_cb(void *data, const char *input)
1422 struct thread_data *td = cb_data_to_td(data);
1425 td->o.verify_fmt_sz = FIO_ARRAY_SIZE(td->o.verify_fmt);
1426 ret = parse_and_fill_pattern(input, strlen(input), td->o.verify_pattern,
1427 MAX_PATTERN_SIZE, fmt_desc,
1428 td->o.verify_fmt, &td->o.verify_fmt_sz);
1433 td->o.verify_pattern_bytes = ret;
1435 * VERIFY_* could already be set
1437 if (!fio_option_is_set(&td->o, verify))
1438 td->o.verify = VERIFY_PATTERN;
1443 static int str_gtod_reduce_cb(void *data, int *il)
1445 struct thread_data *td = cb_data_to_td(data);
1449 * Only modfiy options if gtod_reduce==1
1450 * Otherwise leave settings alone.
1453 td->o.disable_lat = 1;
1454 td->o.disable_clat = 1;
1455 td->o.disable_slat = 1;
1456 td->o.disable_bw = 1;
1457 td->o.clat_percentiles = 0;
1458 td->o.lat_percentiles = 0;
1459 td->o.slat_percentiles = 0;
1460 td->ts_cache_mask = 63;
1466 static int str_offset_cb(void *data, unsigned long long *__val)
1468 struct thread_data *td = cb_data_to_td(data);
1469 unsigned long long v = *__val;
1471 if (parse_is_percent(v)) {
1472 td->o.start_offset = 0;
1473 td->o.start_offset_percent = -1ULL - v;
1474 td->o.start_offset_nz = 0;
1475 dprint(FD_PARSE, "SET start_offset_percent %d\n",
1476 td->o.start_offset_percent);
1477 } else if (parse_is_zone(v)) {
1478 td->o.start_offset = 0;
1479 td->o.start_offset_percent = 0;
1480 td->o.start_offset_nz = v - ZONE_BASE_VAL;
1482 td->o.start_offset = v;
1487 static int str_offset_increment_cb(void *data, unsigned long long *__val)
1489 struct thread_data *td = cb_data_to_td(data);
1490 unsigned long long v = *__val;
1492 if (parse_is_percent(v)) {
1493 td->o.offset_increment = 0;
1494 td->o.offset_increment_percent = -1ULL - v;
1495 td->o.offset_increment_nz = 0;
1496 dprint(FD_PARSE, "SET offset_increment_percent %d\n",
1497 td->o.offset_increment_percent);
1498 } else if (parse_is_zone(v)) {
1499 td->o.offset_increment = 0;
1500 td->o.offset_increment_percent = 0;
1501 td->o.offset_increment_nz = v - ZONE_BASE_VAL;
1503 td->o.offset_increment = v;
1508 static int str_size_cb(void *data, unsigned long long *__val)
1510 struct thread_data *td = cb_data_to_td(data);
1511 unsigned long long v = *__val;
1513 if (parse_is_percent(v)) {
1515 td->o.size_percent = -1ULL - v;
1516 dprint(FD_PARSE, "SET size_percent %d\n",
1517 td->o.size_percent);
1518 } else if (parse_is_zone(v)) {
1520 td->o.size_percent = 0;
1521 td->o.size_nz = v - ZONE_BASE_VAL;
1528 static int str_io_size_cb(void *data, unsigned long long *__val)
1530 struct thread_data *td = cb_data_to_td(data);
1531 unsigned long long v = *__val;
1533 if (parse_is_percent_uncapped(v)) {
1535 td->o.io_size_percent = -1ULL - v;
1536 if (td->o.io_size_percent > 100) {
1537 log_err("fio: io_size values greater than 100%% aren't supported\n");
1540 dprint(FD_PARSE, "SET io_size_percent %d\n",
1541 td->o.io_size_percent);
1542 } else if (parse_is_zone(v)) {
1544 td->o.io_size_percent = 0;
1545 td->o.io_size_nz = v - ZONE_BASE_VAL;
1552 static int str_zoneskip_cb(void *data, unsigned long long *__val)
1554 struct thread_data *td = cb_data_to_td(data);
1555 unsigned long long v = *__val;
1557 if (parse_is_zone(v)) {
1558 td->o.zone_skip = 0;
1559 td->o.zone_skip_nz = v - ZONE_BASE_VAL;
1561 td->o.zone_skip = v;
1566 static int str_write_bw_log_cb(void *data, const char *str)
1568 struct thread_data *td = cb_data_to_td(data);
1571 td->o.bw_log_file = strdup(str);
1573 td->o.write_bw_log = 1;
1577 static int str_write_lat_log_cb(void *data, const char *str)
1579 struct thread_data *td = cb_data_to_td(data);
1582 td->o.lat_log_file = strdup(str);
1584 td->o.write_lat_log = 1;
1588 static int str_write_iops_log_cb(void *data, const char *str)
1590 struct thread_data *td = cb_data_to_td(data);
1593 td->o.iops_log_file = strdup(str);
1595 td->o.write_iops_log = 1;
1599 static int str_write_hist_log_cb(void *data, const char *str)
1601 struct thread_data *td = cb_data_to_td(data);
1604 td->o.hist_log_file = strdup(str);
1606 td->o.write_hist_log = 1;
1611 * str is supposed to be a substring of the strdup'd original string,
1612 * and is valid only if it's a regular file path.
1613 * This function keeps the pointer to the path as needed later.
1615 * "external:/path/to/so\0" <- original pointer updated with strdup'd
1616 * "external\0" <- above pointer after parsed, i.e. ->ioengine
1617 * "/path/to/so\0" <- str argument, i.e. ->ioengine_so_path
1619 static int str_ioengine_external_cb(void *data, const char *str)
1621 struct thread_data *td = cb_data_to_td(data);
1626 log_err("fio: null external ioengine path\n");
1630 p = (char *)str; /* str is mutable */
1631 strip_blank_front(&p);
1634 if (stat(p, &sb) || !S_ISREG(sb.st_mode)) {
1635 log_err("fio: invalid external ioengine path \"%s\"\n", p);
1639 td->o.ioengine_so_path = p;
1643 static int rw_verify(const struct fio_option *o, void *data)
1645 struct thread_data *td = cb_data_to_td(data);
1647 if (read_only && (td_write(td) || td_trim(td))) {
1648 log_err("fio: job <%s> has write or trim bit set, but"
1649 " fio is in read-only mode\n", td->o.name);
1656 static int gtod_cpu_verify(const struct fio_option *o, void *data)
1658 #ifndef FIO_HAVE_CPU_AFFINITY
1659 struct thread_data *td = cb_data_to_td(data);
1661 if (td->o.gtod_cpu) {
1662 log_err("fio: platform must support CPU affinity for"
1663 "gettimeofday() offloading\n");
1672 * Map of job/command line options
1674 struct fio_option fio_options[FIO_MAX_OPTS] = {
1676 .name = "description",
1677 .lname = "Description of job",
1678 .type = FIO_OPT_STR_STORE,
1679 .off1 = offsetof(struct thread_options, description),
1680 .help = "Text job description",
1681 .category = FIO_OPT_C_GENERAL,
1682 .group = FIO_OPT_G_DESC,
1686 .lname = "Job name",
1687 .type = FIO_OPT_STR_STORE,
1688 .off1 = offsetof(struct thread_options, name),
1689 .help = "Name of this job",
1690 .category = FIO_OPT_C_GENERAL,
1691 .group = FIO_OPT_G_DESC,
1695 .lname = "Waitee name",
1696 .type = FIO_OPT_STR_STORE,
1697 .off1 = offsetof(struct thread_options, wait_for),
1698 .help = "Name of the job this one wants to wait for before starting",
1699 .category = FIO_OPT_C_GENERAL,
1700 .group = FIO_OPT_G_DESC,
1704 .lname = "Filename(s)",
1705 .type = FIO_OPT_STR_STORE,
1706 .off1 = offsetof(struct thread_options, filename),
1708 .cb = str_filename_cb,
1709 .prio = -1, /* must come after "directory" */
1710 .help = "File(s) to use for the workload",
1711 .category = FIO_OPT_C_FILE,
1712 .group = FIO_OPT_G_FILENAME,
1715 .name = "directory",
1716 .lname = "Directory",
1717 .type = FIO_OPT_STR_STORE,
1718 .off1 = offsetof(struct thread_options, directory),
1719 .cb = str_directory_cb,
1720 .help = "Directory to store files in",
1721 .category = FIO_OPT_C_FILE,
1722 .group = FIO_OPT_G_FILENAME,
1725 .name = "filename_format",
1726 .lname = "Filename Format",
1727 .type = FIO_OPT_STR_STORE,
1728 .off1 = offsetof(struct thread_options, filename_format),
1729 .prio = -1, /* must come after "directory" */
1730 .help = "Override default $jobname.$jobnum.$filenum naming",
1731 .def = "$jobname.$jobnum.$filenum",
1732 .category = FIO_OPT_C_FILE,
1733 .group = FIO_OPT_G_FILENAME,
1736 .name = "unique_filename",
1737 .lname = "Unique Filename",
1738 .type = FIO_OPT_BOOL,
1739 .off1 = offsetof(struct thread_options, unique_filename),
1740 .help = "For network clients, prefix file with source IP",
1742 .category = FIO_OPT_C_FILE,
1743 .group = FIO_OPT_G_FILENAME,
1747 .lname = "Lockfile",
1748 .type = FIO_OPT_STR,
1749 .off1 = offsetof(struct thread_options, file_lock_mode),
1750 .help = "Lock file when doing IO to it",
1752 .parent = "filename",
1755 .category = FIO_OPT_C_FILE,
1756 .group = FIO_OPT_G_FILENAME,
1759 .oval = FILE_LOCK_NONE,
1760 .help = "No file locking",
1762 { .ival = "exclusive",
1763 .oval = FILE_LOCK_EXCLUSIVE,
1764 .help = "Exclusive file lock",
1767 .ival = "readwrite",
1768 .oval = FILE_LOCK_READWRITE,
1769 .help = "Read vs write lock",
1775 .lname = "Open directory",
1776 .type = FIO_OPT_STR_STORE,
1777 .off1 = offsetof(struct thread_options, opendir),
1778 .cb = str_opendir_cb,
1779 .help = "Recursively add files from this directory and down",
1780 .category = FIO_OPT_C_FILE,
1781 .group = FIO_OPT_G_FILENAME,
1785 .lname = "Read/write",
1786 .alias = "readwrite",
1787 .type = FIO_OPT_STR,
1789 .off1 = offsetof(struct thread_options, td_ddir),
1790 .help = "IO direction",
1792 .verify = rw_verify,
1793 .category = FIO_OPT_C_IO,
1794 .group = FIO_OPT_G_IO_BASIC,
1797 .oval = TD_DDIR_READ,
1798 .help = "Sequential read",
1801 .oval = TD_DDIR_WRITE,
1802 .help = "Sequential write",
1805 .oval = TD_DDIR_TRIM,
1806 .help = "Sequential trim",
1808 { .ival = "randread",
1809 .oval = TD_DDIR_RANDREAD,
1810 .help = "Random read",
1812 { .ival = "randwrite",
1813 .oval = TD_DDIR_RANDWRITE,
1814 .help = "Random write",
1816 { .ival = "randtrim",
1817 .oval = TD_DDIR_RANDTRIM,
1818 .help = "Random trim",
1822 .help = "Sequential read and write mix",
1824 { .ival = "readwrite",
1826 .help = "Sequential read and write mix",
1829 .oval = TD_DDIR_RANDRW,
1830 .help = "Random read and write mix"
1832 { .ival = "trimwrite",
1833 .oval = TD_DDIR_TRIMWRITE,
1834 .help = "Trim and write mix, trims preceding writes"
1839 .name = "rw_sequencer",
1840 .lname = "RW Sequencer",
1841 .type = FIO_OPT_STR,
1842 .off1 = offsetof(struct thread_options, rw_seq),
1843 .help = "IO offset generator modifier",
1844 .def = "sequential",
1845 .category = FIO_OPT_C_IO,
1846 .group = FIO_OPT_G_IO_BASIC,
1848 { .ival = "sequential",
1850 .help = "Generate sequential offsets",
1852 { .ival = "identical",
1853 .oval = RW_SEQ_IDENT,
1854 .help = "Generate identical offsets",
1861 .lname = "IO Engine",
1862 .type = FIO_OPT_STR_STORE,
1863 .off1 = offsetof(struct thread_options, ioengine),
1864 .help = "IO engine to use",
1865 .def = FIO_PREFERRED_ENGINE,
1866 .category = FIO_OPT_C_IO,
1867 .group = FIO_OPT_G_IO_BASIC,
1870 .help = "Use read/write",
1873 .help = "Use pread/pwrite",
1876 .help = "Use readv/writev",
1878 #ifdef CONFIG_PWRITEV
1880 .help = "Use preadv/pwritev",
1883 #ifdef FIO_HAVE_PWRITEV2
1884 { .ival = "pvsync2",
1885 .help = "Use preadv2/pwritev2",
1888 #ifdef CONFIG_LIBAIO
1890 .help = "Linux native asynchronous IO",
1893 #ifdef ARCH_HAVE_IOURING
1894 { .ival = "io_uring",
1895 .help = "Fast Linux native aio",
1898 #ifdef CONFIG_POSIXAIO
1899 { .ival = "posixaio",
1900 .help = "POSIX asynchronous IO",
1903 #ifdef CONFIG_SOLARISAIO
1904 { .ival = "solarisaio",
1905 .help = "Solaris native asynchronous IO",
1908 #ifdef CONFIG_WINDOWSAIO
1909 { .ival = "windowsaio",
1910 .help = "Windows native asynchronous IO"
1915 .help = "Rados Block Device asynchronous IO"
1919 .help = "Memory mapped IO"
1921 #ifdef CONFIG_LINUX_SPLICE
1923 .help = "splice/vmsplice based IO",
1925 { .ival = "netsplice",
1926 .help = "splice/vmsplice to/from the network",
1929 #ifdef FIO_HAVE_SGIO
1931 .help = "SCSI generic v3 IO",
1935 .help = "Testing engine (no data transfer)",
1938 .help = "Network IO",
1941 .help = "CPU cycle burner engine",
1945 .help = "RDMA IO engine",
1948 #ifdef CONFIG_LIBRPMA_APM
1949 { .ival = "librpma_apm",
1950 .help = "librpma IO engine in APM mode",
1953 #ifdef CONFIG_LIBRPMA_GPSPM
1954 { .ival = "librpma_gpspm",
1955 .help = "librpma IO engine in GPSPM mode",
1958 #ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
1959 { .ival = "e4defrag",
1960 .help = "ext4 defrag engine",
1963 #ifdef CONFIG_LINUX_FALLOCATE
1965 .help = "fallocate() file based engine",
1970 .help = "Glusterfs libgfapi(sync) based engine"
1972 { .ival = "gfapi_async",
1973 .help = "Glusterfs libgfapi(async) based engine"
1976 #ifdef CONFIG_LIBHDFS
1977 { .ival = "libhdfs",
1978 .help = "Hadoop Distributed Filesystem (HDFS) engine"
1981 #ifdef CONFIG_PMEMBLK
1982 { .ival = "pmemblk",
1983 .help = "PMDK libpmemblk based IO engine",
1988 { .ival = "ime_psync",
1989 .help = "DDN's IME synchronous IO engine",
1991 { .ival = "ime_psyncv",
1992 .help = "DDN's IME synchronous IO engine using iovecs",
1994 { .ival = "ime_aio",
1995 .help = "DDN's IME asynchronous IO engine",
1998 #ifdef CONFIG_LINUX_DEVDAX
1999 { .ival = "dev-dax",
2000 .help = "DAX Device based IO engine",
2004 .ival = "filecreate",
2005 .help = "File creation engine",
2007 { .ival = "external",
2008 .help = "Load external engine (append name)",
2009 .cb = str_ioengine_external_cb,
2011 #ifdef CONFIG_LIBPMEM
2012 { .ival = "libpmem",
2013 .help = "PMDK libpmem based IO engine",
2018 .help = "HTTP (WebDAV/S3) IO engine",
2022 .help = "Network Block Device (NBD) IO engine"
2026 .help = "DAOS File System (dfs) IO engine",
2031 .help = "NFS IO engine",
2038 .lname = "IO Depth",
2039 .type = FIO_OPT_INT,
2040 .off1 = offsetof(struct thread_options, iodepth),
2041 .help = "Number of IO buffers to keep in flight",
2045 .category = FIO_OPT_C_IO,
2046 .group = FIO_OPT_G_IO_BASIC,
2049 .name = "iodepth_batch",
2050 .lname = "IO Depth batch",
2051 .alias = "iodepth_batch_submit",
2052 .type = FIO_OPT_INT,
2053 .off1 = offsetof(struct thread_options, iodepth_batch),
2054 .help = "Number of IO buffers to submit in one go",
2055 .parent = "iodepth",
2059 .category = FIO_OPT_C_IO,
2060 .group = FIO_OPT_G_IO_BASIC,
2063 .name = "iodepth_batch_complete_min",
2064 .lname = "Min IO depth batch complete",
2065 .alias = "iodepth_batch_complete",
2066 .type = FIO_OPT_INT,
2067 .off1 = offsetof(struct thread_options, iodepth_batch_complete_min),
2068 .help = "Min number of IO buffers to retrieve in one go",
2069 .parent = "iodepth",
2074 .category = FIO_OPT_C_IO,
2075 .group = FIO_OPT_G_IO_BASIC,
2078 .name = "iodepth_batch_complete_max",
2079 .lname = "Max IO depth batch complete",
2080 .type = FIO_OPT_INT,
2081 .off1 = offsetof(struct thread_options, iodepth_batch_complete_max),
2082 .help = "Max number of IO buffers to retrieve in one go",
2083 .parent = "iodepth",
2087 .category = FIO_OPT_C_IO,
2088 .group = FIO_OPT_G_IO_BASIC,
2091 .name = "iodepth_low",
2092 .lname = "IO Depth batch low",
2093 .type = FIO_OPT_INT,
2094 .off1 = offsetof(struct thread_options, iodepth_low),
2095 .help = "Low water mark for queuing depth",
2096 .parent = "iodepth",
2099 .category = FIO_OPT_C_IO,
2100 .group = FIO_OPT_G_IO_BASIC,
2103 .name = "serialize_overlap",
2104 .lname = "Serialize overlap",
2105 .off1 = offsetof(struct thread_options, serialize_overlap),
2106 .type = FIO_OPT_BOOL,
2107 .help = "Wait for in-flight IOs that collide to complete",
2108 .parent = "iodepth",
2110 .category = FIO_OPT_C_IO,
2111 .group = FIO_OPT_G_IO_BASIC,
2114 .name = "io_submit_mode",
2115 .lname = "IO submit mode",
2116 .type = FIO_OPT_STR,
2117 .off1 = offsetof(struct thread_options, io_submit_mode),
2118 .help = "How IO submissions and completions are done",
2120 .category = FIO_OPT_C_IO,
2121 .group = FIO_OPT_G_IO_BASIC,
2124 .oval = IO_MODE_INLINE,
2125 .help = "Submit and complete IO inline",
2127 { .ival = "offload",
2128 .oval = IO_MODE_OFFLOAD,
2129 .help = "Offload submit and complete to threads",
2136 .type = FIO_OPT_STR_VAL_ZONE,
2138 .off1 = offsetof(struct thread_options, size),
2139 .help = "Total size of device or files",
2140 .category = FIO_OPT_C_IO,
2141 .group = FIO_OPT_G_INVALID,
2145 .alias = "io_limit",
2147 .type = FIO_OPT_STR_VAL_ZONE,
2148 .cb = str_io_size_cb,
2149 .off1 = offsetof(struct thread_options, io_size),
2150 .help = "Total size of I/O to be performed",
2151 .category = FIO_OPT_C_IO,
2152 .group = FIO_OPT_G_INVALID,
2155 .name = "fill_device",
2156 .lname = "Fill device",
2158 .type = FIO_OPT_BOOL,
2159 .off1 = offsetof(struct thread_options, fill_device),
2160 .help = "Write until an ENOSPC error occurs",
2162 .category = FIO_OPT_C_FILE,
2163 .group = FIO_OPT_G_INVALID,
2167 .lname = "File size",
2168 .type = FIO_OPT_STR_VAL,
2169 .off1 = offsetof(struct thread_options, file_size_low),
2170 .off2 = offsetof(struct thread_options, file_size_high),
2172 .help = "Size of individual files",
2173 .interval = 1024 * 1024,
2174 .category = FIO_OPT_C_FILE,
2175 .group = FIO_OPT_G_INVALID,
2178 .name = "file_append",
2179 .lname = "File append",
2180 .type = FIO_OPT_BOOL,
2181 .off1 = offsetof(struct thread_options, file_append),
2182 .help = "IO will start at the end of the file(s)",
2184 .category = FIO_OPT_C_FILE,
2185 .group = FIO_OPT_G_INVALID,
2189 .lname = "IO offset",
2190 .alias = "fileoffset",
2191 .type = FIO_OPT_STR_VAL_ZONE,
2192 .cb = str_offset_cb,
2193 .off1 = offsetof(struct thread_options, start_offset),
2194 .help = "Start IO from this offset",
2196 .category = FIO_OPT_C_IO,
2197 .group = FIO_OPT_G_INVALID,
2200 .name = "offset_align",
2201 .lname = "IO offset alignment",
2202 .type = FIO_OPT_INT,
2203 .off1 = offsetof(struct thread_options, start_offset_align),
2204 .help = "Start IO from this offset alignment",
2207 .category = FIO_OPT_C_IO,
2208 .group = FIO_OPT_G_INVALID,
2211 .name = "offset_increment",
2212 .lname = "IO offset increment",
2213 .type = FIO_OPT_STR_VAL_ZONE,
2214 .cb = str_offset_increment_cb,
2215 .off1 = offsetof(struct thread_options, offset_increment),
2216 .help = "What is the increment from one offset to the next",
2220 .category = FIO_OPT_C_IO,
2221 .group = FIO_OPT_G_INVALID,
2224 .name = "number_ios",
2225 .lname = "Number of IOs to perform",
2226 .type = FIO_OPT_STR_VAL,
2227 .off1 = offsetof(struct thread_options, number_ios),
2228 .help = "Force job completion after this number of IOs",
2230 .category = FIO_OPT_C_IO,
2231 .group = FIO_OPT_G_INVALID,
2235 .lname = "Block size",
2236 .alias = "blocksize",
2237 .type = FIO_OPT_ULL,
2238 .off1 = offsetof(struct thread_options, bs[DDIR_READ]),
2239 .off2 = offsetof(struct thread_options, bs[DDIR_WRITE]),
2240 .off3 = offsetof(struct thread_options, bs[DDIR_TRIM]),
2242 .help = "Block size unit",
2247 .category = FIO_OPT_C_IO,
2248 .group = FIO_OPT_G_INVALID,
2252 .lname = "Block size align",
2253 .alias = "blockalign",
2254 .type = FIO_OPT_ULL,
2255 .off1 = offsetof(struct thread_options, ba[DDIR_READ]),
2256 .off2 = offsetof(struct thread_options, ba[DDIR_WRITE]),
2257 .off3 = offsetof(struct thread_options, ba[DDIR_TRIM]),
2259 .help = "IO block offset alignment",
2263 .category = FIO_OPT_C_IO,
2264 .group = FIO_OPT_G_INVALID,
2268 .lname = "Block size range",
2269 .alias = "blocksize_range",
2270 .type = FIO_OPT_RANGE,
2271 .off1 = offsetof(struct thread_options, min_bs[DDIR_READ]),
2272 .off2 = offsetof(struct thread_options, max_bs[DDIR_READ]),
2273 .off3 = offsetof(struct thread_options, min_bs[DDIR_WRITE]),
2274 .off4 = offsetof(struct thread_options, max_bs[DDIR_WRITE]),
2275 .off5 = offsetof(struct thread_options, min_bs[DDIR_TRIM]),
2276 .off6 = offsetof(struct thread_options, max_bs[DDIR_TRIM]),
2278 .help = "Set block size range (in more detail than bs)",
2282 .category = FIO_OPT_C_IO,
2283 .group = FIO_OPT_G_INVALID,
2287 .lname = "Block size split",
2288 .type = FIO_OPT_STR_ULL,
2289 .cb = str_bssplit_cb,
2290 .off1 = offsetof(struct thread_options, bssplit),
2291 .help = "Set a specific mix of block sizes",
2294 .category = FIO_OPT_C_IO,
2295 .group = FIO_OPT_G_INVALID,
2298 .name = "bs_unaligned",
2299 .lname = "Block size unaligned",
2300 .alias = "blocksize_unaligned",
2301 .type = FIO_OPT_STR_SET,
2302 .off1 = offsetof(struct thread_options, bs_unaligned),
2303 .help = "Don't sector align IO buffer sizes",
2306 .category = FIO_OPT_C_IO,
2307 .group = FIO_OPT_G_INVALID,
2310 .name = "bs_is_seq_rand",
2311 .lname = "Block size division is seq/random (not read/write)",
2312 .type = FIO_OPT_BOOL,
2313 .off1 = offsetof(struct thread_options, bs_is_seq_rand),
2314 .help = "Consider any blocksize setting to be sequential,random",
2316 .parent = "blocksize",
2317 .category = FIO_OPT_C_IO,
2318 .group = FIO_OPT_G_INVALID,
2321 .name = "randrepeat",
2322 .lname = "Random repeatable",
2323 .type = FIO_OPT_BOOL,
2324 .off1 = offsetof(struct thread_options, rand_repeatable),
2325 .help = "Use repeatable random IO pattern",
2329 .category = FIO_OPT_C_IO,
2330 .group = FIO_OPT_G_RANDOM,
2334 .lname = "The random generator seed",
2335 .type = FIO_OPT_STR_VAL,
2336 .off1 = offsetof(struct thread_options, rand_seed),
2337 .help = "Set the random generator seed value",
2340 .category = FIO_OPT_C_IO,
2341 .group = FIO_OPT_G_RANDOM,
2344 .name = "norandommap",
2345 .lname = "No randommap",
2346 .type = FIO_OPT_STR_SET,
2347 .off1 = offsetof(struct thread_options, norandommap),
2348 .help = "Accept potential duplicate random blocks",
2352 .category = FIO_OPT_C_IO,
2353 .group = FIO_OPT_G_RANDOM,
2356 .name = "softrandommap",
2357 .lname = "Soft randommap",
2358 .type = FIO_OPT_BOOL,
2359 .off1 = offsetof(struct thread_options, softrandommap),
2360 .help = "Set norandommap if randommap allocation fails",
2361 .parent = "norandommap",
2364 .category = FIO_OPT_C_IO,
2365 .group = FIO_OPT_G_RANDOM,
2368 .name = "random_generator",
2369 .lname = "Random Generator",
2370 .type = FIO_OPT_STR,
2371 .off1 = offsetof(struct thread_options, random_generator),
2372 .help = "Type of random number generator to use",
2373 .def = "tausworthe",
2375 { .ival = "tausworthe",
2376 .oval = FIO_RAND_GEN_TAUSWORTHE,
2377 .help = "Strong Tausworthe generator",
2380 .oval = FIO_RAND_GEN_LFSR,
2381 .help = "Variable length LFSR",
2384 .ival = "tausworthe64",
2385 .oval = FIO_RAND_GEN_TAUSWORTHE64,
2386 .help = "64-bit Tausworthe variant",
2389 .category = FIO_OPT_C_IO,
2390 .group = FIO_OPT_G_RANDOM,
2393 .name = "random_distribution",
2394 .lname = "Random Distribution",
2395 .type = FIO_OPT_STR,
2396 .off1 = offsetof(struct thread_options, random_distribution),
2397 .cb = str_random_distribution_cb,
2398 .help = "Random offset distribution generator",
2402 .oval = FIO_RAND_DIST_RANDOM,
2403 .help = "Completely random",
2406 .oval = FIO_RAND_DIST_ZIPF,
2407 .help = "Zipf distribution",
2410 .oval = FIO_RAND_DIST_PARETO,
2411 .help = "Pareto distribution",
2414 .oval = FIO_RAND_DIST_GAUSS,
2415 .help = "Normal (Gaussian) distribution",
2418 .oval = FIO_RAND_DIST_ZONED,
2419 .help = "Zoned random distribution",
2421 { .ival = "zoned_abs",
2422 .oval = FIO_RAND_DIST_ZONED_ABS,
2423 .help = "Zoned absolute random distribution",
2426 .category = FIO_OPT_C_IO,
2427 .group = FIO_OPT_G_RANDOM,
2430 .name = "percentage_random",
2431 .lname = "Percentage Random",
2432 .type = FIO_OPT_INT,
2433 .off1 = offsetof(struct thread_options, perc_rand[DDIR_READ]),
2434 .off2 = offsetof(struct thread_options, perc_rand[DDIR_WRITE]),
2435 .off3 = offsetof(struct thread_options, perc_rand[DDIR_TRIM]),
2437 .help = "Percentage of seq/random mix that should be random",
2438 .def = "100,100,100",
2440 .inverse = "percentage_sequential",
2441 .category = FIO_OPT_C_IO,
2442 .group = FIO_OPT_G_RANDOM,
2445 .name = "percentage_sequential",
2446 .lname = "Percentage Sequential",
2447 .type = FIO_OPT_DEPRECATED,
2448 .category = FIO_OPT_C_IO,
2449 .group = FIO_OPT_G_RANDOM,
2452 .name = "allrandrepeat",
2453 .lname = "All Random Repeat",
2454 .type = FIO_OPT_BOOL,
2455 .off1 = offsetof(struct thread_options, allrand_repeatable),
2456 .help = "Use repeatable random numbers for everything",
2458 .category = FIO_OPT_C_IO,
2459 .group = FIO_OPT_G_RANDOM,
2463 .lname = "Number of files",
2464 .alias = "nr_files",
2465 .type = FIO_OPT_INT,
2466 .off1 = offsetof(struct thread_options, nr_files),
2467 .help = "Split job workload between this number of files",
2470 .category = FIO_OPT_C_FILE,
2471 .group = FIO_OPT_G_INVALID,
2474 .name = "openfiles",
2475 .lname = "Number of open files",
2476 .type = FIO_OPT_INT,
2477 .off1 = offsetof(struct thread_options, open_files),
2478 .help = "Number of files to keep open at the same time",
2479 .category = FIO_OPT_C_FILE,
2480 .group = FIO_OPT_G_INVALID,
2483 .name = "file_service_type",
2484 .lname = "File service type",
2485 .type = FIO_OPT_STR,
2487 .off1 = offsetof(struct thread_options, file_service_type),
2488 .help = "How to select which file to service next",
2489 .def = "roundrobin",
2490 .category = FIO_OPT_C_FILE,
2491 .group = FIO_OPT_G_INVALID,
2494 .oval = FIO_FSERVICE_RANDOM,
2495 .help = "Choose a file at random (uniform)",
2498 .oval = FIO_FSERVICE_ZIPF,
2499 .help = "Zipf randomized",
2502 .oval = FIO_FSERVICE_PARETO,
2503 .help = "Pareto randomized",
2506 .oval = FIO_FSERVICE_GAUSS,
2507 .help = "Normal (Gaussian) randomized",
2510 .oval = FIO_FSERVICE_GAUSS,
2511 .help = "Alias for normal",
2513 { .ival = "roundrobin",
2514 .oval = FIO_FSERVICE_RR,
2515 .help = "Round robin select files",
2517 { .ival = "sequential",
2518 .oval = FIO_FSERVICE_SEQ,
2519 .help = "Finish one file before moving to the next",
2522 .parent = "nrfiles",
2526 .name = "fallocate",
2527 .lname = "Fallocate",
2528 .type = FIO_OPT_STR,
2529 .off1 = offsetof(struct thread_options, fallocate_mode),
2530 .help = "Whether pre-allocation is performed when laying out files",
2531 #ifdef FIO_HAVE_DEFAULT_FALLOCATE
2536 .category = FIO_OPT_C_FILE,
2537 .group = FIO_OPT_G_INVALID,
2540 .oval = FIO_FALLOCATE_NONE,
2541 .help = "Do not pre-allocate space",
2544 .oval = FIO_FALLOCATE_NATIVE,
2545 .help = "Use native pre-allocation if possible",
2547 #ifdef CONFIG_POSIX_FALLOCATE
2549 .oval = FIO_FALLOCATE_POSIX,
2550 .help = "Use posix_fallocate()",
2553 #ifdef CONFIG_LINUX_FALLOCATE
2555 .oval = FIO_FALLOCATE_KEEP_SIZE,
2556 .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)",
2559 { .ival = "truncate",
2560 .oval = FIO_FALLOCATE_TRUNCATE,
2561 .help = "Truncate file to final size instead of allocating"
2563 /* Compatibility with former boolean values */
2565 .oval = FIO_FALLOCATE_NONE,
2566 .help = "Alias for 'none'",
2568 #ifdef CONFIG_POSIX_FALLOCATE
2570 .oval = FIO_FALLOCATE_POSIX,
2571 .help = "Alias for 'posix'",
2577 .name = "fadvise_hint",
2578 .lname = "Fadvise hint",
2579 .type = FIO_OPT_STR,
2580 .off1 = offsetof(struct thread_options, fadvise_hint),
2584 .help = "Don't issue fadvise/madvise",
2588 .help = "Advise using fio IO pattern",
2591 .oval = F_ADV_RANDOM,
2592 .help = "Advise using FADV_RANDOM",
2594 { .ival = "sequential",
2595 .oval = F_ADV_SEQUENTIAL,
2596 .help = "Advise using FADV_SEQUENTIAL",
2599 .help = "Use fadvise() to advise the kernel on IO pattern",
2601 .category = FIO_OPT_C_FILE,
2602 .group = FIO_OPT_G_INVALID,
2607 .type = FIO_OPT_INT,
2608 .off1 = offsetof(struct thread_options, fsync_blocks),
2609 .help = "Issue fsync for writes every given number of blocks",
2612 .category = FIO_OPT_C_FILE,
2613 .group = FIO_OPT_G_INVALID,
2616 .name = "fdatasync",
2617 .lname = "Fdatasync",
2618 .type = FIO_OPT_INT,
2619 .off1 = offsetof(struct thread_options, fdatasync_blocks),
2620 .help = "Issue fdatasync for writes every given number of blocks",
2623 .category = FIO_OPT_C_FILE,
2624 .group = FIO_OPT_G_INVALID,
2627 .name = "write_barrier",
2628 .lname = "Write barrier",
2629 .type = FIO_OPT_INT,
2630 .off1 = offsetof(struct thread_options, barrier_blocks),
2631 .help = "Make every Nth write a barrier write",
2634 .category = FIO_OPT_C_IO,
2635 .group = FIO_OPT_G_INVALID,
2637 #ifdef CONFIG_SYNC_FILE_RANGE
2639 .name = "sync_file_range",
2640 .lname = "Sync file range",
2642 { .ival = "wait_before",
2643 .oval = SYNC_FILE_RANGE_WAIT_BEFORE,
2644 .help = "SYNC_FILE_RANGE_WAIT_BEFORE",
2648 .oval = SYNC_FILE_RANGE_WRITE,
2649 .help = "SYNC_FILE_RANGE_WRITE",
2653 .ival = "wait_after",
2654 .oval = SYNC_FILE_RANGE_WAIT_AFTER,
2655 .help = "SYNC_FILE_RANGE_WAIT_AFTER",
2659 .type = FIO_OPT_STR_MULTI,
2661 .off1 = offsetof(struct thread_options, sync_file_range),
2662 .help = "Use sync_file_range()",
2663 .category = FIO_OPT_C_FILE,
2664 .group = FIO_OPT_G_INVALID,
2668 .name = "sync_file_range",
2669 .lname = "Sync file range",
2670 .type = FIO_OPT_UNSUPPORTED,
2671 .help = "Your platform does not support sync_file_range",
2676 .lname = "Direct I/O",
2677 .type = FIO_OPT_BOOL,
2678 .off1 = offsetof(struct thread_options, odirect),
2679 .help = "Use O_DIRECT IO (negates buffered)",
2681 .inverse = "buffered",
2682 .category = FIO_OPT_C_IO,
2683 .group = FIO_OPT_G_IO_TYPE,
2687 .lname = "Atomic I/O",
2688 .type = FIO_OPT_BOOL,
2689 .off1 = offsetof(struct thread_options, oatomic),
2690 .help = "Use Atomic IO with O_DIRECT (implies O_DIRECT)",
2692 .category = FIO_OPT_C_IO,
2693 .group = FIO_OPT_G_IO_TYPE,
2697 .lname = "Buffered I/O",
2698 .type = FIO_OPT_BOOL,
2699 .off1 = offsetof(struct thread_options, odirect),
2701 .help = "Use buffered IO (negates direct)",
2703 .inverse = "direct",
2704 .category = FIO_OPT_C_IO,
2705 .group = FIO_OPT_G_IO_TYPE,
2708 .name = "overwrite",
2709 .lname = "Overwrite",
2710 .type = FIO_OPT_BOOL,
2711 .off1 = offsetof(struct thread_options, overwrite),
2712 .help = "When writing, set whether to overwrite current data",
2714 .category = FIO_OPT_C_FILE,
2715 .group = FIO_OPT_G_INVALID,
2720 .type = FIO_OPT_INT,
2721 .off1 = offsetof(struct thread_options, loops),
2722 .help = "Number of times to run the job",
2725 .category = FIO_OPT_C_GENERAL,
2726 .group = FIO_OPT_G_RUNTIME,
2730 .lname = "Number of jobs",
2731 .type = FIO_OPT_INT,
2732 .off1 = offsetof(struct thread_options, numjobs),
2733 .help = "Duplicate this job this many times",
2736 .category = FIO_OPT_C_GENERAL,
2737 .group = FIO_OPT_G_RUNTIME,
2740 .name = "startdelay",
2741 .lname = "Start delay",
2742 .type = FIO_OPT_STR_VAL_TIME,
2743 .off1 = offsetof(struct thread_options, start_delay),
2744 .off2 = offsetof(struct thread_options, start_delay_high),
2745 .help = "Only start job when this period has passed",
2749 .category = FIO_OPT_C_GENERAL,
2750 .group = FIO_OPT_G_RUNTIME,
2756 .type = FIO_OPT_STR_VAL_TIME,
2757 .off1 = offsetof(struct thread_options, timeout),
2758 .help = "Stop workload when this amount of time has passed",
2762 .category = FIO_OPT_C_GENERAL,
2763 .group = FIO_OPT_G_RUNTIME,
2766 .name = "time_based",
2767 .lname = "Time based",
2768 .type = FIO_OPT_STR_SET,
2769 .off1 = offsetof(struct thread_options, time_based),
2770 .help = "Keep running until runtime/timeout is met",
2771 .category = FIO_OPT_C_GENERAL,
2772 .group = FIO_OPT_G_RUNTIME,
2775 .name = "verify_only",
2776 .lname = "Verify only",
2777 .type = FIO_OPT_STR_SET,
2778 .off1 = offsetof(struct thread_options, verify_only),
2779 .help = "Verifies previously written data is still valid",
2780 .category = FIO_OPT_C_GENERAL,
2781 .group = FIO_OPT_G_RUNTIME,
2784 .name = "ramp_time",
2785 .lname = "Ramp time",
2786 .type = FIO_OPT_STR_VAL_TIME,
2787 .off1 = offsetof(struct thread_options, ramp_time),
2788 .help = "Ramp up time before measuring performance",
2791 .category = FIO_OPT_C_GENERAL,
2792 .group = FIO_OPT_G_RUNTIME,
2795 .name = "clocksource",
2796 .lname = "Clock source",
2797 .type = FIO_OPT_STR,
2798 .cb = fio_clock_source_cb,
2799 .off1 = offsetof(struct thread_options, clocksource),
2800 .help = "What type of timing source to use",
2801 .category = FIO_OPT_C_GENERAL,
2802 .group = FIO_OPT_G_CLOCK,
2804 #ifdef CONFIG_GETTIMEOFDAY
2805 { .ival = "gettimeofday",
2807 .help = "Use gettimeofday(2) for timing",
2810 #ifdef CONFIG_CLOCK_GETTIME
2811 { .ival = "clock_gettime",
2812 .oval = CS_CGETTIME,
2813 .help = "Use clock_gettime(2) for timing",
2816 #ifdef ARCH_HAVE_CPU_CLOCK
2818 .oval = CS_CPUCLOCK,
2819 .help = "Use CPU private clock",
2827 .lname = "I/O Memory",
2828 .type = FIO_OPT_STR,
2830 .off1 = offsetof(struct thread_options, mem_type),
2831 .help = "Backing type for IO buffers",
2833 .category = FIO_OPT_C_IO,
2834 .group = FIO_OPT_G_INVALID,
2838 .help = "Use malloc(3) for IO buffers",
2840 #ifndef CONFIG_NO_SHM
2843 .help = "Use shared memory segments for IO buffers",
2845 #ifdef FIO_HAVE_HUGETLB
2846 { .ival = "shmhuge",
2847 .oval = MEM_SHMHUGE,
2848 .help = "Like shm, but use huge pages",
2854 .help = "Use mmap(2) (file or anon) for IO buffers",
2856 { .ival = "mmapshared",
2857 .oval = MEM_MMAPSHARED,
2858 .help = "Like mmap, but use the shared flag",
2860 #ifdef FIO_HAVE_HUGETLB
2861 { .ival = "mmaphuge",
2862 .oval = MEM_MMAPHUGE,
2863 .help = "Like mmap, but use huge pages",
2867 { .ival = "cudamalloc",
2868 .oval = MEM_CUDA_MALLOC,
2869 .help = "Allocate GPU device memory for GPUDirect RDMA",
2875 .name = "iomem_align",
2876 .alias = "mem_align",
2877 .lname = "I/O memory alignment",
2878 .type = FIO_OPT_INT,
2879 .off1 = offsetof(struct thread_options, mem_align),
2881 .help = "IO memory buffer offset alignment",
2885 .category = FIO_OPT_C_IO,
2886 .group = FIO_OPT_G_INVALID,
2891 .type = FIO_OPT_STR,
2892 .off1 = offsetof(struct thread_options, verify),
2893 .help = "Verify data written",
2895 .category = FIO_OPT_C_IO,
2896 .group = FIO_OPT_G_VERIFY,
2899 .oval = VERIFY_NONE,
2900 .help = "Don't do IO verification",
2904 .help = "Use md5 checksums for verification",
2907 .oval = VERIFY_CRC64,
2908 .help = "Use crc64 checksums for verification",
2911 .oval = VERIFY_CRC32,
2912 .help = "Use crc32 checksums for verification",
2914 { .ival = "crc32c-intel",
2915 .oval = VERIFY_CRC32C,
2916 .help = "Use crc32c checksums for verification (hw assisted, if available)",
2919 .oval = VERIFY_CRC32C,
2920 .help = "Use crc32c checksums for verification (hw assisted, if available)",
2923 .oval = VERIFY_CRC16,
2924 .help = "Use crc16 checksums for verification",
2927 .oval = VERIFY_CRC7,
2928 .help = "Use crc7 checksums for verification",
2931 .oval = VERIFY_SHA1,
2932 .help = "Use sha1 checksums for verification",
2935 .oval = VERIFY_SHA256,
2936 .help = "Use sha256 checksums for verification",
2939 .oval = VERIFY_SHA512,
2940 .help = "Use sha512 checksums for verification",
2942 { .ival = "sha3-224",
2943 .oval = VERIFY_SHA3_224,
2944 .help = "Use sha3-224 checksums for verification",
2946 { .ival = "sha3-256",
2947 .oval = VERIFY_SHA3_256,
2948 .help = "Use sha3-256 checksums for verification",
2950 { .ival = "sha3-384",
2951 .oval = VERIFY_SHA3_384,
2952 .help = "Use sha3-384 checksums for verification",
2954 { .ival = "sha3-512",
2955 .oval = VERIFY_SHA3_512,
2956 .help = "Use sha3-512 checksums for verification",
2959 .oval = VERIFY_XXHASH,
2960 .help = "Use xxhash checksums for verification",
2962 /* Meta information was included into verify_header,
2963 * 'meta' verification is implied by default. */
2965 .oval = VERIFY_HDR_ONLY,
2966 .help = "Use io information for verification. "
2967 "Now is implied by default, thus option is obsolete, "
2970 { .ival = "pattern",
2971 .oval = VERIFY_PATTERN_NO_HDR,
2972 .help = "Verify strict pattern",
2976 .oval = VERIFY_NULL,
2977 .help = "Pretend to verify",
2982 .name = "do_verify",
2983 .lname = "Perform verify step",
2984 .type = FIO_OPT_BOOL,
2985 .off1 = offsetof(struct thread_options, do_verify),
2986 .help = "Run verification stage after write",
2990 .category = FIO_OPT_C_IO,
2991 .group = FIO_OPT_G_VERIFY,
2994 .name = "verifysort",
2995 .lname = "Verify sort",
2996 .type = FIO_OPT_SOFT_DEPRECATED,
2997 .category = FIO_OPT_C_IO,
2998 .group = FIO_OPT_G_VERIFY,
3001 .name = "verifysort_nr",
3002 .lname = "Verify Sort Nr",
3003 .type = FIO_OPT_SOFT_DEPRECATED,
3004 .category = FIO_OPT_C_IO,
3005 .group = FIO_OPT_G_VERIFY,
3008 .name = "verify_interval",
3009 .lname = "Verify interval",
3010 .type = FIO_OPT_INT,
3011 .off1 = offsetof(struct thread_options, verify_interval),
3012 .minval = 2 * sizeof(struct verify_header),
3013 .help = "Store verify buffer header every N bytes",
3016 .interval = 2 * sizeof(struct verify_header),
3017 .category = FIO_OPT_C_IO,
3018 .group = FIO_OPT_G_VERIFY,
3021 .name = "verify_offset",
3022 .lname = "Verify offset",
3023 .type = FIO_OPT_INT,
3024 .help = "Offset verify header location by N bytes",
3025 .off1 = offsetof(struct thread_options, verify_offset),
3026 .minval = sizeof(struct verify_header),
3029 .category = FIO_OPT_C_IO,
3030 .group = FIO_OPT_G_VERIFY,
3033 .name = "verify_pattern",
3034 .lname = "Verify pattern",
3035 .type = FIO_OPT_STR,
3036 .cb = str_verify_pattern_cb,
3037 .off1 = offsetof(struct thread_options, verify_pattern),
3038 .help = "Fill pattern for IO buffers",
3041 .category = FIO_OPT_C_IO,
3042 .group = FIO_OPT_G_VERIFY,
3045 .name = "verify_fatal",
3046 .lname = "Verify fatal",
3047 .type = FIO_OPT_BOOL,
3048 .off1 = offsetof(struct thread_options, verify_fatal),
3050 .help = "Exit on a single verify failure, don't continue",
3053 .category = FIO_OPT_C_IO,
3054 .group = FIO_OPT_G_VERIFY,
3057 .name = "verify_dump",
3058 .lname = "Verify dump",
3059 .type = FIO_OPT_BOOL,
3060 .off1 = offsetof(struct thread_options, verify_dump),
3062 .help = "Dump contents of good and bad blocks on failure",
3065 .category = FIO_OPT_C_IO,
3066 .group = FIO_OPT_G_VERIFY,
3069 .name = "verify_async",
3070 .lname = "Verify asynchronously",
3071 .type = FIO_OPT_INT,
3072 .off1 = offsetof(struct thread_options, verify_async),
3074 .help = "Number of async verifier threads to use",
3077 .category = FIO_OPT_C_IO,
3078 .group = FIO_OPT_G_VERIFY,
3081 .name = "verify_backlog",
3082 .lname = "Verify backlog",
3083 .type = FIO_OPT_STR_VAL,
3084 .off1 = offsetof(struct thread_options, verify_backlog),
3085 .help = "Verify after this number of blocks are written",
3088 .category = FIO_OPT_C_IO,
3089 .group = FIO_OPT_G_VERIFY,
3092 .name = "verify_backlog_batch",
3093 .lname = "Verify backlog batch",
3094 .type = FIO_OPT_INT,
3095 .off1 = offsetof(struct thread_options, verify_batch),
3096 .help = "Verify this number of IO blocks",
3099 .category = FIO_OPT_C_IO,
3100 .group = FIO_OPT_G_VERIFY,
3102 #ifdef FIO_HAVE_CPU_AFFINITY
3104 .name = "verify_async_cpus",
3105 .lname = "Async verify CPUs",
3106 .type = FIO_OPT_STR,
3107 .cb = str_verify_cpus_allowed_cb,
3108 .off1 = offsetof(struct thread_options, verify_cpumask),
3109 .help = "Set CPUs allowed for async verify threads",
3110 .parent = "verify_async",
3112 .category = FIO_OPT_C_IO,
3113 .group = FIO_OPT_G_VERIFY,
3117 .name = "verify_async_cpus",
3118 .lname = "Async verify CPUs",
3119 .type = FIO_OPT_UNSUPPORTED,
3120 .help = "Your platform does not support CPU affinities",
3124 .name = "experimental_verify",
3125 .lname = "Experimental Verify",
3126 .off1 = offsetof(struct thread_options, experimental_verify),
3127 .type = FIO_OPT_BOOL,
3128 .help = "Enable experimental verification",
3130 .category = FIO_OPT_C_IO,
3131 .group = FIO_OPT_G_VERIFY,
3134 .name = "verify_state_load",
3135 .lname = "Load verify state",
3136 .off1 = offsetof(struct thread_options, verify_state),
3137 .type = FIO_OPT_BOOL,
3138 .help = "Load verify termination state",
3140 .category = FIO_OPT_C_IO,
3141 .group = FIO_OPT_G_VERIFY,
3144 .name = "verify_state_save",
3145 .lname = "Save verify state",
3146 .off1 = offsetof(struct thread_options, verify_state_save),
3147 .type = FIO_OPT_BOOL,
3149 .help = "Save verify state on termination",
3151 .category = FIO_OPT_C_IO,
3152 .group = FIO_OPT_G_VERIFY,
3154 #ifdef FIO_HAVE_TRIM
3156 .name = "trim_percentage",
3157 .lname = "Trim percentage",
3158 .type = FIO_OPT_INT,
3159 .off1 = offsetof(struct thread_options, trim_percentage),
3162 .help = "Number of verify blocks to trim (i.e., discard)",
3167 .category = FIO_OPT_C_IO,
3168 .group = FIO_OPT_G_TRIM,
3171 .name = "trim_verify_zero",
3172 .lname = "Verify trim zero",
3173 .type = FIO_OPT_BOOL,
3174 .help = "Verify that trimmed (i.e., discarded) blocks are returned as zeroes",
3175 .off1 = offsetof(struct thread_options, trim_zero),
3176 .parent = "trim_percentage",
3179 .category = FIO_OPT_C_IO,
3180 .group = FIO_OPT_G_TRIM,
3183 .name = "trim_backlog",
3184 .lname = "Trim backlog",
3185 .type = FIO_OPT_STR_VAL,
3186 .off1 = offsetof(struct thread_options, trim_backlog),
3187 .help = "Trim after this number of blocks are written",
3188 .parent = "trim_percentage",
3191 .category = FIO_OPT_C_IO,
3192 .group = FIO_OPT_G_TRIM,
3195 .name = "trim_backlog_batch",
3196 .lname = "Trim backlog batch",
3197 .type = FIO_OPT_INT,
3198 .off1 = offsetof(struct thread_options, trim_batch),
3199 .help = "Trim this number of IO blocks",
3200 .parent = "trim_percentage",
3203 .category = FIO_OPT_C_IO,
3204 .group = FIO_OPT_G_TRIM,
3208 .name = "trim_percentage",
3209 .lname = "Trim percentage",
3210 .type = FIO_OPT_UNSUPPORTED,
3211 .help = "Fio does not support TRIM on your platform",
3214 .name = "trim_verify_zero",
3215 .lname = "Verify trim zero",
3216 .type = FIO_OPT_UNSUPPORTED,
3217 .help = "Fio does not support TRIM on your platform",
3220 .name = "trim_backlog",
3221 .lname = "Trim backlog",
3222 .type = FIO_OPT_UNSUPPORTED,
3223 .help = "Fio does not support TRIM on your platform",
3226 .name = "trim_backlog_batch",
3227 .lname = "Trim backlog batch",
3228 .type = FIO_OPT_UNSUPPORTED,
3229 .help = "Fio does not support TRIM on your platform",
3233 .name = "write_iolog",
3234 .lname = "Write I/O log",
3235 .type = FIO_OPT_STR_STORE,
3236 .off1 = offsetof(struct thread_options, write_iolog_file),
3237 .help = "Store IO pattern to file",
3238 .category = FIO_OPT_C_IO,
3239 .group = FIO_OPT_G_IOLOG,
3242 .name = "read_iolog",
3243 .lname = "Read I/O log",
3244 .type = FIO_OPT_STR_STORE,
3245 .off1 = offsetof(struct thread_options, read_iolog_file),
3246 .help = "Playback IO pattern from file",
3247 .category = FIO_OPT_C_IO,
3248 .group = FIO_OPT_G_IOLOG,
3251 .name = "read_iolog_chunked",
3252 .lname = "Read I/O log in parts",
3253 .type = FIO_OPT_BOOL,
3254 .off1 = offsetof(struct thread_options, read_iolog_chunked),
3256 .parent = "read_iolog",
3257 .help = "Parse IO pattern in chunks",
3258 .category = FIO_OPT_C_IO,
3259 .group = FIO_OPT_G_IOLOG,
3262 .name = "replay_no_stall",
3263 .lname = "Don't stall on replay",
3264 .type = FIO_OPT_BOOL,
3265 .off1 = offsetof(struct thread_options, no_stall),
3267 .parent = "read_iolog",
3269 .help = "Playback IO pattern file as fast as possible without stalls",
3270 .category = FIO_OPT_C_IO,
3271 .group = FIO_OPT_G_IOLOG,
3274 .name = "replay_redirect",
3275 .lname = "Redirect device for replay",
3276 .type = FIO_OPT_STR_STORE,
3277 .off1 = offsetof(struct thread_options, replay_redirect),
3278 .parent = "read_iolog",
3280 .help = "Replay all I/O onto this device, regardless of trace device",
3281 .category = FIO_OPT_C_IO,
3282 .group = FIO_OPT_G_IOLOG,
3285 .name = "replay_scale",
3286 .lname = "Replace offset scale factor",
3287 .type = FIO_OPT_INT,
3288 .off1 = offsetof(struct thread_options, replay_scale),
3289 .parent = "read_iolog",
3291 .help = "Align offsets to this blocksize",
3292 .category = FIO_OPT_C_IO,
3293 .group = FIO_OPT_G_IOLOG,
3296 .name = "replay_align",
3297 .lname = "Replace alignment",
3298 .type = FIO_OPT_INT,
3299 .off1 = offsetof(struct thread_options, replay_align),
3300 .parent = "read_iolog",
3301 .help = "Scale offset down by this factor",
3302 .category = FIO_OPT_C_IO,
3303 .group = FIO_OPT_G_IOLOG,
3307 .name = "replay_time_scale",
3308 .lname = "Replay Time Scale",
3309 .type = FIO_OPT_INT,
3310 .off1 = offsetof(struct thread_options, replay_time_scale),
3313 .parent = "read_iolog",
3315 .help = "Scale time for replay events",
3316 .category = FIO_OPT_C_IO,
3317 .group = FIO_OPT_G_IOLOG,
3320 .name = "replay_skip",
3321 .lname = "Replay Skip",
3322 .type = FIO_OPT_STR,
3323 .cb = str_replay_skip_cb,
3324 .off1 = offsetof(struct thread_options, replay_skip),
3325 .parent = "read_iolog",
3326 .help = "Skip certain IO types (read,write,trim,flush)",
3327 .category = FIO_OPT_C_IO,
3328 .group = FIO_OPT_G_IOLOG,
3331 .name = "merge_blktrace_file",
3332 .lname = "Merged blktrace output filename",
3333 .type = FIO_OPT_STR_STORE,
3334 .off1 = offsetof(struct thread_options, merge_blktrace_file),
3335 .help = "Merged blktrace output filename",
3336 .category = FIO_OPT_C_IO,
3337 .group = FIO_OPT_G_IOLOG,
3340 .name = "merge_blktrace_scalars",
3341 .lname = "Percentage to scale each trace",
3342 .type = FIO_OPT_FLOAT_LIST,
3343 .off1 = offsetof(struct thread_options, merge_blktrace_scalars),
3344 .maxlen = FIO_IO_U_LIST_MAX_LEN,
3345 .help = "Percentage to scale each trace",
3346 .category = FIO_OPT_C_IO,
3347 .group = FIO_OPT_G_IOLOG,
3350 .name = "merge_blktrace_iters",
3351 .lname = "Number of iterations to run per trace",
3352 .type = FIO_OPT_FLOAT_LIST,
3353 .off1 = offsetof(struct thread_options, merge_blktrace_iters),
3354 .maxlen = FIO_IO_U_LIST_MAX_LEN,
3355 .help = "Number of iterations to run per trace",
3356 .category = FIO_OPT_C_IO,
3357 .group = FIO_OPT_G_IOLOG,
3360 .name = "exec_prerun",
3361 .lname = "Pre-execute runnable",
3362 .type = FIO_OPT_STR_STORE,
3363 .off1 = offsetof(struct thread_options, exec_prerun),
3364 .help = "Execute this file prior to running job",
3365 .category = FIO_OPT_C_GENERAL,
3366 .group = FIO_OPT_G_INVALID,
3369 .name = "exec_postrun",
3370 .lname = "Post-execute runnable",
3371 .type = FIO_OPT_STR_STORE,
3372 .off1 = offsetof(struct thread_options, exec_postrun),
3373 .help = "Execute this file after running job",
3374 .category = FIO_OPT_C_GENERAL,
3375 .group = FIO_OPT_G_INVALID,
3377 #ifdef FIO_HAVE_IOSCHED_SWITCH
3379 .name = "ioscheduler",
3380 .lname = "I/O scheduler",
3381 .type = FIO_OPT_STR_STORE,
3382 .off1 = offsetof(struct thread_options, ioscheduler),
3383 .help = "Use this IO scheduler on the backing device",
3384 .category = FIO_OPT_C_FILE,
3385 .group = FIO_OPT_G_INVALID,
3389 .name = "ioscheduler",
3390 .lname = "I/O scheduler",
3391 .type = FIO_OPT_UNSUPPORTED,
3392 .help = "Your platform does not support IO scheduler switching",
3397 .lname = "Zone mode",
3398 .help = "Mode for the zonesize, zonerange and zoneskip parameters",
3399 .type = FIO_OPT_STR,
3400 .off1 = offsetof(struct thread_options, zone_mode),
3402 .category = FIO_OPT_C_IO,
3403 .group = FIO_OPT_G_ZONE,
3406 .oval = ZONE_MODE_NONE,
3407 .help = "no zoning",
3409 { .ival = "strided",
3410 .oval = ZONE_MODE_STRIDED,
3411 .help = "strided mode - random I/O is restricted to a single zone",
3414 .oval = ZONE_MODE_ZBD,
3415 .help = "zoned block device mode - random I/O selects one of multiple zones randomly",
3421 .lname = "Zone size",
3422 .type = FIO_OPT_STR_VAL,
3423 .off1 = offsetof(struct thread_options, zone_size),
3424 .help = "Amount of data to read per zone",
3426 .interval = 1024 * 1024,
3427 .category = FIO_OPT_C_IO,
3428 .group = FIO_OPT_G_ZONE,
3431 .name = "zonecapacity",
3432 .lname = "Zone capacity",
3433 .type = FIO_OPT_STR_VAL,
3434 .off1 = offsetof(struct thread_options, zone_capacity),
3435 .help = "Capacity per zone",
3437 .interval = 1024 * 1024,
3438 .category = FIO_OPT_C_IO,
3439 .group = FIO_OPT_G_ZONE,
3442 .name = "zonerange",
3443 .lname = "Zone range",
3444 .type = FIO_OPT_STR_VAL,
3445 .off1 = offsetof(struct thread_options, zone_range),
3446 .help = "Give size of an IO zone",
3448 .interval = 1024 * 1024,
3449 .category = FIO_OPT_C_IO,
3450 .group = FIO_OPT_G_ZONE,
3454 .lname = "Zone skip",
3455 .type = FIO_OPT_STR_VAL_ZONE,
3456 .cb = str_zoneskip_cb,
3457 .off1 = offsetof(struct thread_options, zone_skip),
3458 .help = "Space between IO zones",
3460 .category = FIO_OPT_C_IO,
3461 .group = FIO_OPT_G_ZONE,
3464 .name = "read_beyond_wp",
3465 .lname = "Allow reads beyond the zone write pointer",
3466 .type = FIO_OPT_BOOL,
3467 .off1 = offsetof(struct thread_options, read_beyond_wp),
3468 .help = "Allow reads beyond the zone write pointer",
3470 .category = FIO_OPT_C_IO,
3471 .group = FIO_OPT_G_INVALID,
3474 .name = "max_open_zones",
3475 .lname = "Per device/file maximum number of open zones",
3476 .type = FIO_OPT_INT,
3477 .off1 = offsetof(struct thread_options, max_open_zones),
3478 .maxval = ZBD_MAX_OPEN_ZONES,
3479 .help = "Limit on the number of simultaneously opened sequential write zones with zonemode=zbd",
3481 .category = FIO_OPT_C_IO,
3482 .group = FIO_OPT_G_INVALID,
3485 .name = "job_max_open_zones",
3486 .lname = "Job maximum number of open zones",
3487 .type = FIO_OPT_INT,
3488 .off1 = offsetof(struct thread_options, job_max_open_zones),
3489 .maxval = ZBD_MAX_OPEN_ZONES,
3490 .help = "Limit on the number of simultaneously opened sequential write zones with zonemode=zbd by one thread/process",
3492 .category = FIO_OPT_C_IO,
3493 .group = FIO_OPT_G_INVALID,
3496 .name = "zone_reset_threshold",
3497 .lname = "Zone reset threshold",
3498 .help = "Zoned block device reset threshold",
3499 .type = FIO_OPT_FLOAT_LIST,
3501 .off1 = offsetof(struct thread_options, zrt),
3504 .category = FIO_OPT_C_IO,
3505 .group = FIO_OPT_G_ZONE,
3508 .name = "zone_reset_frequency",
3509 .lname = "Zone reset frequency",
3510 .help = "Zoned block device zone reset frequency in HZ",
3511 .type = FIO_OPT_FLOAT_LIST,
3513 .off1 = offsetof(struct thread_options, zrf),
3516 .category = FIO_OPT_C_IO,
3517 .group = FIO_OPT_G_ZONE,
3521 .lname = "Lock memory",
3522 .type = FIO_OPT_STR_VAL,
3523 .off1 = offsetof(struct thread_options, lockmem),
3524 .help = "Lock down this amount of memory (per worker)",
3526 .interval = 1024 * 1024,
3527 .category = FIO_OPT_C_GENERAL,
3528 .group = FIO_OPT_G_INVALID,
3531 .name = "rwmixread",
3532 .lname = "Read/write mix read",
3533 .type = FIO_OPT_INT,
3534 .cb = str_rwmix_read_cb,
3535 .off1 = offsetof(struct thread_options, rwmix[DDIR_READ]),
3537 .help = "Percentage of mixed workload that is reads",
3540 .inverse = "rwmixwrite",
3541 .category = FIO_OPT_C_IO,
3542 .group = FIO_OPT_G_RWMIX,
3545 .name = "rwmixwrite",
3546 .lname = "Read/write mix write",
3547 .type = FIO_OPT_INT,
3548 .cb = str_rwmix_write_cb,
3549 .off1 = offsetof(struct thread_options, rwmix[DDIR_WRITE]),
3551 .help = "Percentage of mixed workload that is writes",
3554 .inverse = "rwmixread",
3555 .category = FIO_OPT_C_IO,
3556 .group = FIO_OPT_G_RWMIX,
3559 .name = "rwmixcycle",
3560 .lname = "Read/write mix cycle",
3561 .type = FIO_OPT_DEPRECATED,
3562 .category = FIO_OPT_C_IO,
3563 .group = FIO_OPT_G_RWMIX,
3568 .type = FIO_OPT_INT,
3569 .off1 = offsetof(struct thread_options, nice),
3570 .help = "Set job CPU nice value",
3575 .category = FIO_OPT_C_GENERAL,
3576 .group = FIO_OPT_G_CRED,
3578 #ifdef FIO_HAVE_IOPRIO
3581 .lname = "I/O nice priority",
3582 .type = FIO_OPT_INT,
3583 .off1 = offsetof(struct thread_options, ioprio),
3584 .help = "Set job IO priority value",
3585 .minval = IOPRIO_MIN_PRIO,
3586 .maxval = IOPRIO_MAX_PRIO,
3588 .category = FIO_OPT_C_GENERAL,
3589 .group = FIO_OPT_G_CRED,
3594 .lname = "I/O nice priority",
3595 .type = FIO_OPT_UNSUPPORTED,
3596 .help = "Your platform does not support IO priorities",
3599 #ifdef FIO_HAVE_IOPRIO_CLASS
3600 #ifndef FIO_HAVE_IOPRIO
3601 #error "FIO_HAVE_IOPRIO_CLASS requires FIO_HAVE_IOPRIO"
3604 .name = "prioclass",
3605 .lname = "I/O nice priority class",
3606 .type = FIO_OPT_INT,
3607 .off1 = offsetof(struct thread_options, ioprio_class),
3608 .help = "Set job IO priority class",
3609 .minval = IOPRIO_MIN_PRIO_CLASS,
3610 .maxval = IOPRIO_MAX_PRIO_CLASS,
3612 .category = FIO_OPT_C_GENERAL,
3613 .group = FIO_OPT_G_CRED,
3617 .name = "prioclass",
3618 .lname = "I/O nice priority class",
3619 .type = FIO_OPT_UNSUPPORTED,
3620 .help = "Your platform does not support IO priority classes",
3624 .name = "thinktime",
3625 .lname = "Thinktime",
3626 .type = FIO_OPT_INT,
3627 .off1 = offsetof(struct thread_options, thinktime),
3628 .help = "Idle time between IO buffers (usec)",
3631 .category = FIO_OPT_C_IO,
3632 .group = FIO_OPT_G_THINKTIME,
3635 .name = "thinktime_spin",
3636 .lname = "Thinktime spin",
3637 .type = FIO_OPT_INT,
3638 .off1 = offsetof(struct thread_options, thinktime_spin),
3639 .help = "Start think time by spinning this amount (usec)",
3642 .parent = "thinktime",
3644 .category = FIO_OPT_C_IO,
3645 .group = FIO_OPT_G_THINKTIME,
3648 .name = "thinktime_blocks",
3649 .lname = "Thinktime blocks",
3650 .type = FIO_OPT_INT,
3651 .off1 = offsetof(struct thread_options, thinktime_blocks),
3652 .help = "IO buffer period between 'thinktime'",
3654 .parent = "thinktime",
3656 .category = FIO_OPT_C_IO,
3657 .group = FIO_OPT_G_THINKTIME,
3660 .name = "thinktime_blocks_type",
3661 .lname = "Thinktime blocks type",
3662 .type = FIO_OPT_STR,
3663 .off1 = offsetof(struct thread_options, thinktime_blocks_type),
3664 .help = "How thinktime_blocks takes effect",
3666 .category = FIO_OPT_C_IO,
3667 .group = FIO_OPT_G_THINKTIME,
3669 { .ival = "complete",
3670 .oval = THINKTIME_BLOCKS_TYPE_COMPLETE,
3671 .help = "thinktime_blocks takes effect at the completion side",
3675 .oval = THINKTIME_BLOCKS_TYPE_ISSUE,
3676 .help = "thinktime_blocks takes effect at the issue side",
3679 .parent = "thinktime",
3683 .lname = "I/O rate",
3684 .type = FIO_OPT_ULL,
3685 .off1 = offsetof(struct thread_options, rate[DDIR_READ]),
3686 .off2 = offsetof(struct thread_options, rate[DDIR_WRITE]),
3687 .off3 = offsetof(struct thread_options, rate[DDIR_TRIM]),
3688 .help = "Set bandwidth rate",
3689 .category = FIO_OPT_C_IO,
3690 .group = FIO_OPT_G_RATE,
3695 .lname = "I/O min rate",
3696 .type = FIO_OPT_ULL,
3697 .off1 = offsetof(struct thread_options, ratemin[DDIR_READ]),
3698 .off2 = offsetof(struct thread_options, ratemin[DDIR_WRITE]),
3699 .off3 = offsetof(struct thread_options, ratemin[DDIR_TRIM]),
3700 .help = "Job must meet this rate or it will be shutdown",
3703 .category = FIO_OPT_C_IO,
3704 .group = FIO_OPT_G_RATE,
3707 .name = "rate_iops",
3708 .lname = "I/O rate IOPS",
3709 .type = FIO_OPT_INT,
3710 .off1 = offsetof(struct thread_options, rate_iops[DDIR_READ]),
3711 .off2 = offsetof(struct thread_options, rate_iops[DDIR_WRITE]),
3712 .off3 = offsetof(struct thread_options, rate_iops[DDIR_TRIM]),
3713 .help = "Limit IO used to this number of IO operations/sec",
3715 .category = FIO_OPT_C_IO,
3716 .group = FIO_OPT_G_RATE,
3719 .name = "rate_iops_min",
3720 .lname = "I/O min rate IOPS",
3721 .type = FIO_OPT_INT,
3722 .off1 = offsetof(struct thread_options, rate_iops_min[DDIR_READ]),
3723 .off2 = offsetof(struct thread_options, rate_iops_min[DDIR_WRITE]),
3724 .off3 = offsetof(struct thread_options, rate_iops_min[DDIR_TRIM]),
3725 .help = "Job must meet this rate or it will be shut down",
3726 .parent = "rate_iops",
3728 .category = FIO_OPT_C_IO,
3729 .group = FIO_OPT_G_RATE,
3732 .name = "rate_process",
3733 .lname = "Rate Process",
3734 .type = FIO_OPT_STR,
3735 .off1 = offsetof(struct thread_options, rate_process),
3736 .help = "What process controls how rated IO is managed",
3738 .category = FIO_OPT_C_IO,
3739 .group = FIO_OPT_G_RATE,
3742 .oval = RATE_PROCESS_LINEAR,
3743 .help = "Linear rate of IO",
3747 .oval = RATE_PROCESS_POISSON,
3748 .help = "Rate follows Poisson process",
3754 .name = "rate_cycle",
3755 .alias = "ratecycle",
3756 .lname = "I/O rate cycle",
3757 .type = FIO_OPT_INT,
3758 .off1 = offsetof(struct thread_options, ratecycle),
3759 .help = "Window average for rate limits (msec)",
3763 .category = FIO_OPT_C_IO,
3764 .group = FIO_OPT_G_RATE,
3767 .name = "rate_ignore_thinktime",
3768 .lname = "Rate ignore thinktime",
3769 .type = FIO_OPT_BOOL,
3770 .off1 = offsetof(struct thread_options, rate_ign_think),
3771 .help = "Rated IO ignores thinktime settings",
3773 .category = FIO_OPT_C_IO,
3774 .group = FIO_OPT_G_RATE,
3777 .name = "max_latency",
3778 .lname = "Max Latency (usec)",
3779 .type = FIO_OPT_ULL,
3780 .off1 = offsetof(struct thread_options, max_latency[DDIR_READ]),
3781 .off2 = offsetof(struct thread_options, max_latency[DDIR_WRITE]),
3782 .off3 = offsetof(struct thread_options, max_latency[DDIR_TRIM]),
3783 .help = "Maximum tolerated IO latency (usec)",
3785 .category = FIO_OPT_C_IO,
3786 .group = FIO_OPT_G_LATPROF,
3789 .name = "latency_target",
3790 .lname = "Latency Target (usec)",
3791 .type = FIO_OPT_STR_VAL_TIME,
3792 .off1 = offsetof(struct thread_options, latency_target),
3793 .help = "Ramp to max queue depth supporting this latency",
3795 .category = FIO_OPT_C_IO,
3796 .group = FIO_OPT_G_LATPROF,
3799 .name = "latency_window",
3800 .lname = "Latency Window (usec)",
3801 .type = FIO_OPT_STR_VAL_TIME,
3802 .off1 = offsetof(struct thread_options, latency_window),
3803 .help = "Time to sustain latency_target",
3805 .category = FIO_OPT_C_IO,
3806 .group = FIO_OPT_G_LATPROF,
3809 .name = "latency_percentile",
3810 .lname = "Latency Percentile",
3811 .type = FIO_OPT_FLOAT_LIST,
3812 .off1 = offsetof(struct thread_options, latency_percentile),
3813 .help = "Percentile of IOs must be below latency_target",
3818 .category = FIO_OPT_C_IO,
3819 .group = FIO_OPT_G_LATPROF,
3822 .name = "latency_run",
3823 .lname = "Latency Run",
3824 .type = FIO_OPT_BOOL,
3825 .off1 = offsetof(struct thread_options, latency_run),
3826 .help = "Keep adjusting queue depth to match latency_target",
3828 .category = FIO_OPT_C_IO,
3829 .group = FIO_OPT_G_LATPROF,
3832 .name = "invalidate",
3833 .lname = "Cache invalidate",
3834 .type = FIO_OPT_BOOL,
3835 .off1 = offsetof(struct thread_options, invalidate_cache),
3836 .help = "Invalidate buffer/page cache prior to running job",
3838 .category = FIO_OPT_C_IO,
3839 .group = FIO_OPT_G_IO_TYPE,
3843 .lname = "Synchronous I/O",
3844 .type = FIO_OPT_STR,
3845 .off1 = offsetof(struct thread_options, sync_io),
3846 .help = "Use synchronous write IO",
3849 .category = FIO_OPT_C_IO,
3850 .group = FIO_OPT_G_IO_TYPE,
3871 #ifdef FIO_HAVE_WRITE_HINT
3873 .name = "write_hint",
3874 .lname = "Write hint",
3875 .type = FIO_OPT_STR,
3876 .off1 = offsetof(struct thread_options, write_hint),
3877 .help = "Set expected write life time",
3878 .category = FIO_OPT_C_ENGINE,
3879 .group = FIO_OPT_G_INVALID,
3882 .oval = RWH_WRITE_LIFE_NONE,
3885 .oval = RWH_WRITE_LIFE_SHORT,
3888 .oval = RWH_WRITE_LIFE_MEDIUM,
3891 .oval = RWH_WRITE_LIFE_LONG,
3893 { .ival = "extreme",
3894 .oval = RWH_WRITE_LIFE_EXTREME,
3900 .name = "create_serialize",
3901 .lname = "Create serialize",
3902 .type = FIO_OPT_BOOL,
3903 .off1 = offsetof(struct thread_options, create_serialize),
3904 .help = "Serialize creation of job files",
3906 .category = FIO_OPT_C_FILE,
3907 .group = FIO_OPT_G_INVALID,
3910 .name = "create_fsync",
3911 .lname = "Create fsync",
3912 .type = FIO_OPT_BOOL,
3913 .off1 = offsetof(struct thread_options, create_fsync),
3914 .help = "fsync file after creation",
3916 .category = FIO_OPT_C_FILE,
3917 .group = FIO_OPT_G_INVALID,
3920 .name = "create_on_open",
3921 .lname = "Create on open",
3922 .type = FIO_OPT_BOOL,
3923 .off1 = offsetof(struct thread_options, create_on_open),
3924 .help = "Create files when they are opened for IO",
3926 .category = FIO_OPT_C_FILE,
3927 .group = FIO_OPT_G_INVALID,
3930 .name = "create_only",
3931 .lname = "Create Only",
3932 .type = FIO_OPT_BOOL,
3933 .off1 = offsetof(struct thread_options, create_only),
3934 .help = "Only perform file creation phase",
3935 .category = FIO_OPT_C_FILE,
3939 .name = "allow_file_create",
3940 .lname = "Allow file create",
3941 .type = FIO_OPT_BOOL,
3942 .off1 = offsetof(struct thread_options, allow_create),
3943 .help = "Permit fio to create files, if they don't exist",
3945 .category = FIO_OPT_C_FILE,
3946 .group = FIO_OPT_G_FILENAME,
3949 .name = "allow_mounted_write",
3950 .lname = "Allow mounted write",
3951 .type = FIO_OPT_BOOL,
3952 .off1 = offsetof(struct thread_options, allow_mounted_write),
3953 .help = "Allow writes to a mounted partition",
3955 .category = FIO_OPT_C_FILE,
3956 .group = FIO_OPT_G_FILENAME,
3960 .lname = "Pre-read files",
3961 .type = FIO_OPT_BOOL,
3962 .off1 = offsetof(struct thread_options, pre_read),
3963 .help = "Pre-read files before starting official testing",
3965 .category = FIO_OPT_C_FILE,
3966 .group = FIO_OPT_G_INVALID,
3968 #ifdef FIO_HAVE_CPU_AFFINITY
3971 .lname = "CPU mask",
3972 .type = FIO_OPT_INT,
3973 .cb = str_cpumask_cb,
3974 .off1 = offsetof(struct thread_options, cpumask),
3975 .help = "CPU affinity mask",
3976 .category = FIO_OPT_C_GENERAL,
3977 .group = FIO_OPT_G_CRED,
3980 .name = "cpus_allowed",
3981 .lname = "CPUs allowed",
3982 .type = FIO_OPT_STR,
3983 .cb = str_cpus_allowed_cb,
3984 .off1 = offsetof(struct thread_options, cpumask),
3985 .help = "Set CPUs allowed",
3986 .category = FIO_OPT_C_GENERAL,
3987 .group = FIO_OPT_G_CRED,
3990 .name = "cpus_allowed_policy",
3991 .lname = "CPUs allowed distribution policy",
3992 .type = FIO_OPT_STR,
3993 .off1 = offsetof(struct thread_options, cpus_allowed_policy),
3994 .help = "Distribution policy for cpus_allowed",
3995 .parent = "cpus_allowed",
3999 .oval = FIO_CPUS_SHARED,
4000 .help = "Mask shared between threads",
4003 .oval = FIO_CPUS_SPLIT,
4004 .help = "Mask split between threads",
4007 .category = FIO_OPT_C_GENERAL,
4008 .group = FIO_OPT_G_CRED,
4013 .lname = "CPU mask",
4014 .type = FIO_OPT_UNSUPPORTED,
4015 .help = "Your platform does not support CPU affinities",
4018 .name = "cpus_allowed",
4019 .lname = "CPUs allowed",
4020 .type = FIO_OPT_UNSUPPORTED,
4021 .help = "Your platform does not support CPU affinities",
4024 .name = "cpus_allowed_policy",
4025 .lname = "CPUs allowed distribution policy",
4026 .type = FIO_OPT_UNSUPPORTED,
4027 .help = "Your platform does not support CPU affinities",
4030 #ifdef CONFIG_LIBNUMA
4032 .name = "numa_cpu_nodes",
4033 .lname = "NUMA CPU Nodes",
4034 .type = FIO_OPT_STR,
4035 .cb = str_numa_cpunodes_cb,
4036 .off1 = offsetof(struct thread_options, numa_cpunodes),
4037 .help = "NUMA CPU nodes bind",
4038 .category = FIO_OPT_C_GENERAL,
4039 .group = FIO_OPT_G_INVALID,
4042 .name = "numa_mem_policy",
4043 .lname = "NUMA Memory Policy",
4044 .type = FIO_OPT_STR,
4045 .cb = str_numa_mpol_cb,
4046 .off1 = offsetof(struct thread_options, numa_memnodes),
4047 .help = "NUMA memory policy setup",
4048 .category = FIO_OPT_C_GENERAL,
4049 .group = FIO_OPT_G_INVALID,
4053 .name = "numa_cpu_nodes",
4054 .lname = "NUMA CPU Nodes",
4055 .type = FIO_OPT_UNSUPPORTED,
4056 .help = "Build fio with libnuma-dev(el) to enable this option",
4059 .name = "numa_mem_policy",
4060 .lname = "NUMA Memory Policy",
4061 .type = FIO_OPT_UNSUPPORTED,
4062 .help = "Build fio with libnuma-dev(el) to enable this option",
4067 .name = "gpu_dev_id",
4068 .lname = "GPU device ID",
4069 .type = FIO_OPT_INT,
4070 .off1 = offsetof(struct thread_options, gpu_dev_id),
4071 .help = "Set GPU device ID for GPUDirect RDMA",
4073 .category = FIO_OPT_C_GENERAL,
4074 .group = FIO_OPT_G_INVALID,
4078 .name = "end_fsync",
4079 .lname = "End fsync",
4080 .type = FIO_OPT_BOOL,
4081 .off1 = offsetof(struct thread_options, end_fsync),
4082 .help = "Include fsync at the end of job",
4084 .category = FIO_OPT_C_FILE,
4085 .group = FIO_OPT_G_INVALID,
4088 .name = "fsync_on_close",
4089 .lname = "Fsync on close",
4090 .type = FIO_OPT_BOOL,
4091 .off1 = offsetof(struct thread_options, fsync_on_close),
4092 .help = "fsync files on close",
4094 .category = FIO_OPT_C_FILE,
4095 .group = FIO_OPT_G_INVALID,
4099 .lname = "Unlink file",
4100 .type = FIO_OPT_BOOL,
4101 .off1 = offsetof(struct thread_options, unlink),
4102 .help = "Unlink created files after job has completed",
4104 .category = FIO_OPT_C_FILE,
4105 .group = FIO_OPT_G_INVALID,
4108 .name = "unlink_each_loop",
4109 .lname = "Unlink file after each loop of a job",
4110 .type = FIO_OPT_BOOL,
4111 .off1 = offsetof(struct thread_options, unlink_each_loop),
4112 .help = "Unlink created files after each loop in a job has completed",
4114 .category = FIO_OPT_C_FILE,
4115 .group = FIO_OPT_G_INVALID,
4119 .lname = "Exit-all on terminate",
4120 .type = FIO_OPT_STR_SET,
4121 .cb = str_exitall_cb,
4122 .help = "Terminate all jobs when one exits",
4123 .category = FIO_OPT_C_GENERAL,
4124 .group = FIO_OPT_G_PROCESS,
4127 .name = "exit_what",
4128 .lname = "What jobs to quit on terminate",
4129 .type = FIO_OPT_STR,
4130 .off1 = offsetof(struct thread_options, exit_what),
4131 .help = "Fine-grained control for exitall",
4133 .category = FIO_OPT_C_GENERAL,
4134 .group = FIO_OPT_G_PROCESS,
4137 .oval = TERMINATE_GROUP,
4138 .help = "exit_all=1 default behaviour",
4140 { .ival = "stonewall",
4141 .oval = TERMINATE_STONEWALL,
4142 .help = "quit all currently running jobs; continue with next stonewall",
4145 .oval = TERMINATE_ALL,
4146 .help = "Quit everything",
4151 .name = "exitall_on_error",
4152 .lname = "Exit-all on terminate in error",
4153 .type = FIO_OPT_STR_SET,
4154 .off1 = offsetof(struct thread_options, exitall_error),
4155 .help = "Terminate all jobs when one exits in error",
4156 .category = FIO_OPT_C_GENERAL,
4157 .group = FIO_OPT_G_PROCESS,
4160 .name = "stonewall",
4161 .lname = "Wait for previous",
4162 .alias = "wait_for_previous",
4163 .type = FIO_OPT_STR_SET,
4164 .off1 = offsetof(struct thread_options, stonewall),
4165 .help = "Insert a hard barrier between this job and previous",
4166 .category = FIO_OPT_C_GENERAL,
4167 .group = FIO_OPT_G_PROCESS,
4170 .name = "new_group",
4171 .lname = "New group",
4172 .type = FIO_OPT_STR_SET,
4173 .off1 = offsetof(struct thread_options, new_group),
4174 .help = "Mark the start of a new group (for reporting)",
4175 .category = FIO_OPT_C_GENERAL,
4176 .group = FIO_OPT_G_PROCESS,
4181 .type = FIO_OPT_STR_SET,
4182 .off1 = offsetof(struct thread_options, use_thread),
4183 .help = "Use threads instead of processes",
4184 #ifdef CONFIG_NO_SHM
4188 .category = FIO_OPT_C_GENERAL,
4189 .group = FIO_OPT_G_PROCESS,
4192 .name = "per_job_logs",
4193 .lname = "Per Job Logs",
4194 .type = FIO_OPT_BOOL,
4195 .off1 = offsetof(struct thread_options, per_job_logs),
4196 .help = "Include job number in generated log files or not",
4198 .category = FIO_OPT_C_LOG,
4199 .group = FIO_OPT_G_INVALID,
4202 .name = "write_bw_log",
4203 .lname = "Write bandwidth log",
4204 .type = FIO_OPT_STR,
4205 .off1 = offsetof(struct thread_options, bw_log_file),
4206 .cb = str_write_bw_log_cb,
4207 .help = "Write log of bandwidth during run",
4208 .category = FIO_OPT_C_LOG,
4209 .group = FIO_OPT_G_INVALID,
4212 .name = "write_lat_log",
4213 .lname = "Write latency log",
4214 .type = FIO_OPT_STR,
4215 .off1 = offsetof(struct thread_options, lat_log_file),
4216 .cb = str_write_lat_log_cb,
4217 .help = "Write log of latency during run",
4218 .category = FIO_OPT_C_LOG,
4219 .group = FIO_OPT_G_INVALID,
4222 .name = "write_iops_log",
4223 .lname = "Write IOPS log",
4224 .type = FIO_OPT_STR,
4225 .off1 = offsetof(struct thread_options, iops_log_file),
4226 .cb = str_write_iops_log_cb,
4227 .help = "Write log of IOPS during run",
4228 .category = FIO_OPT_C_LOG,
4229 .group = FIO_OPT_G_INVALID,
4232 .name = "log_avg_msec",
4233 .lname = "Log averaging (msec)",
4234 .type = FIO_OPT_INT,
4235 .off1 = offsetof(struct thread_options, log_avg_msec),
4236 .help = "Average bw/iops/lat logs over this period of time",
4238 .category = FIO_OPT_C_LOG,
4239 .group = FIO_OPT_G_INVALID,
4242 .name = "log_hist_msec",
4243 .lname = "Log histograms (msec)",
4244 .type = FIO_OPT_INT,
4245 .off1 = offsetof(struct thread_options, log_hist_msec),
4246 .help = "Dump completion latency histograms at frequency of this time value",
4248 .category = FIO_OPT_C_LOG,
4249 .group = FIO_OPT_G_INVALID,
4252 .name = "log_hist_coarseness",
4253 .lname = "Histogram logs coarseness",
4254 .type = FIO_OPT_INT,
4255 .off1 = offsetof(struct thread_options, log_hist_coarseness),
4256 .help = "Integer in range [0,6]. Higher coarseness outputs"
4257 " fewer histogram bins per sample. The number of bins for"
4258 " these are [1216, 608, 304, 152, 76, 38, 19] respectively.",
4260 .category = FIO_OPT_C_LOG,
4261 .group = FIO_OPT_G_INVALID,
4264 .name = "write_hist_log",
4265 .lname = "Write latency histogram logs",
4266 .type = FIO_OPT_STR,
4267 .off1 = offsetof(struct thread_options, hist_log_file),
4268 .cb = str_write_hist_log_cb,
4269 .help = "Write log of latency histograms during run",
4270 .category = FIO_OPT_C_LOG,
4271 .group = FIO_OPT_G_INVALID,
4274 .name = "log_max_value",
4275 .lname = "Log maximum instead of average",
4276 .type = FIO_OPT_BOOL,
4277 .off1 = offsetof(struct thread_options, log_max),
4278 .help = "Log max sample in a window instead of average",
4280 .category = FIO_OPT_C_LOG,
4281 .group = FIO_OPT_G_INVALID,
4284 .name = "log_offset",
4285 .lname = "Log offset of IO",
4286 .type = FIO_OPT_BOOL,
4287 .off1 = offsetof(struct thread_options, log_offset),
4288 .help = "Include offset of IO for each log entry",
4290 .category = FIO_OPT_C_LOG,
4291 .group = FIO_OPT_G_INVALID,
4295 .name = "log_compression",
4296 .lname = "Log compression",
4297 .type = FIO_OPT_INT,
4298 .off1 = offsetof(struct thread_options, log_gz),
4299 .help = "Log in compressed chunks of this size",
4301 .maxval = 512 * 1024 * 1024ULL,
4302 .category = FIO_OPT_C_LOG,
4303 .group = FIO_OPT_G_INVALID,
4305 #ifdef FIO_HAVE_CPU_AFFINITY
4307 .name = "log_compression_cpus",
4308 .lname = "Log Compression CPUs",
4309 .type = FIO_OPT_STR,
4310 .cb = str_log_cpus_allowed_cb,
4311 .off1 = offsetof(struct thread_options, log_gz_cpumask),
4312 .parent = "log_compression",
4313 .help = "Limit log compression to these CPUs",
4314 .category = FIO_OPT_C_LOG,
4315 .group = FIO_OPT_G_INVALID,
4319 .name = "log_compression_cpus",
4320 .lname = "Log Compression CPUs",
4321 .type = FIO_OPT_UNSUPPORTED,
4322 .help = "Your platform does not support CPU affinities",
4326 .name = "log_store_compressed",
4327 .lname = "Log store compressed",
4328 .type = FIO_OPT_BOOL,
4329 .off1 = offsetof(struct thread_options, log_gz_store),
4330 .help = "Store logs in a compressed format",
4331 .category = FIO_OPT_C_LOG,
4332 .group = FIO_OPT_G_INVALID,
4336 .name = "log_compression",
4337 .lname = "Log compression",
4338 .type = FIO_OPT_UNSUPPORTED,
4339 .help = "Install libz-dev(el) to get compression support",
4342 .name = "log_store_compressed",
4343 .lname = "Log store compressed",
4344 .type = FIO_OPT_UNSUPPORTED,
4345 .help = "Install libz-dev(el) to get compression support",
4349 .name = "log_unix_epoch",
4350 .lname = "Log epoch unix",
4351 .type = FIO_OPT_BOOL,
4352 .off1 = offsetof(struct thread_options, log_unix_epoch),
4353 .help = "Use Unix time in log files",
4354 .category = FIO_OPT_C_LOG,
4355 .group = FIO_OPT_G_INVALID,
4358 .name = "block_error_percentiles",
4359 .lname = "Block error percentiles",
4360 .type = FIO_OPT_BOOL,
4361 .off1 = offsetof(struct thread_options, block_error_hist),
4362 .help = "Record trim block errors and make a histogram",
4364 .category = FIO_OPT_C_LOG,
4365 .group = FIO_OPT_G_INVALID,
4368 .name = "bwavgtime",
4369 .lname = "Bandwidth average time",
4370 .type = FIO_OPT_INT,
4371 .off1 = offsetof(struct thread_options, bw_avg_time),
4372 .help = "Time window over which to calculate bandwidth"
4375 .parent = "write_bw_log",
4378 .category = FIO_OPT_C_LOG,
4379 .group = FIO_OPT_G_INVALID,
4382 .name = "iopsavgtime",
4383 .lname = "IOPS average time",
4384 .type = FIO_OPT_INT,
4385 .off1 = offsetof(struct thread_options, iops_avg_time),
4386 .help = "Time window over which to calculate IOPS (msec)",
4388 .parent = "write_iops_log",
4391 .category = FIO_OPT_C_LOG,
4392 .group = FIO_OPT_G_INVALID,
4395 .name = "group_reporting",
4396 .lname = "Group reporting",
4397 .type = FIO_OPT_STR_SET,
4398 .off1 = offsetof(struct thread_options, group_reporting),
4399 .help = "Do reporting on a per-group basis",
4400 .category = FIO_OPT_C_STAT,
4401 .group = FIO_OPT_G_INVALID,
4406 .type = FIO_OPT_BOOL,
4407 .off1 = offsetof(struct thread_options, stats),
4408 .help = "Enable collection of stats",
4410 .category = FIO_OPT_C_STAT,
4411 .group = FIO_OPT_G_INVALID,
4414 .name = "zero_buffers",
4415 .lname = "Zero I/O buffers",
4416 .type = FIO_OPT_STR_SET,
4417 .off1 = offsetof(struct thread_options, zero_buffers),
4418 .help = "Init IO buffers to all zeroes",
4419 .category = FIO_OPT_C_IO,
4420 .group = FIO_OPT_G_IO_BUF,
4423 .name = "refill_buffers",
4424 .lname = "Refill I/O buffers",
4425 .type = FIO_OPT_STR_SET,
4426 .off1 = offsetof(struct thread_options, refill_buffers),
4427 .help = "Refill IO buffers on every IO submit",
4428 .category = FIO_OPT_C_IO,
4429 .group = FIO_OPT_G_IO_BUF,
4432 .name = "scramble_buffers",
4433 .lname = "Scramble I/O buffers",
4434 .type = FIO_OPT_BOOL,
4435 .off1 = offsetof(struct thread_options, scramble_buffers),
4436 .help = "Slightly scramble buffers on every IO submit",
4438 .category = FIO_OPT_C_IO,
4439 .group = FIO_OPT_G_IO_BUF,
4442 .name = "buffer_pattern",
4443 .lname = "Buffer pattern",
4444 .type = FIO_OPT_STR,
4445 .cb = str_buffer_pattern_cb,
4446 .off1 = offsetof(struct thread_options, buffer_pattern),
4447 .help = "Fill pattern for IO buffers",
4448 .category = FIO_OPT_C_IO,
4449 .group = FIO_OPT_G_IO_BUF,
4452 .name = "buffer_compress_percentage",
4453 .lname = "Buffer compression percentage",
4454 .type = FIO_OPT_INT,
4455 .cb = str_buffer_compress_cb,
4456 .off1 = offsetof(struct thread_options, compress_percentage),
4459 .help = "How compressible the buffer is (approximately)",
4461 .category = FIO_OPT_C_IO,
4462 .group = FIO_OPT_G_IO_BUF,
4465 .name = "buffer_compress_chunk",
4466 .lname = "Buffer compression chunk size",
4467 .type = FIO_OPT_INT,
4468 .off1 = offsetof(struct thread_options, compress_chunk),
4469 .parent = "buffer_compress_percentage",
4471 .help = "Size of compressible region in buffer",
4474 .category = FIO_OPT_C_IO,
4475 .group = FIO_OPT_G_IO_BUF,
4478 .name = "dedupe_percentage",
4479 .lname = "Dedupe percentage",
4480 .type = FIO_OPT_INT,
4481 .cb = str_dedupe_cb,
4482 .off1 = offsetof(struct thread_options, dedupe_percentage),
4485 .help = "Percentage of buffers that are dedupable",
4487 .category = FIO_OPT_C_IO,
4488 .group = FIO_OPT_G_IO_BUF,
4491 .name = "clat_percentiles",
4492 .lname = "Completion latency percentiles",
4493 .type = FIO_OPT_BOOL,
4494 .off1 = offsetof(struct thread_options, clat_percentiles),
4495 .help = "Enable the reporting of completion latency percentiles",
4497 .category = FIO_OPT_C_STAT,
4498 .group = FIO_OPT_G_INVALID,
4501 .name = "lat_percentiles",
4502 .lname = "IO latency percentiles",
4503 .type = FIO_OPT_BOOL,
4504 .off1 = offsetof(struct thread_options, lat_percentiles),
4505 .help = "Enable the reporting of IO latency percentiles",
4507 .category = FIO_OPT_C_STAT,
4508 .group = FIO_OPT_G_INVALID,
4511 .name = "slat_percentiles",
4512 .lname = "Submission latency percentiles",
4513 .type = FIO_OPT_BOOL,
4514 .off1 = offsetof(struct thread_options, slat_percentiles),
4515 .help = "Enable the reporting of submission latency percentiles",
4517 .category = FIO_OPT_C_STAT,
4518 .group = FIO_OPT_G_INVALID,
4521 .name = "percentile_list",
4522 .lname = "Percentile list",
4523 .type = FIO_OPT_FLOAT_LIST,
4524 .off1 = offsetof(struct thread_options, percentile_list),
4525 .off2 = offsetof(struct thread_options, percentile_precision),
4526 .help = "Specify a custom list of percentiles to report for "
4527 "completion latency and block errors",
4528 .def = "1:5:10:20:30:40:50:60:70:80:90:95:99:99.5:99.9:99.95:99.99",
4529 .maxlen = FIO_IO_U_LIST_MAX_LEN,
4532 .category = FIO_OPT_C_STAT,
4533 .group = FIO_OPT_G_INVALID,
4536 .name = "significant_figures",
4537 .lname = "Significant figures",
4538 .type = FIO_OPT_INT,
4539 .off1 = offsetof(struct thread_options, sig_figs),
4542 .help = "Significant figures for output-format set to normal",
4545 .category = FIO_OPT_C_STAT,
4546 .group = FIO_OPT_G_INVALID,
4549 #ifdef FIO_HAVE_DISK_UTIL
4551 .name = "disk_util",
4552 .lname = "Disk utilization",
4553 .type = FIO_OPT_BOOL,
4554 .off1 = offsetof(struct thread_options, do_disk_util),
4555 .help = "Log disk utilization statistics",
4557 .category = FIO_OPT_C_STAT,
4558 .group = FIO_OPT_G_INVALID,
4562 .name = "disk_util",
4563 .lname = "Disk utilization",
4564 .type = FIO_OPT_UNSUPPORTED,
4565 .help = "Your platform does not support disk utilization",
4569 .name = "gtod_reduce",
4570 .lname = "Reduce gettimeofday() calls",
4571 .type = FIO_OPT_BOOL,
4572 .help = "Greatly reduce number of gettimeofday() calls",
4573 .cb = str_gtod_reduce_cb,
4576 .category = FIO_OPT_C_STAT,
4577 .group = FIO_OPT_G_INVALID,
4580 .name = "disable_lat",
4581 .lname = "Disable all latency stats",
4582 .type = FIO_OPT_BOOL,
4583 .off1 = offsetof(struct thread_options, disable_lat),
4584 .help = "Disable latency numbers",
4585 .parent = "gtod_reduce",
4588 .category = FIO_OPT_C_STAT,
4589 .group = FIO_OPT_G_INVALID,
4592 .name = "disable_clat",
4593 .lname = "Disable completion latency stats",
4594 .type = FIO_OPT_BOOL,
4595 .off1 = offsetof(struct thread_options, disable_clat),
4596 .help = "Disable completion latency numbers",
4597 .parent = "gtod_reduce",
4600 .category = FIO_OPT_C_STAT,
4601 .group = FIO_OPT_G_INVALID,
4604 .name = "disable_slat",
4605 .lname = "Disable submission latency stats",
4606 .type = FIO_OPT_BOOL,
4607 .off1 = offsetof(struct thread_options, disable_slat),
4608 .help = "Disable submission latency numbers",
4609 .parent = "gtod_reduce",
4612 .category = FIO_OPT_C_STAT,
4613 .group = FIO_OPT_G_INVALID,
4616 .name = "disable_bw_measurement",
4617 .alias = "disable_bw",
4618 .lname = "Disable bandwidth stats",
4619 .type = FIO_OPT_BOOL,
4620 .off1 = offsetof(struct thread_options, disable_bw),
4621 .help = "Disable bandwidth logging",
4622 .parent = "gtod_reduce",
4625 .category = FIO_OPT_C_STAT,
4626 .group = FIO_OPT_G_INVALID,
4630 .lname = "Dedicated gettimeofday() CPU",
4631 .type = FIO_OPT_INT,
4632 .off1 = offsetof(struct thread_options, gtod_cpu),
4633 .help = "Set up dedicated gettimeofday() thread on this CPU",
4634 .verify = gtod_cpu_verify,
4635 .category = FIO_OPT_C_GENERAL,
4636 .group = FIO_OPT_G_CLOCK,
4639 .name = "unified_rw_reporting",
4640 .lname = "Unified RW Reporting",
4641 .type = FIO_OPT_STR,
4642 .off1 = offsetof(struct thread_options, unified_rw_rep),
4643 .help = "Unify reporting across data direction",
4645 .category = FIO_OPT_C_GENERAL,
4646 .group = FIO_OPT_G_INVALID,
4649 .oval = UNIFIED_SPLIT,
4650 .help = "Normal statistics reporting",
4653 .oval = UNIFIED_MIXED,
4654 .help = "Statistics are summed per data direction and reported together",
4657 .oval = UNIFIED_BOTH,
4658 .help = "Statistics are reported normally, followed by the mixed statistics"
4660 /* Compatibility with former boolean values */
4662 .oval = UNIFIED_SPLIT,
4663 .help = "Alias for 'none'",
4666 .oval = UNIFIED_MIXED,
4667 .help = "Alias for 'mixed'",
4670 .oval = UNIFIED_BOTH,
4671 .help = "Alias for 'both'",
4676 .name = "continue_on_error",
4677 .lname = "Continue on error",
4678 .type = FIO_OPT_STR,
4679 .off1 = offsetof(struct thread_options, continue_on_error),
4680 .help = "Continue on non-fatal errors during IO",
4682 .category = FIO_OPT_C_GENERAL,
4683 .group = FIO_OPT_G_ERR,
4686 .oval = ERROR_TYPE_NONE,
4687 .help = "Exit when an error is encountered",
4690 .oval = ERROR_TYPE_READ,
4691 .help = "Continue on read errors only",
4694 .oval = ERROR_TYPE_WRITE,
4695 .help = "Continue on write errors only",
4698 .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE,
4699 .help = "Continue on any IO errors",
4702 .oval = ERROR_TYPE_VERIFY,
4703 .help = "Continue on verify errors only",
4706 .oval = ERROR_TYPE_ANY,
4707 .help = "Continue on all io and verify errors",
4710 .oval = ERROR_TYPE_NONE,
4711 .help = "Alias for 'none'",
4714 .oval = ERROR_TYPE_ANY,
4715 .help = "Alias for 'all'",
4720 .name = "ignore_error",
4721 .lname = "Ignore Error",
4722 .type = FIO_OPT_STR,
4723 .cb = str_ignore_error_cb,
4724 .off1 = offsetof(struct thread_options, ignore_error_nr),
4725 .help = "Set a specific list of errors to ignore",
4727 .category = FIO_OPT_C_GENERAL,
4728 .group = FIO_OPT_G_ERR,
4731 .name = "error_dump",
4732 .lname = "Error Dump",
4733 .type = FIO_OPT_BOOL,
4734 .off1 = offsetof(struct thread_options, error_dump),
4736 .help = "Dump info on each error",
4737 .category = FIO_OPT_C_GENERAL,
4738 .group = FIO_OPT_G_ERR,
4743 .type = FIO_OPT_STR_STORE,
4744 .off1 = offsetof(struct thread_options, profile),
4745 .help = "Select a specific builtin performance test",
4746 .category = FIO_OPT_C_PROFILE,
4747 .group = FIO_OPT_G_INVALID,
4752 .type = FIO_OPT_STR_STORE,
4753 .off1 = offsetof(struct thread_options, cgroup),
4754 .help = "Add job to cgroup of this name",
4755 .category = FIO_OPT_C_GENERAL,
4756 .group = FIO_OPT_G_CGROUP,
4759 .name = "cgroup_nodelete",
4760 .lname = "Cgroup no-delete",
4761 .type = FIO_OPT_BOOL,
4762 .off1 = offsetof(struct thread_options, cgroup_nodelete),
4763 .help = "Do not delete cgroups after job completion",
4766 .category = FIO_OPT_C_GENERAL,
4767 .group = FIO_OPT_G_CGROUP,
4770 .name = "cgroup_weight",
4771 .lname = "Cgroup weight",
4772 .type = FIO_OPT_INT,
4773 .off1 = offsetof(struct thread_options, cgroup_weight),
4774 .help = "Use given weight for cgroup",
4778 .category = FIO_OPT_C_GENERAL,
4779 .group = FIO_OPT_G_CGROUP,
4784 .type = FIO_OPT_INT,
4785 .off1 = offsetof(struct thread_options, uid),
4786 .help = "Run job with this user ID",
4787 .category = FIO_OPT_C_GENERAL,
4788 .group = FIO_OPT_G_CRED,
4792 .lname = "Group ID",
4793 .type = FIO_OPT_INT,
4794 .off1 = offsetof(struct thread_options, gid),
4795 .help = "Run job with this group ID",
4796 .category = FIO_OPT_C_GENERAL,
4797 .group = FIO_OPT_G_CRED,
4802 .type = FIO_OPT_STR,
4803 .off1 = offsetof(struct thread_options, kb_base),
4809 .help = "Inputs invert IEC and SI prefixes (for compatibility); outputs prefer binary",
4813 .help = "Inputs use IEC and SI prefixes; outputs prefer SI",
4816 .help = "Unit prefix interpretation for quantities of data (IEC and SI)",
4817 .category = FIO_OPT_C_GENERAL,
4818 .group = FIO_OPT_G_INVALID,
4821 .name = "unit_base",
4822 .lname = "Unit for quantities of data (Bits or Bytes)",
4823 .type = FIO_OPT_STR,
4824 .off1 = offsetof(struct thread_options, unit_base),
4829 .help = "Auto-detect",
4832 .oval = N2S_BYTEPERSEC,
4833 .help = "Normal (byte based)",
4836 .oval = N2S_BITPERSEC,
4837 .help = "Bit based",
4840 .help = "Bit multiple of result summary data (8 for byte, 1 for bit)",
4841 .category = FIO_OPT_C_GENERAL,
4842 .group = FIO_OPT_G_INVALID,
4845 .name = "hugepage-size",
4846 .lname = "Hugepage size",
4847 .type = FIO_OPT_INT,
4848 .off1 = offsetof(struct thread_options, hugepage_size),
4849 .help = "When using hugepages, specify size of each page",
4850 .def = __fio_stringify(FIO_HUGE_PAGE),
4851 .interval = 1024 * 1024,
4852 .category = FIO_OPT_C_GENERAL,
4853 .group = FIO_OPT_G_INVALID,
4857 .lname = "I/O flow ID",
4858 .type = FIO_OPT_INT,
4859 .off1 = offsetof(struct thread_options, flow_id),
4860 .help = "The flow index ID to use",
4862 .category = FIO_OPT_C_IO,
4863 .group = FIO_OPT_G_IO_FLOW,
4867 .lname = "I/O flow weight",
4868 .type = FIO_OPT_INT,
4869 .off1 = offsetof(struct thread_options, flow),
4870 .help = "Weight for flow control of this job",
4871 .parent = "flow_id",
4874 .maxval = FLOW_MAX_WEIGHT,
4875 .category = FIO_OPT_C_IO,
4876 .group = FIO_OPT_G_IO_FLOW,
4879 .name = "flow_watermark",
4880 .lname = "I/O flow watermark",
4881 .type = FIO_OPT_SOFT_DEPRECATED,
4882 .category = FIO_OPT_C_IO,
4883 .group = FIO_OPT_G_IO_FLOW,
4886 .name = "flow_sleep",
4887 .lname = "I/O flow sleep",
4888 .type = FIO_OPT_INT,
4889 .off1 = offsetof(struct thread_options, flow_sleep),
4890 .help = "How many microseconds to sleep after being held"
4891 " back by the flow control mechanism",
4892 .parent = "flow_id",
4895 .category = FIO_OPT_C_IO,
4896 .group = FIO_OPT_G_IO_FLOW,
4899 .name = "steadystate",
4900 .lname = "Steady state threshold",
4902 .type = FIO_OPT_STR,
4903 .off1 = offsetof(struct thread_options, ss_state),
4904 .cb = str_steadystate_cb,
4905 .help = "Define the criterion and limit to judge when a job has reached steady state",
4906 .def = "iops_slope:0.01%",
4909 .oval = FIO_SS_IOPS,
4910 .help = "maximum mean deviation of IOPS measurements",
4912 { .ival = "iops_slope",
4913 .oval = FIO_SS_IOPS_SLOPE,
4914 .help = "slope calculated from IOPS measurements",
4918 .help = "maximum mean deviation of bandwidth measurements",
4922 .oval = FIO_SS_BW_SLOPE,
4923 .help = "slope calculated from bandwidth measurements",
4926 .category = FIO_OPT_C_GENERAL,
4927 .group = FIO_OPT_G_RUNTIME,
4930 .name = "steadystate_duration",
4931 .lname = "Steady state duration",
4933 .parent = "steadystate",
4934 .type = FIO_OPT_STR_VAL_TIME,
4935 .off1 = offsetof(struct thread_options, ss_dur),
4936 .help = "Stop workload upon attaining steady state for specified duration",
4940 .category = FIO_OPT_C_GENERAL,
4941 .group = FIO_OPT_G_RUNTIME,
4944 .name = "steadystate_ramp_time",
4945 .lname = "Steady state ramp time",
4947 .parent = "steadystate",
4948 .type = FIO_OPT_STR_VAL_TIME,
4949 .off1 = offsetof(struct thread_options, ss_ramp_time),
4950 .help = "Delay before initiation of data collection for steady state job termination testing",
4954 .category = FIO_OPT_C_GENERAL,
4955 .group = FIO_OPT_G_RUNTIME,
4962 static void add_to_lopt(struct option *lopt, struct fio_option *o,
4963 const char *name, int val)
4965 lopt->name = (char *) name;
4967 if (o->type == FIO_OPT_STR_SET)
4968 lopt->has_arg = optional_argument;
4970 lopt->has_arg = required_argument;
4973 static void options_to_lopts(struct fio_option *opts,
4974 struct option *long_options,
4975 int i, int option_type)
4977 struct fio_option *o = &opts[0];
4979 add_to_lopt(&long_options[i], o, o->name, option_type);
4982 add_to_lopt(&long_options[i], o, o->alias, option_type);
4987 assert(i < FIO_NR_OPTIONS);
4991 void fio_options_set_ioengine_opts(struct option *long_options,
4992 struct thread_data *td)
4997 while (long_options[i].name) {
4998 if (long_options[i].val == FIO_GETOPT_IOENGINE) {
4999 memset(&long_options[i], 0, sizeof(*long_options));
5006 * Just clear out the prior ioengine options.
5011 options_to_lopts(td->io_ops->options, long_options, i,
5012 FIO_GETOPT_IOENGINE);
5015 void fio_options_dup_and_init(struct option *long_options)
5019 options_init(fio_options);
5022 while (long_options[i].name)
5025 options_to_lopts(fio_options, long_options, i, FIO_GETOPT_JOB);
5028 struct fio_keyword {
5034 static struct fio_keyword fio_keywords[] = {
5036 .word = "$pagesize",
5037 .desc = "Page size in the system",
5040 .word = "$mb_memory",
5041 .desc = "Megabytes of memory online",
5045 .desc = "Number of CPUs online in the system",
5052 void fio_keywords_exit(void)
5054 struct fio_keyword *kw;
5056 kw = &fio_keywords[0];
5064 void fio_keywords_init(void)
5066 unsigned long long mb_memory;
5070 sprintf(buf, "%lu", (unsigned long) page_size);
5071 fio_keywords[0].replace = strdup(buf);
5073 mb_memory = os_phys_mem() / (1024 * 1024);
5074 sprintf(buf, "%llu", mb_memory);
5075 fio_keywords[1].replace = strdup(buf);
5078 sprintf(buf, "%lu", l);
5079 fio_keywords[2].replace = strdup(buf);
5084 static char *bc_calc(char *str)
5086 char buf[128], *tmp;
5091 * No math, just return string
5093 if ((!strchr(str, '+') && !strchr(str, '-') && !strchr(str, '*') &&
5094 !strchr(str, '/')) || strchr(str, '\''))
5098 * Split option from value, we only need to calculate the value
5100 tmp = strchr(str, '=');
5107 * Prevent buffer overflows; such a case isn't reasonable anyway
5109 if (strlen(str) >= 128 || strlen(tmp) > 100)
5112 sprintf(buf, "which %s > /dev/null", BC_APP);
5114 log_err("fio: bc is needed for performing math\n");
5118 sprintf(buf, "echo '%s' | %s", tmp, BC_APP);
5119 f = popen(buf, "r");
5123 ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f);
5130 buf[(tmp - str) + ret - 1] = '\0';
5131 memcpy(buf, str, tmp - str);
5137 * Return a copy of the input string with substrings of the form ${VARNAME}
5138 * substituted with the value of the environment variable VARNAME. The
5139 * substitution always occurs, even if VARNAME is empty or the corresponding
5140 * environment variable undefined.
5142 char *fio_option_dup_subs(const char *opt)
5144 char out[OPT_LEN_MAX+1];
5145 char in[OPT_LEN_MAX+1];
5148 char *ch1, *ch2, *env;
5149 ssize_t nchr = OPT_LEN_MAX;
5152 if (strlen(opt) + 1 > OPT_LEN_MAX) {
5153 log_err("OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX);
5157 snprintf(in, sizeof(in), "%s", opt);
5159 while (*inptr && nchr > 0) {
5160 if (inptr[0] == '$' && inptr[1] == '{') {
5161 ch2 = strchr(inptr, '}');
5162 if (ch2 && inptr+1 < ch2) {
5169 envlen = strlen(env);
5170 if (envlen <= nchr) {
5171 memcpy(outptr, env, envlen);
5181 *outptr++ = *inptr++;
5190 * Look for reserved variable names and replace them with real values
5192 static char *fio_keyword_replace(char *opt)
5198 for (i = 0; fio_keywords[i].word != NULL; i++) {
5199 struct fio_keyword *kw = &fio_keywords[i];
5201 while ((s = strstr(opt, kw->word)) != NULL) {
5202 char *new = calloc(strlen(opt) + 1, 1);
5208 * Copy part of the string before the keyword and
5209 * sprintf() the replacement after it.
5211 memcpy(new, opt, olen);
5212 len = sprintf(new + olen, "%s", kw->replace);
5215 * If there's more in the original string, copy that
5218 opt += olen + strlen(kw->word);
5219 /* keeps final zero thanks to calloc */
5221 memcpy(new + olen + len, opt, strlen(opt));
5224 * replace opt and free the old opt
5234 * Check for potential math and invoke bc, if possible
5242 static char **dup_and_sub_options(char **opts, int num_opts)
5245 char **opts_copy = malloc(num_opts * sizeof(*opts));
5246 for (i = 0; i < num_opts; i++) {
5247 opts_copy[i] = fio_option_dup_subs(opts[i]);
5250 opts_copy[i] = fio_keyword_replace(opts_copy[i]);
5255 static void show_closest_option(const char *opt)
5257 int best_option, best_distance;
5266 while (name[i] != '\0' && name[i] != '=')
5271 best_distance = INT_MAX;
5273 while (fio_options[i].name) {
5274 distance = string_distance(name, fio_options[i].name);
5275 if (distance < best_distance) {
5276 best_distance = distance;
5282 if (best_option != -1 && string_distance_ok(name, best_distance) &&
5283 fio_options[best_option].type != FIO_OPT_UNSUPPORTED)
5284 log_err("Did you mean %s?\n", fio_options[best_option].name);
5289 int fio_options_parse(struct thread_data *td, char **opts, int num_opts)
5291 int i, ret, unknown;
5294 sort_options(opts, fio_options, num_opts);
5295 opts_copy = dup_and_sub_options(opts, num_opts);
5297 for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) {
5298 const struct fio_option *o;
5299 int newret = parse_option(opts_copy[i], opts[i], fio_options,
5300 &o, &td->o, &td->opt_list);
5303 fio_option_mark_set(&td->o, o);
5311 opts_copy[i] = NULL;
5318 ret |= ioengine_load(td);
5320 sort_options(opts_copy, td->io_ops->options, num_opts);
5323 for (i = 0; i < num_opts; i++) {
5324 const struct fio_option *o = NULL;
5331 newret = parse_option(opts_copy[i], opts[i],
5332 td->io_ops->options, &o,
5333 td->eo, &td->opt_list);
5337 log_err("Bad option <%s>\n", opts[i]);
5338 show_closest_option(opts[i]);
5341 opts_copy[i] = NULL;
5349 int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val)
5353 ret = parse_cmd_option(opt, val, fio_options, &td->o, &td->opt_list);
5355 const struct fio_option *o;
5357 o = find_option_c(fio_options, opt);
5359 fio_option_mark_set(&td->o, o);
5365 int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt,
5368 return parse_cmd_option(opt, val, td->io_ops->options, td->eo,
5372 void fio_fill_default_options(struct thread_data *td)
5374 td->o.magic = OPT_MAGIC;
5375 fill_default_options(&td->o, fio_options);
5378 int fio_show_option_help(const char *opt)
5380 return show_cmd_help(fio_options, opt);
5384 * dupe FIO_OPT_STR_STORE options
5386 void fio_options_mem_dupe(struct thread_data *td)
5388 options_mem_dupe(fio_options, &td->o);
5390 if (td->eo && td->io_ops) {
5391 void *oldeo = td->eo;
5393 td->eo = malloc(td->io_ops->option_struct_size);
5394 memcpy(td->eo, oldeo, td->io_ops->option_struct_size);
5395 options_mem_dupe(td->io_ops->options, td->eo);
5399 unsigned int fio_get_kb_base(void *data)
5401 struct thread_data *td = cb_data_to_td(data);
5402 struct thread_options *o = &td->o;
5403 unsigned int kb_base = 0;
5406 * This is a hack... For private options, *data is not holding
5407 * a pointer to the thread_options, but to private data. This means
5408 * we can't safely dereference it, but magic is first so mem wise
5409 * it is valid. But this also means that if the job first sets
5410 * kb_base and expects that to be honored by private options,
5411 * it will be disappointed. We will return the global default
5414 if (o && o->magic == OPT_MAGIC)
5415 kb_base = o->kb_base;
5422 int add_option(const struct fio_option *o)
5424 struct fio_option *__o;
5433 if (opt_index + 1 == FIO_MAX_OPTS) {
5434 log_err("fio: FIO_MAX_OPTS is too small\n");
5438 memcpy(&fio_options[opt_index], o, sizeof(*o));
5439 fio_options[opt_index + 1].name = NULL;
5443 void invalidate_profile_options(const char *prof_name)
5445 struct fio_option *o;
5449 if (o->prof_name && !strcmp(o->prof_name, prof_name)) {
5450 o->type = FIO_OPT_INVALID;
5451 o->prof_name = NULL;
5457 void add_opt_posval(const char *optname, const char *ival, const char *help)
5459 struct fio_option *o;
5462 o = find_option(fio_options, optname);
5466 for (i = 0; i < PARSE_MAX_VP; i++) {
5467 if (o->posval[i].ival)
5470 o->posval[i].ival = ival;
5471 o->posval[i].help = help;
5476 void del_opt_posval(const char *optname, const char *ival)
5478 struct fio_option *o;
5481 o = find_option(fio_options, optname);
5485 for (i = 0; i < PARSE_MAX_VP; i++) {
5486 if (!o->posval[i].ival)
5488 if (strcmp(o->posval[i].ival, ival))
5491 o->posval[i].ival = NULL;
5492 o->posval[i].help = NULL;
5496 void fio_options_free(struct thread_data *td)
5498 options_free(fio_options, &td->o);
5499 if (td->eo && td->io_ops && td->io_ops->options) {
5500 options_free(td->io_ops->options, td->eo);
5506 void fio_dump_options_free(struct thread_data *td)
5508 while (!flist_empty(&td->opt_list)) {
5509 struct print_option *p;
5511 p = flist_first_entry(&td->opt_list, struct print_option, list);
5512 flist_del_init(&p->list);
5519 struct fio_option *fio_option_find(const char *name)
5521 return find_option(fio_options, name);
5524 static struct fio_option *find_next_opt(struct fio_option *from,
5527 struct fio_option *opt;
5530 from = &fio_options[0];
5536 if (off1 == from->off1) {
5541 } while (from->name);
5546 static int opt_is_set(struct thread_options *o, struct fio_option *opt)
5548 unsigned int opt_off, index, offset;
5550 opt_off = opt - &fio_options[0];
5551 index = opt_off / (8 * sizeof(uint64_t));
5552 offset = opt_off & ((8 * sizeof(uint64_t)) - 1);
5553 return (o->set_options[index] & ((uint64_t)1 << offset)) != 0;
5556 bool __fio_option_is_set(struct thread_options *o, unsigned int off1)
5558 struct fio_option *opt, *next;
5561 while ((opt = find_next_opt(next, off1)) != NULL) {
5562 if (opt_is_set(o, opt))
5571 void fio_option_mark_set(struct thread_options *o, const struct fio_option *opt)
5573 unsigned int opt_off, index, offset;
5575 opt_off = opt - &fio_options[0];
5576 index = opt_off / (8 * sizeof(uint64_t));
5577 offset = opt_off & ((8 * sizeof(uint64_t)) - 1);
5578 o->set_options[index] |= (uint64_t)1 << offset;