18 #include "crc/crc32c.h"
21 * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that.
23 static char *get_opt_postfix(const char *str)
25 char *p = strstr(str, ":");
31 strip_blank_front(&p);
36 static int converthexchartoint(char a)
56 static int bs_cmp(const void *p1, const void *p2)
58 const struct bssplit *bsp1 = p1;
59 const struct bssplit *bsp2 = p2;
61 return bsp1->perc < bsp2->perc;
64 static int bssplit_ddir(struct thread_options *o, int ddir, char *str)
66 struct bssplit *bssplit;
67 unsigned int i, perc, perc_missing;
68 unsigned int max_bs, min_bs;
72 o->bssplit_nr[ddir] = 4;
73 bssplit = malloc(4 * sizeof(struct bssplit));
78 while ((fname = strsep(&str, ":")) != NULL) {
85 * grow struct buffer, if needed
87 if (i == o->bssplit_nr[ddir]) {
88 o->bssplit_nr[ddir] <<= 1;
89 bssplit = realloc(bssplit, o->bssplit_nr[ddir]
90 * sizeof(struct bssplit));
93 perc_str = strstr(fname, "/");
97 perc = atoi(perc_str);
105 if (str_to_decimal(fname, &val, 1, o)) {
106 log_err("fio: bssplit conversion failed\n");
117 bssplit[i].perc = perc;
121 o->bssplit_nr[ddir] = i;
124 * Now check if the percentages add up, and how much is missing
126 perc = perc_missing = 0;
127 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
128 struct bssplit *bsp = &bssplit[i];
130 if (bsp->perc == (unsigned char) -1)
137 log_err("fio: bssplit percentages add to more than 100%%\n");
142 * If values didn't have a percentage set, divide the remains between
146 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
147 struct bssplit *bsp = &bssplit[i];
149 if (bsp->perc == (unsigned char) -1)
150 bsp->perc = (100 - perc) / perc_missing;
154 o->min_bs[ddir] = min_bs;
155 o->max_bs[ddir] = max_bs;
158 * now sort based on percentages, for ease of lookup
160 qsort(bssplit, o->bssplit_nr[ddir], sizeof(struct bssplit), bs_cmp);
161 o->bssplit[ddir] = bssplit;
165 static int str_bssplit_cb(void *data, const char *input)
167 struct thread_data *td = data;
168 char *str, *p, *odir, *ddir;
174 p = str = strdup(input);
176 strip_blank_front(&str);
177 strip_blank_end(str);
179 odir = strchr(str, ',');
181 ddir = strchr(odir + 1, ',');
183 ret = bssplit_ddir(&td->o, DDIR_TRIM, ddir + 1);
189 op = strdup(odir + 1);
190 ret = bssplit_ddir(&td->o, DDIR_TRIM, op);
195 ret = bssplit_ddir(&td->o, DDIR_WRITE, odir + 1);
198 ret = bssplit_ddir(&td->o, DDIR_READ, str);
204 ret = bssplit_ddir(&td->o, DDIR_WRITE, op);
209 ret = bssplit_ddir(&td->o, DDIR_TRIM, op);
212 ret = bssplit_ddir(&td->o, DDIR_READ, str);
219 static int str2error(char *str)
221 const char *err[] = { "EPERM", "ENOENT", "ESRCH", "EINTR", "EIO",
222 "ENXIO", "E2BIG", "ENOEXEC", "EBADF",
223 "ECHILD", "EAGAIN", "ENOMEM", "EACCES",
224 "EFAULT", "ENOTBLK", "EBUSY", "EEXIST",
225 "EXDEV", "ENODEV", "ENOTDIR", "EISDIR",
226 "EINVAL", "ENFILE", "EMFILE", "ENOTTY",
227 "ETXTBSY","EFBIG", "ENOSPC", "ESPIPE",
228 "EROFS","EMLINK", "EPIPE", "EDOM", "ERANGE" };
229 int i = 0, num = sizeof(err) / sizeof(void *);
232 if (!strcmp(err[i], str))
239 static int ignore_error_type(struct thread_data *td, int etype, char *str)
245 if (etype >= ERROR_TYPE_CNT) {
246 log_err("Illegal error type\n");
250 td->o.ignore_error_nr[etype] = 4;
251 error = malloc(4 * sizeof(struct bssplit));
254 while ((fname = strsep(&str, ":")) != NULL) {
260 * grow struct buffer, if needed
262 if (i == td->o.ignore_error_nr[etype]) {
263 td->o.ignore_error_nr[etype] <<= 1;
264 error = realloc(error, td->o.ignore_error_nr[etype]
267 if (fname[0] == 'E') {
268 error[i] = str2error(fname);
270 error[i] = atoi(fname);
275 log_err("Unknown error %s, please use number value \n",
283 td->o.continue_on_error |= 1 << etype;
284 td->o.ignore_error_nr[etype] = i;
285 td->o.ignore_error[etype] = error;
291 static int str_ignore_error_cb(void *data, const char *input)
293 struct thread_data *td = data;
295 int type = 0, ret = 1;
300 p = str = strdup(input);
302 strip_blank_front(&str);
303 strip_blank_end(str);
309 ret = ignore_error_type(td, type, p);
319 static int str_rw_cb(void *data, const char *str)
321 struct thread_data *td = data;
322 struct thread_options *o = &td->o;
323 char *nr = get_opt_postfix(str);
335 o->ddir_seq_nr = atoi(nr);
339 if (str_to_decimal(nr, &val, 1, o)) {
340 log_err("fio: rw postfix parsing failed\n");
345 o->ddir_seq_add = val;
352 static int str_mem_cb(void *data, const char *mem)
354 struct thread_data *td = data;
356 if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP)
357 td->o.mmapfile = get_opt_postfix(mem);
362 static int fio_clock_source_cb(void *data, const char *str)
364 struct thread_data *td = data;
366 fio_clock_source = td->o.clocksource;
367 fio_clock_source_set = 1;
372 static int str_rwmix_read_cb(void *data, unsigned long long *val)
374 struct thread_data *td = data;
376 td->o.rwmix[DDIR_READ] = *val;
377 td->o.rwmix[DDIR_WRITE] = 100 - *val;
381 static int str_rwmix_write_cb(void *data, unsigned long long *val)
383 struct thread_data *td = data;
385 td->o.rwmix[DDIR_WRITE] = *val;
386 td->o.rwmix[DDIR_READ] = 100 - *val;
390 static int str_exitall_cb(void)
392 exitall_on_terminate = 1;
396 #ifdef FIO_HAVE_CPU_AFFINITY
397 static int str_cpumask_cb(void *data, unsigned long long *val)
399 struct thread_data *td = data;
407 ret = fio_cpuset_init(&td->o.cpumask);
409 log_err("fio: cpuset_init failed\n");
410 td_verror(td, ret, "fio_cpuset_init");
414 max_cpu = cpus_online();
416 for (i = 0; i < sizeof(int) * 8; i++) {
417 if ((1 << i) & *val) {
419 log_err("fio: CPU %d too large (max=%ld)\n", i,
423 dprint(FD_PARSE, "set cpu allowed %d\n", i);
424 fio_cpu_set(&td->o.cpumask, i);
428 td->o.cpumask_set = 1;
432 static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask,
439 ret = fio_cpuset_init(mask);
441 log_err("fio: cpuset_init failed\n");
442 td_verror(td, ret, "fio_cpuset_init");
446 p = str = strdup(input);
448 strip_blank_front(&str);
449 strip_blank_end(str);
451 max_cpu = cpus_online();
453 while ((cpu = strsep(&str, ",")) != NULL) {
462 while ((cpu2 = strsep(&str2, "-")) != NULL) {
472 while (icpu <= icpu2) {
473 if (icpu >= FIO_MAX_CPUS) {
474 log_err("fio: your OS only supports up to"
475 " %d CPUs\n", (int) FIO_MAX_CPUS);
479 if (icpu > max_cpu) {
480 log_err("fio: CPU %d too large (max=%ld)\n",
486 dprint(FD_PARSE, "set cpu allowed %d\n", icpu);
487 fio_cpu_set(mask, icpu);
496 td->o.cpumask_set = 1;
500 static int str_cpus_allowed_cb(void *data, const char *input)
502 struct thread_data *td = data;
508 ret = set_cpus_allowed(td, &td->o.cpumask, input);
510 td->o.cpumask_set = 1;
515 static int str_verify_cpus_allowed_cb(void *data, const char *input)
517 struct thread_data *td = data;
520 ret = set_cpus_allowed(td, &td->o.verify_cpumask, input);
522 td->o.verify_cpumask_set = 1;
528 #ifdef CONFIG_LIBNUMA
529 static int str_numa_cpunodes_cb(void *data, char *input)
531 struct thread_data *td = data;
536 /* numa_parse_nodestring() parses a character string list
537 * of nodes into a bit mask. The bit mask is allocated by
538 * numa_allocate_nodemask(), so it should be freed by
539 * numa_free_nodemask().
541 td->o.numa_cpunodesmask = numa_parse_nodestring(input);
542 if (td->o.numa_cpunodesmask == NULL) {
543 log_err("fio: numa_parse_nodestring failed\n");
544 td_verror(td, 1, "str_numa_cpunodes_cb");
548 td->o.numa_cpumask_set = 1;
552 static int str_numa_mpol_cb(void *data, char *input)
554 struct thread_data *td = data;
555 const char * const policy_types[] =
556 { "default", "prefer", "bind", "interleave", "local", NULL };
563 nodelist = strchr(input, ':');
565 /* NUL-terminate mode */
569 for (i = 0; i <= MPOL_LOCAL; i++) {
570 if (!strcmp(input, policy_types[i])) {
571 td->o.numa_mem_mode = i;
575 if (i > MPOL_LOCAL) {
576 log_err("fio: memory policy should be: default, prefer, bind, interleave, local\n");
580 switch (td->o.numa_mem_mode) {
583 * Insist on a nodelist of one node only
586 char *rest = nodelist;
587 while (isdigit(*rest))
590 log_err("fio: one node only for \'prefer\'\n");
594 log_err("fio: one node is needed for \'prefer\'\n");
598 case MPOL_INTERLEAVE:
600 * Default to online nodes with memory if no nodelist
603 nodelist = strdup("all");
608 * Don't allow a nodelist
611 log_err("fio: NO nodelist for \'local\'\n");
617 * Insist on a nodelist
620 log_err("fio: a nodelist is needed for \'bind\'\n");
627 /* numa_parse_nodestring() parses a character string list
628 * of nodes into a bit mask. The bit mask is allocated by
629 * numa_allocate_nodemask(), so it should be freed by
630 * numa_free_nodemask().
632 switch (td->o.numa_mem_mode) {
634 td->o.numa_mem_prefer_node = atoi(nodelist);
636 case MPOL_INTERLEAVE:
638 td->o.numa_memnodesmask = numa_parse_nodestring(nodelist);
639 if (td->o.numa_memnodesmask == NULL) {
640 log_err("fio: numa_parse_nodestring failed\n");
641 td_verror(td, 1, "str_numa_memnodes_cb");
651 td->o.numa_memmask_set = 1;
659 static int str_fst_cb(void *data, const char *str)
661 struct thread_data *td = data;
662 char *nr = get_opt_postfix(str);
664 td->file_service_nr = 1;
666 td->file_service_nr = atoi(nr);
673 #ifdef CONFIG_SYNC_FILE_RANGE
674 static int str_sfr_cb(void *data, const char *str)
676 struct thread_data *td = data;
677 char *nr = get_opt_postfix(str);
679 td->sync_file_range_nr = 1;
681 td->sync_file_range_nr = atoi(nr);
689 static int str_random_distribution_cb(void *data, const char *str)
691 struct thread_data *td = data;
698 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
700 else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
705 nr = get_opt_postfix(str);
706 if (nr && !str_to_float(nr, &val)) {
707 log_err("fio: random postfix parsing failed\n");
714 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) {
716 log_err("fio: zipf theta must different than 1.0\n");
719 td->o.zipf_theta.u.f = val;
721 if (val <= 0.00 || val >= 1.00) {
722 log_err("fio: pareto input out of range (0 < input < 1.0)\n");
725 td->o.pareto_h.u.f = val;
732 * Return next file in the string. Files are separated with ':'. If the ':'
733 * is escaped with a '\', then that ':' is part of the filename and does not
734 * indicate a new file.
736 static char *get_next_file_name(char **ptr)
741 if (!str || !strlen(str))
747 * No colon, we are done
749 p = strchr(str, ':');
756 * We got a colon, but it's the first character. Skip and
764 if (*(p - 1) != '\\') {
770 memmove(p - 1, p, strlen(p) + 1);
777 static int str_filename_cb(void *data, const char *input)
779 struct thread_data *td = data;
780 char *fname, *str, *p;
782 p = str = strdup(input);
784 strip_blank_front(&str);
785 strip_blank_end(str);
787 if (!td->files_index)
790 while ((fname = get_next_file_name(&str)) != NULL) {
801 static int str_directory_cb(void *data, const char fio_unused *str)
803 struct thread_data *td = data;
809 if (lstat(td->o.directory, &sb) < 0) {
812 log_err("fio: %s is not a directory\n", td->o.directory);
813 td_verror(td, ret, "lstat");
816 if (!S_ISDIR(sb.st_mode)) {
817 log_err("fio: %s is not a directory\n", td->o.directory);
824 static int str_opendir_cb(void *data, const char fio_unused *str)
826 struct thread_data *td = data;
831 if (!td->files_index)
834 return add_dir_files(td, td->o.opendir);
837 static int str_verify_pattern_cb(void *data, const char *input)
839 struct thread_data *td = data;
841 int i = 0, j = 0, len, k, base = 10, pattern_length;
844 loc1 = strstr(input, "0x");
845 loc2 = strstr(input, "0X");
848 off = strtol(input, NULL, base);
849 if (off != LONG_MAX || errno != ERANGE) {
851 td->o.verify_pattern[i] = off & 0xff;
860 j = loc1 - input + 2;
862 j = loc2 - input + 2;
865 if (len - j < MAX_PATTERN_SIZE * 2) {
867 off = converthexchartoint(input[k--]);
869 off += (converthexchartoint(input[k--])
871 td->o.verify_pattern[i++] = (char) off;
877 * Fill the pattern all the way to the end. This greatly reduces
878 * the number of memcpy's we have to do when verifying the IO.
881 while (i > 1 && i * 2 <= MAX_PATTERN_SIZE) {
882 memcpy(&td->o.verify_pattern[i], &td->o.verify_pattern[0], i);
887 * Fill remainder, if the pattern multiple ends up not being
890 while (i > 1 && i < MAX_PATTERN_SIZE) {
891 unsigned int b = min(pattern_length, MAX_PATTERN_SIZE - i);
893 memcpy(&td->o.verify_pattern[i], &td->o.verify_pattern[0], b);
899 * The code in verify_io_u_pattern assumes a single byte pattern
900 * fills the whole verify pattern buffer.
902 memset(td->o.verify_pattern, td->o.verify_pattern[0],
906 td->o.verify_pattern_bytes = i;
909 * VERIFY_META could already be set
911 if (td->o.verify == VERIFY_NONE)
912 td->o.verify = VERIFY_PATTERN;
917 static int str_gtod_reduce_cb(void *data, int *il)
919 struct thread_data *td = data;
922 td->o.disable_lat = !!val;
923 td->o.disable_clat = !!val;
924 td->o.disable_slat = !!val;
925 td->o.disable_bw = !!val;
926 td->o.clat_percentiles = !val;
928 td->tv_cache_mask = 63;
933 static int str_gtod_cpu_cb(void *data, long long *il)
935 struct thread_data *td = data;
938 td->o.gtod_cpu = val;
939 td->o.gtod_offload = 1;
943 static int str_size_cb(void *data, unsigned long long *__val)
945 struct thread_data *td = data;
946 unsigned long long v = *__val;
948 if (parse_is_percent(v)) {
950 td->o.size_percent = -1ULL - v;
957 static int rw_verify(struct fio_option *o, void *data)
959 struct thread_data *td = data;
961 if (read_only && td_write(td)) {
962 log_err("fio: job <%s> has write bit set, but fio is in"
963 " read-only mode\n", td->o.name);
970 static int gtod_cpu_verify(struct fio_option *o, void *data)
972 #ifndef FIO_HAVE_CPU_AFFINITY
973 struct thread_data *td = data;
975 if (td->o.gtod_cpu) {
976 log_err("fio: platform must support CPU affinity for"
977 "gettimeofday() offloading\n");
988 static struct opt_group fio_opt_groups[] = {
991 .mask = FIO_OPT_C_GENERAL,
995 .mask = FIO_OPT_C_IO,
999 .mask = FIO_OPT_C_FILE,
1002 .name = "Statistics",
1003 .mask = FIO_OPT_C_STAT,
1007 .mask = FIO_OPT_C_LOG,
1011 .mask = FIO_OPT_C_PROFILE,
1018 static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned int *mask,
1019 unsigned int inv_mask)
1021 struct opt_group *og;
1024 if (*mask == inv_mask || !*mask)
1027 for (i = 0; ogs[i].name; i++) {
1030 if (*mask & og->mask) {
1031 *mask &= ~(og->mask);
1039 struct opt_group *opt_group_from_mask(unsigned int *mask)
1041 return __opt_group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID);
1044 static struct opt_group fio_opt_cat_groups[] = {
1047 .mask = FIO_OPT_G_RATE,
1051 .mask = FIO_OPT_G_ZONE,
1054 .name = "Read/write mix",
1055 .mask = FIO_OPT_G_RWMIX,
1059 .mask = FIO_OPT_G_VERIFY,
1063 .mask = FIO_OPT_G_TRIM,
1066 .name = "I/O Logging",
1067 .mask = FIO_OPT_G_IOLOG,
1070 .name = "I/O Depth",
1071 .mask = FIO_OPT_G_IO_DEPTH,
1075 .mask = FIO_OPT_G_IO_FLOW,
1078 .name = "Description",
1079 .mask = FIO_OPT_G_DESC,
1083 .mask = FIO_OPT_G_FILENAME,
1086 .name = "General I/O",
1087 .mask = FIO_OPT_G_IO_BASIC,
1091 .mask = FIO_OPT_G_CGROUP,
1095 .mask = FIO_OPT_G_RUNTIME,
1099 .mask = FIO_OPT_G_PROCESS,
1102 .name = "Job credentials / priority",
1103 .mask = FIO_OPT_G_CRED,
1106 .name = "Clock settings",
1107 .mask = FIO_OPT_G_CLOCK,
1111 .mask = FIO_OPT_G_IO_TYPE,
1114 .name = "I/O Thinktime",
1115 .mask = FIO_OPT_G_THINKTIME,
1118 .name = "Randomizations",
1119 .mask = FIO_OPT_G_RANDOM,
1122 .name = "I/O buffers",
1123 .mask = FIO_OPT_G_IO_BUF,
1126 .name = "Tiobench profile",
1127 .mask = FIO_OPT_G_TIOBENCH,
1135 struct opt_group *opt_group_cat_from_mask(unsigned int *mask)
1137 return __opt_group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);
1141 * Map of job/command line options
1143 struct fio_option fio_options[FIO_MAX_OPTS] = {
1145 .name = "description",
1146 .lname = "Description of job",
1147 .type = FIO_OPT_STR_STORE,
1148 .off1 = td_var_offset(description),
1149 .help = "Text job description",
1150 .category = FIO_OPT_C_GENERAL,
1151 .group = FIO_OPT_G_DESC,
1155 .lname = "Job name",
1156 .type = FIO_OPT_STR_STORE,
1157 .off1 = td_var_offset(name),
1158 .help = "Name of this job",
1159 .category = FIO_OPT_C_GENERAL,
1160 .group = FIO_OPT_G_DESC,
1164 .lname = "Filename(s)",
1165 .type = FIO_OPT_STR_STORE,
1166 .off1 = td_var_offset(filename),
1167 .cb = str_filename_cb,
1168 .prio = -1, /* must come after "directory" */
1169 .help = "File(s) to use for the workload",
1170 .category = FIO_OPT_C_FILE,
1171 .group = FIO_OPT_G_FILENAME,
1174 .name = "directory",
1175 .lname = "Directory",
1176 .type = FIO_OPT_STR_STORE,
1177 .off1 = td_var_offset(directory),
1178 .cb = str_directory_cb,
1179 .help = "Directory to store files in",
1180 .category = FIO_OPT_C_FILE,
1181 .group = FIO_OPT_G_FILENAME,
1184 .name = "filename_format",
1185 .type = FIO_OPT_STR_STORE,
1186 .off1 = td_var_offset(filename_format),
1187 .prio = -1, /* must come after "directory" */
1188 .help = "Override default $jobname.$jobnum.$filenum naming",
1189 .def = "$jobname.$jobnum.$filenum",
1190 .category = FIO_OPT_C_FILE,
1191 .group = FIO_OPT_G_FILENAME,
1195 .lname = "Lockfile",
1196 .type = FIO_OPT_STR,
1197 .off1 = td_var_offset(file_lock_mode),
1198 .help = "Lock file when doing IO to it",
1199 .parent = "filename",
1202 .category = FIO_OPT_C_FILE,
1203 .group = FIO_OPT_G_FILENAME,
1206 .oval = FILE_LOCK_NONE,
1207 .help = "No file locking",
1209 { .ival = "exclusive",
1210 .oval = FILE_LOCK_EXCLUSIVE,
1211 .help = "Exclusive file lock",
1214 .ival = "readwrite",
1215 .oval = FILE_LOCK_READWRITE,
1216 .help = "Read vs write lock",
1222 .lname = "Open directory",
1223 .type = FIO_OPT_STR_STORE,
1224 .off1 = td_var_offset(opendir),
1225 .cb = str_opendir_cb,
1226 .help = "Recursively add files from this directory and down",
1227 .category = FIO_OPT_C_FILE,
1228 .group = FIO_OPT_G_FILENAME,
1232 .lname = "Read/write",
1233 .alias = "readwrite",
1234 .type = FIO_OPT_STR,
1236 .off1 = td_var_offset(td_ddir),
1237 .help = "IO direction",
1239 .verify = rw_verify,
1240 .category = FIO_OPT_C_IO,
1241 .group = FIO_OPT_G_IO_BASIC,
1244 .oval = TD_DDIR_READ,
1245 .help = "Sequential read",
1248 .oval = TD_DDIR_WRITE,
1249 .help = "Sequential write",
1252 .oval = TD_DDIR_TRIM,
1253 .help = "Sequential trim",
1255 { .ival = "randread",
1256 .oval = TD_DDIR_RANDREAD,
1257 .help = "Random read",
1259 { .ival = "randwrite",
1260 .oval = TD_DDIR_RANDWRITE,
1261 .help = "Random write",
1263 { .ival = "randtrim",
1264 .oval = TD_DDIR_RANDTRIM,
1265 .help = "Random trim",
1269 .help = "Sequential read and write mix",
1271 { .ival = "readwrite",
1273 .help = "Sequential read and write mix",
1276 .oval = TD_DDIR_RANDRW,
1277 .help = "Random read and write mix"
1282 .name = "rw_sequencer",
1283 .lname = "RW Sequencer",
1284 .type = FIO_OPT_STR,
1285 .off1 = td_var_offset(rw_seq),
1286 .help = "IO offset generator modifier",
1287 .def = "sequential",
1288 .category = FIO_OPT_C_IO,
1289 .group = FIO_OPT_G_IO_BASIC,
1291 { .ival = "sequential",
1293 .help = "Generate sequential offsets",
1295 { .ival = "identical",
1296 .oval = RW_SEQ_IDENT,
1297 .help = "Generate identical offsets",
1304 .lname = "IO Engine",
1305 .type = FIO_OPT_STR_STORE,
1306 .off1 = td_var_offset(ioengine),
1307 .help = "IO engine to use",
1308 .def = FIO_PREFERRED_ENGINE,
1309 .category = FIO_OPT_C_IO,
1310 .group = FIO_OPT_G_IO_BASIC,
1313 .help = "Use read/write",
1316 .help = "Use pread/pwrite",
1319 .help = "Use readv/writev",
1321 #ifdef CONFIG_PWRITEV
1323 .help = "Use preadv/pwritev",
1326 #ifdef CONFIG_LIBAIO
1328 .help = "Linux native asynchronous IO",
1331 #ifdef CONFIG_POSIXAIO
1332 { .ival = "posixaio",
1333 .help = "POSIX asynchronous IO",
1336 #ifdef CONFIG_SOLARISAIO
1337 { .ival = "solarisaio",
1338 .help = "Solaris native asynchronous IO",
1341 #ifdef CONFIG_WINDOWSAIO
1342 { .ival = "windowsaio",
1343 .help = "Windows native asynchronous IO"
1347 .help = "Memory mapped IO"
1349 #ifdef CONFIG_LINUX_SPLICE
1351 .help = "splice/vmsplice based IO",
1353 { .ival = "netsplice",
1354 .help = "splice/vmsplice to/from the network",
1357 #ifdef FIO_HAVE_SGIO
1359 .help = "SCSI generic v3 IO",
1363 .help = "Testing engine (no data transfer)",
1366 .help = "Network IO",
1369 .help = "CPU cycle burner engine",
1373 .help = "GUASI IO engine",
1376 #ifdef FIO_HAVE_BINJECT
1377 { .ival = "binject",
1378 .help = "binject direct inject block engine",
1383 .help = "RDMA IO engine",
1386 #ifdef CONFIG_FUSION_AW
1387 { .ival = "fusion-aw-sync",
1388 .help = "Fusion-io atomic write engine",
1391 #ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
1392 { .ival = "e4defrag",
1393 .help = "ext4 defrag engine",
1396 #ifdef CONFIG_LINUX_FALLOCATE
1398 .help = "fallocate() file based engine",
1401 { .ival = "external",
1402 .help = "Load external engine (append name)",
1408 .lname = "IO Depth",
1409 .type = FIO_OPT_INT,
1410 .off1 = td_var_offset(iodepth),
1411 .help = "Number of IO buffers to keep in flight",
1415 .category = FIO_OPT_C_IO,
1416 .group = FIO_OPT_G_IO_BASIC,
1419 .name = "iodepth_batch",
1420 .lname = "IO Depth batch",
1421 .alias = "iodepth_batch_submit",
1422 .type = FIO_OPT_INT,
1423 .off1 = td_var_offset(iodepth_batch),
1424 .help = "Number of IO buffers to submit in one go",
1425 .parent = "iodepth",
1430 .category = FIO_OPT_C_IO,
1431 .group = FIO_OPT_G_IO_BASIC,
1434 .name = "iodepth_batch_complete",
1435 .lname = "IO Depth batch complete",
1436 .type = FIO_OPT_INT,
1437 .off1 = td_var_offset(iodepth_batch_complete),
1438 .help = "Number of IO buffers to retrieve in one go",
1439 .parent = "iodepth",
1444 .category = FIO_OPT_C_IO,
1445 .group = FIO_OPT_G_IO_BASIC,
1448 .name = "iodepth_low",
1449 .lname = "IO Depth batch low",
1450 .type = FIO_OPT_INT,
1451 .off1 = td_var_offset(iodepth_low),
1452 .help = "Low water mark for queuing depth",
1453 .parent = "iodepth",
1456 .category = FIO_OPT_C_IO,
1457 .group = FIO_OPT_G_IO_BASIC,
1462 .type = FIO_OPT_STR_VAL,
1464 .help = "Total size of device or files",
1465 .interval = 1024 * 1024,
1466 .category = FIO_OPT_C_IO,
1467 .group = FIO_OPT_G_INVALID,
1470 .name = "fill_device",
1471 .lname = "Fill device",
1473 .type = FIO_OPT_BOOL,
1474 .off1 = td_var_offset(fill_device),
1475 .help = "Write until an ENOSPC error occurs",
1477 .category = FIO_OPT_C_FILE,
1478 .group = FIO_OPT_G_INVALID,
1482 .lname = "File size",
1483 .type = FIO_OPT_STR_VAL,
1484 .off1 = td_var_offset(file_size_low),
1485 .off2 = td_var_offset(file_size_high),
1487 .help = "Size of individual files",
1488 .interval = 1024 * 1024,
1489 .category = FIO_OPT_C_FILE,
1490 .group = FIO_OPT_G_INVALID,
1494 .lname = "IO offset",
1495 .alias = "fileoffset",
1496 .type = FIO_OPT_STR_VAL,
1497 .off1 = td_var_offset(start_offset),
1498 .help = "Start IO from this offset",
1500 .interval = 1024 * 1024,
1501 .category = FIO_OPT_C_IO,
1502 .group = FIO_OPT_G_INVALID,
1505 .name = "offset_increment",
1506 .lname = "IO offset increment",
1507 .type = FIO_OPT_STR_VAL,
1508 .off1 = td_var_offset(offset_increment),
1509 .help = "What is the increment from one offset to the next",
1513 .interval = 1024 * 1024,
1514 .category = FIO_OPT_C_IO,
1515 .group = FIO_OPT_G_INVALID,
1518 .name = "number_ios",
1519 .lname = "Number of IOs to perform",
1520 .type = FIO_OPT_STR_VAL,
1521 .off1 = td_var_offset(number_ios),
1522 .help = "Force job completion of this number of IOs",
1524 .category = FIO_OPT_C_IO,
1525 .group = FIO_OPT_G_INVALID,
1529 .lname = "Block size",
1530 .alias = "blocksize",
1531 .type = FIO_OPT_INT,
1532 .off1 = td_var_offset(bs[DDIR_READ]),
1533 .off2 = td_var_offset(bs[DDIR_WRITE]),
1534 .off3 = td_var_offset(bs[DDIR_TRIM]),
1536 .help = "Block size unit",
1541 .category = FIO_OPT_C_IO,
1542 .group = FIO_OPT_G_INVALID,
1546 .lname = "Block size align",
1547 .alias = "blockalign",
1548 .type = FIO_OPT_INT,
1549 .off1 = td_var_offset(ba[DDIR_READ]),
1550 .off2 = td_var_offset(ba[DDIR_WRITE]),
1551 .off3 = td_var_offset(ba[DDIR_TRIM]),
1553 .help = "IO block offset alignment",
1557 .category = FIO_OPT_C_IO,
1558 .group = FIO_OPT_G_INVALID,
1562 .lname = "Block size range",
1563 .alias = "blocksize_range",
1564 .type = FIO_OPT_RANGE,
1565 .off1 = td_var_offset(min_bs[DDIR_READ]),
1566 .off2 = td_var_offset(max_bs[DDIR_READ]),
1567 .off3 = td_var_offset(min_bs[DDIR_WRITE]),
1568 .off4 = td_var_offset(max_bs[DDIR_WRITE]),
1569 .off5 = td_var_offset(min_bs[DDIR_TRIM]),
1570 .off6 = td_var_offset(max_bs[DDIR_TRIM]),
1572 .help = "Set block size range (in more detail than bs)",
1576 .category = FIO_OPT_C_IO,
1577 .group = FIO_OPT_G_INVALID,
1581 .lname = "Block size split",
1582 .type = FIO_OPT_STR,
1583 .cb = str_bssplit_cb,
1584 .help = "Set a specific mix of block sizes",
1587 .category = FIO_OPT_C_IO,
1588 .group = FIO_OPT_G_INVALID,
1591 .name = "bs_unaligned",
1592 .lname = "Block size unaligned",
1593 .alias = "blocksize_unaligned",
1594 .type = FIO_OPT_STR_SET,
1595 .off1 = td_var_offset(bs_unaligned),
1596 .help = "Don't sector align IO buffer sizes",
1599 .category = FIO_OPT_C_IO,
1600 .group = FIO_OPT_G_INVALID,
1603 .name = "bs_is_seq_rand",
1604 .lname = "Block size division is seq/random (not read/write)",
1605 .type = FIO_OPT_BOOL,
1606 .off1 = td_var_offset(bs_is_seq_rand),
1607 .help = "Consider any blocksize setting to be sequential,ramdom",
1609 .parent = "blocksize",
1610 .category = FIO_OPT_C_IO,
1611 .group = FIO_OPT_G_INVALID,
1614 .name = "randrepeat",
1615 .lname = "Random repeatable",
1616 .type = FIO_OPT_BOOL,
1617 .off1 = td_var_offset(rand_repeatable),
1618 .help = "Use repeatable random IO pattern",
1622 .category = FIO_OPT_C_IO,
1623 .group = FIO_OPT_G_RANDOM,
1626 .name = "use_os_rand",
1627 .lname = "Use OS random",
1628 .type = FIO_OPT_BOOL,
1629 .off1 = td_var_offset(use_os_rand),
1630 .help = "Set to use OS random generator",
1634 .category = FIO_OPT_C_IO,
1635 .group = FIO_OPT_G_RANDOM,
1638 .name = "norandommap",
1639 .lname = "No randommap",
1640 .type = FIO_OPT_STR_SET,
1641 .off1 = td_var_offset(norandommap),
1642 .help = "Accept potential duplicate random blocks",
1646 .category = FIO_OPT_C_IO,
1647 .group = FIO_OPT_G_RANDOM,
1650 .name = "softrandommap",
1651 .lname = "Soft randommap",
1652 .type = FIO_OPT_BOOL,
1653 .off1 = td_var_offset(softrandommap),
1654 .help = "Set norandommap if randommap allocation fails",
1655 .parent = "norandommap",
1658 .category = FIO_OPT_C_IO,
1659 .group = FIO_OPT_G_RANDOM,
1662 .name = "random_generator",
1663 .type = FIO_OPT_STR,
1664 .off1 = td_var_offset(random_generator),
1665 .help = "Type of random number generator to use",
1666 .def = "tausworthe",
1668 { .ival = "tausworthe",
1669 .oval = FIO_RAND_GEN_TAUSWORTHE,
1670 .help = "Strong Tausworthe generator",
1673 .oval = FIO_RAND_GEN_LFSR,
1674 .help = "Variable length LFSR",
1677 .category = FIO_OPT_C_IO,
1678 .group = FIO_OPT_G_RANDOM,
1681 .name = "random_distribution",
1682 .type = FIO_OPT_STR,
1683 .off1 = td_var_offset(random_distribution),
1684 .cb = str_random_distribution_cb,
1685 .help = "Random offset distribution generator",
1689 .oval = FIO_RAND_DIST_RANDOM,
1690 .help = "Completely random",
1693 .oval = FIO_RAND_DIST_ZIPF,
1694 .help = "Zipf distribution",
1697 .oval = FIO_RAND_DIST_PARETO,
1698 .help = "Pareto distribution",
1701 .category = FIO_OPT_C_IO,
1702 .group = FIO_OPT_G_RANDOM,
1705 .name = "percentage_random",
1706 .lname = "Percentage Random",
1707 .type = FIO_OPT_INT,
1708 .off1 = td_var_offset(perc_rand[DDIR_READ]),
1709 .off2 = td_var_offset(perc_rand[DDIR_WRITE]),
1710 .off3 = td_var_offset(perc_rand[DDIR_TRIM]),
1712 .help = "Percentage of seq/random mix that should be random",
1713 .def = "100,100,100",
1715 .inverse = "percentage_sequential",
1716 .category = FIO_OPT_C_IO,
1717 .group = FIO_OPT_G_RANDOM,
1720 .name = "percentage_sequential",
1721 .lname = "Percentage Sequential",
1722 .type = FIO_OPT_DEPRECATED,
1723 .category = FIO_OPT_C_IO,
1724 .group = FIO_OPT_G_RANDOM,
1728 .lname = "Number of files",
1729 .alias = "nr_files",
1730 .type = FIO_OPT_INT,
1731 .off1 = td_var_offset(nr_files),
1732 .help = "Split job workload between this number of files",
1735 .category = FIO_OPT_C_FILE,
1736 .group = FIO_OPT_G_INVALID,
1739 .name = "openfiles",
1740 .lname = "Number of open files",
1741 .type = FIO_OPT_INT,
1742 .off1 = td_var_offset(open_files),
1743 .help = "Number of files to keep open at the same time",
1744 .category = FIO_OPT_C_FILE,
1745 .group = FIO_OPT_G_INVALID,
1748 .name = "file_service_type",
1749 .lname = "File service type",
1750 .type = FIO_OPT_STR,
1752 .off1 = td_var_offset(file_service_type),
1753 .help = "How to select which file to service next",
1754 .def = "roundrobin",
1755 .category = FIO_OPT_C_FILE,
1756 .group = FIO_OPT_G_INVALID,
1759 .oval = FIO_FSERVICE_RANDOM,
1760 .help = "Choose a file at random",
1762 { .ival = "roundrobin",
1763 .oval = FIO_FSERVICE_RR,
1764 .help = "Round robin select files",
1766 { .ival = "sequential",
1767 .oval = FIO_FSERVICE_SEQ,
1768 .help = "Finish one file before moving to the next",
1771 .parent = "nrfiles",
1774 #ifdef CONFIG_POSIX_FALLOCATE
1776 .name = "fallocate",
1777 .lname = "Fallocate",
1778 .type = FIO_OPT_STR,
1779 .off1 = td_var_offset(fallocate_mode),
1780 .help = "Whether pre-allocation is performed when laying out files",
1782 .category = FIO_OPT_C_FILE,
1783 .group = FIO_OPT_G_INVALID,
1786 .oval = FIO_FALLOCATE_NONE,
1787 .help = "Do not pre-allocate space",
1790 .oval = FIO_FALLOCATE_POSIX,
1791 .help = "Use posix_fallocate()",
1793 #ifdef CONFIG_LINUX_FALLOCATE
1795 .oval = FIO_FALLOCATE_KEEP_SIZE,
1796 .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)",
1799 /* Compatibility with former boolean values */
1801 .oval = FIO_FALLOCATE_NONE,
1802 .help = "Alias for 'none'",
1805 .oval = FIO_FALLOCATE_POSIX,
1806 .help = "Alias for 'posix'",
1810 #endif /* CONFIG_POSIX_FALLOCATE */
1812 .name = "fadvise_hint",
1813 .lname = "Fadvise hint",
1814 .type = FIO_OPT_BOOL,
1815 .off1 = td_var_offset(fadvise_hint),
1816 .help = "Use fadvise() to advise the kernel on IO pattern",
1818 .category = FIO_OPT_C_FILE,
1819 .group = FIO_OPT_G_INVALID,
1824 .type = FIO_OPT_INT,
1825 .off1 = td_var_offset(fsync_blocks),
1826 .help = "Issue fsync for writes every given number of blocks",
1829 .category = FIO_OPT_C_FILE,
1830 .group = FIO_OPT_G_INVALID,
1833 .name = "fdatasync",
1834 .lname = "Fdatasync",
1835 .type = FIO_OPT_INT,
1836 .off1 = td_var_offset(fdatasync_blocks),
1837 .help = "Issue fdatasync for writes every given number of blocks",
1840 .category = FIO_OPT_C_FILE,
1841 .group = FIO_OPT_G_INVALID,
1844 .name = "write_barrier",
1845 .lname = "Write barrier",
1846 .type = FIO_OPT_INT,
1847 .off1 = td_var_offset(barrier_blocks),
1848 .help = "Make every Nth write a barrier write",
1851 .category = FIO_OPT_C_IO,
1852 .group = FIO_OPT_G_INVALID,
1854 #ifdef CONFIG_SYNC_FILE_RANGE
1856 .name = "sync_file_range",
1857 .lname = "Sync file range",
1859 { .ival = "wait_before",
1860 .oval = SYNC_FILE_RANGE_WAIT_BEFORE,
1861 .help = "SYNC_FILE_RANGE_WAIT_BEFORE",
1865 .oval = SYNC_FILE_RANGE_WRITE,
1866 .help = "SYNC_FILE_RANGE_WRITE",
1870 .ival = "wait_after",
1871 .oval = SYNC_FILE_RANGE_WAIT_AFTER,
1872 .help = "SYNC_FILE_RANGE_WAIT_AFTER",
1876 .type = FIO_OPT_STR_MULTI,
1878 .off1 = td_var_offset(sync_file_range),
1879 .help = "Use sync_file_range()",
1880 .category = FIO_OPT_C_FILE,
1881 .group = FIO_OPT_G_INVALID,
1886 .lname = "Direct I/O",
1887 .type = FIO_OPT_BOOL,
1888 .off1 = td_var_offset(odirect),
1889 .help = "Use O_DIRECT IO (negates buffered)",
1891 .inverse = "buffered",
1892 .category = FIO_OPT_C_IO,
1893 .group = FIO_OPT_G_IO_TYPE,
1897 .lname = "Buffered I/O",
1898 .type = FIO_OPT_BOOL,
1899 .off1 = td_var_offset(odirect),
1901 .help = "Use buffered IO (negates direct)",
1903 .inverse = "direct",
1904 .category = FIO_OPT_C_IO,
1905 .group = FIO_OPT_G_IO_TYPE,
1908 .name = "overwrite",
1909 .lname = "Overwrite",
1910 .type = FIO_OPT_BOOL,
1911 .off1 = td_var_offset(overwrite),
1912 .help = "When writing, set whether to overwrite current data",
1914 .category = FIO_OPT_C_FILE,
1915 .group = FIO_OPT_G_INVALID,
1920 .type = FIO_OPT_INT,
1921 .off1 = td_var_offset(loops),
1922 .help = "Number of times to run the job",
1925 .category = FIO_OPT_C_GENERAL,
1926 .group = FIO_OPT_G_RUNTIME,
1930 .lname = "Number of jobs",
1931 .type = FIO_OPT_INT,
1932 .off1 = td_var_offset(numjobs),
1933 .help = "Duplicate this job this many times",
1936 .category = FIO_OPT_C_GENERAL,
1937 .group = FIO_OPT_G_RUNTIME,
1940 .name = "startdelay",
1941 .lname = "Start delay",
1942 .type = FIO_OPT_STR_VAL_TIME,
1943 .off1 = td_var_offset(start_delay),
1944 .help = "Only start job when this period has passed",
1946 .category = FIO_OPT_C_GENERAL,
1947 .group = FIO_OPT_G_RUNTIME,
1953 .type = FIO_OPT_STR_VAL_TIME,
1954 .off1 = td_var_offset(timeout),
1955 .help = "Stop workload when this amount of time has passed",
1957 .category = FIO_OPT_C_GENERAL,
1958 .group = FIO_OPT_G_RUNTIME,
1961 .name = "time_based",
1962 .lname = "Time based",
1963 .type = FIO_OPT_STR_SET,
1964 .off1 = td_var_offset(time_based),
1965 .help = "Keep running until runtime/timeout is met",
1966 .category = FIO_OPT_C_GENERAL,
1967 .group = FIO_OPT_G_RUNTIME,
1970 .name = "ramp_time",
1971 .lname = "Ramp time",
1972 .type = FIO_OPT_STR_VAL_TIME,
1973 .off1 = td_var_offset(ramp_time),
1974 .help = "Ramp up time before measuring performance",
1975 .category = FIO_OPT_C_GENERAL,
1976 .group = FIO_OPT_G_RUNTIME,
1979 .name = "clocksource",
1980 .lname = "Clock source",
1981 .type = FIO_OPT_STR,
1982 .cb = fio_clock_source_cb,
1983 .off1 = td_var_offset(clocksource),
1984 .help = "What type of timing source to use",
1985 .category = FIO_OPT_C_GENERAL,
1986 .group = FIO_OPT_G_CLOCK,
1988 #ifdef CONFIG_GETTIMEOFDAY
1989 { .ival = "gettimeofday",
1991 .help = "Use gettimeofday(2) for timing",
1994 #ifdef CONFIG_CLOCK_GETTIME
1995 { .ival = "clock_gettime",
1996 .oval = CS_CGETTIME,
1997 .help = "Use clock_gettime(2) for timing",
2000 #ifdef ARCH_HAVE_CPU_CLOCK
2002 .oval = CS_CPUCLOCK,
2003 .help = "Use CPU private clock",
2011 .lname = "I/O Memory",
2012 .type = FIO_OPT_STR,
2014 .off1 = td_var_offset(mem_type),
2015 .help = "Backing type for IO buffers",
2017 .category = FIO_OPT_C_IO,
2018 .group = FIO_OPT_G_INVALID,
2022 .help = "Use malloc(3) for IO buffers",
2026 .help = "Use shared memory segments for IO buffers",
2028 #ifdef FIO_HAVE_HUGETLB
2029 { .ival = "shmhuge",
2030 .oval = MEM_SHMHUGE,
2031 .help = "Like shm, but use huge pages",
2036 .help = "Use mmap(2) (file or anon) for IO buffers",
2038 #ifdef FIO_HAVE_HUGETLB
2039 { .ival = "mmaphuge",
2040 .oval = MEM_MMAPHUGE,
2041 .help = "Like mmap, but use huge pages",
2047 .name = "iomem_align",
2048 .alias = "mem_align",
2049 .lname = "I/O memory alignment",
2050 .type = FIO_OPT_INT,
2051 .off1 = td_var_offset(mem_align),
2053 .help = "IO memory buffer offset alignment",
2057 .category = FIO_OPT_C_IO,
2058 .group = FIO_OPT_G_INVALID,
2063 .type = FIO_OPT_STR,
2064 .off1 = td_var_offset(verify),
2065 .help = "Verify data written",
2067 .category = FIO_OPT_C_IO,
2068 .group = FIO_OPT_G_VERIFY,
2071 .oval = VERIFY_NONE,
2072 .help = "Don't do IO verification",
2076 .help = "Use md5 checksums for verification",
2079 .oval = VERIFY_CRC64,
2080 .help = "Use crc64 checksums for verification",
2083 .oval = VERIFY_CRC32,
2084 .help = "Use crc32 checksums for verification",
2086 { .ival = "crc32c-intel",
2087 .oval = VERIFY_CRC32C,
2088 .help = "Use crc32c checksums for verification (hw assisted, if available)",
2091 .oval = VERIFY_CRC32C,
2092 .help = "Use crc32c checksums for verification (hw assisted, if available)",
2095 .oval = VERIFY_CRC16,
2096 .help = "Use crc16 checksums for verification",
2099 .oval = VERIFY_CRC7,
2100 .help = "Use crc7 checksums for verification",
2103 .oval = VERIFY_SHA1,
2104 .help = "Use sha1 checksums for verification",
2107 .oval = VERIFY_SHA256,
2108 .help = "Use sha256 checksums for verification",
2111 .oval = VERIFY_SHA512,
2112 .help = "Use sha512 checksums for verification",
2115 .oval = VERIFY_META,
2116 .help = "Use io information",
2120 .oval = VERIFY_NULL,
2121 .help = "Pretend to verify",
2126 .name = "do_verify",
2127 .lname = "Perform verify step",
2128 .type = FIO_OPT_BOOL,
2129 .off1 = td_var_offset(do_verify),
2130 .help = "Run verification stage after write",
2134 .category = FIO_OPT_C_IO,
2135 .group = FIO_OPT_G_VERIFY,
2138 .name = "verifysort",
2139 .lname = "Verify sort",
2140 .type = FIO_OPT_BOOL,
2141 .off1 = td_var_offset(verifysort),
2142 .help = "Sort written verify blocks for read back",
2146 .category = FIO_OPT_C_IO,
2147 .group = FIO_OPT_G_VERIFY,
2150 .name = "verifysort_nr",
2151 .type = FIO_OPT_INT,
2152 .off1 = td_var_offset(verifysort_nr),
2153 .help = "Pre-load and sort verify blocks for a read workload",
2158 .category = FIO_OPT_C_IO,
2159 .group = FIO_OPT_G_VERIFY,
2162 .name = "verify_interval",
2163 .lname = "Verify interval",
2164 .type = FIO_OPT_INT,
2165 .off1 = td_var_offset(verify_interval),
2166 .minval = 2 * sizeof(struct verify_header),
2167 .help = "Store verify buffer header every N bytes",
2170 .interval = 2 * sizeof(struct verify_header),
2171 .category = FIO_OPT_C_IO,
2172 .group = FIO_OPT_G_VERIFY,
2175 .name = "verify_offset",
2176 .lname = "Verify offset",
2177 .type = FIO_OPT_INT,
2178 .help = "Offset verify header location by N bytes",
2179 .off1 = td_var_offset(verify_offset),
2180 .minval = sizeof(struct verify_header),
2183 .category = FIO_OPT_C_IO,
2184 .group = FIO_OPT_G_VERIFY,
2187 .name = "verify_pattern",
2188 .lname = "Verify pattern",
2189 .type = FIO_OPT_STR,
2190 .cb = str_verify_pattern_cb,
2191 .help = "Fill pattern for IO buffers",
2194 .category = FIO_OPT_C_IO,
2195 .group = FIO_OPT_G_VERIFY,
2198 .name = "verify_fatal",
2199 .lname = "Verify fatal",
2200 .type = FIO_OPT_BOOL,
2201 .off1 = td_var_offset(verify_fatal),
2203 .help = "Exit on a single verify failure, don't continue",
2206 .category = FIO_OPT_C_IO,
2207 .group = FIO_OPT_G_VERIFY,
2210 .name = "verify_dump",
2211 .lname = "Verify dump",
2212 .type = FIO_OPT_BOOL,
2213 .off1 = td_var_offset(verify_dump),
2215 .help = "Dump contents of good and bad blocks on failure",
2218 .category = FIO_OPT_C_IO,
2219 .group = FIO_OPT_G_VERIFY,
2222 .name = "verify_async",
2223 .lname = "Verify asynchronously",
2224 .type = FIO_OPT_INT,
2225 .off1 = td_var_offset(verify_async),
2227 .help = "Number of async verifier threads to use",
2230 .category = FIO_OPT_C_IO,
2231 .group = FIO_OPT_G_VERIFY,
2234 .name = "verify_backlog",
2235 .lname = "Verify backlog",
2236 .type = FIO_OPT_STR_VAL,
2237 .off1 = td_var_offset(verify_backlog),
2238 .help = "Verify after this number of blocks are written",
2241 .category = FIO_OPT_C_IO,
2242 .group = FIO_OPT_G_VERIFY,
2245 .name = "verify_backlog_batch",
2246 .lname = "Verify backlog batch",
2247 .type = FIO_OPT_INT,
2248 .off1 = td_var_offset(verify_batch),
2249 .help = "Verify this number of IO blocks",
2252 .category = FIO_OPT_C_IO,
2253 .group = FIO_OPT_G_VERIFY,
2255 #ifdef FIO_HAVE_CPU_AFFINITY
2257 .name = "verify_async_cpus",
2258 .lname = "Async verify CPUs",
2259 .type = FIO_OPT_STR,
2260 .cb = str_verify_cpus_allowed_cb,
2261 .help = "Set CPUs allowed for async verify threads",
2262 .parent = "verify_async",
2264 .category = FIO_OPT_C_IO,
2265 .group = FIO_OPT_G_VERIFY,
2269 .name = "experimental_verify",
2270 .off1 = td_var_offset(experimental_verify),
2271 .type = FIO_OPT_BOOL,
2272 .help = "Enable experimental verification",
2273 .category = FIO_OPT_C_IO,
2274 .group = FIO_OPT_G_VERIFY,
2276 #ifdef FIO_HAVE_TRIM
2278 .name = "trim_percentage",
2279 .lname = "Trim percentage",
2280 .type = FIO_OPT_INT,
2281 .off1 = td_var_offset(trim_percentage),
2284 .help = "Number of verify blocks to discard/trim",
2289 .category = FIO_OPT_C_IO,
2290 .group = FIO_OPT_G_TRIM,
2293 .name = "trim_verify_zero",
2294 .lname = "Verify trim zero",
2295 .type = FIO_OPT_BOOL,
2296 .help = "Verify that trim/discarded blocks are returned as zeroes",
2297 .off1 = td_var_offset(trim_zero),
2298 .parent = "trim_percentage",
2301 .category = FIO_OPT_C_IO,
2302 .group = FIO_OPT_G_TRIM,
2305 .name = "trim_backlog",
2306 .lname = "Trim backlog",
2307 .type = FIO_OPT_STR_VAL,
2308 .off1 = td_var_offset(trim_backlog),
2309 .help = "Trim after this number of blocks are written",
2310 .parent = "trim_percentage",
2313 .category = FIO_OPT_C_IO,
2314 .group = FIO_OPT_G_TRIM,
2317 .name = "trim_backlog_batch",
2318 .lname = "Trim backlog batch",
2319 .type = FIO_OPT_INT,
2320 .off1 = td_var_offset(trim_batch),
2321 .help = "Trim this number of IO blocks",
2322 .parent = "trim_percentage",
2325 .category = FIO_OPT_C_IO,
2326 .group = FIO_OPT_G_TRIM,
2330 .name = "write_iolog",
2331 .lname = "Write I/O log",
2332 .type = FIO_OPT_STR_STORE,
2333 .off1 = td_var_offset(write_iolog_file),
2334 .help = "Store IO pattern to file",
2335 .category = FIO_OPT_C_IO,
2336 .group = FIO_OPT_G_IOLOG,
2339 .name = "read_iolog",
2340 .lname = "Read I/O log",
2341 .type = FIO_OPT_STR_STORE,
2342 .off1 = td_var_offset(read_iolog_file),
2343 .help = "Playback IO pattern from file",
2344 .category = FIO_OPT_C_IO,
2345 .group = FIO_OPT_G_IOLOG,
2348 .name = "replay_no_stall",
2349 .lname = "Don't stall on replay",
2350 .type = FIO_OPT_BOOL,
2351 .off1 = td_var_offset(no_stall),
2353 .parent = "read_iolog",
2355 .help = "Playback IO pattern file as fast as possible without stalls",
2356 .category = FIO_OPT_C_IO,
2357 .group = FIO_OPT_G_IOLOG,
2360 .name = "replay_redirect",
2361 .lname = "Redirect device for replay",
2362 .type = FIO_OPT_STR_STORE,
2363 .off1 = td_var_offset(replay_redirect),
2364 .parent = "read_iolog",
2366 .help = "Replay all I/O onto this device, regardless of trace device",
2367 .category = FIO_OPT_C_IO,
2368 .group = FIO_OPT_G_IOLOG,
2371 .name = "exec_prerun",
2372 .lname = "Pre-execute runnable",
2373 .type = FIO_OPT_STR_STORE,
2374 .off1 = td_var_offset(exec_prerun),
2375 .help = "Execute this file prior to running job",
2376 .category = FIO_OPT_C_GENERAL,
2377 .group = FIO_OPT_G_INVALID,
2380 .name = "exec_postrun",
2381 .lname = "Post-execute runnable",
2382 .type = FIO_OPT_STR_STORE,
2383 .off1 = td_var_offset(exec_postrun),
2384 .help = "Execute this file after running job",
2385 .category = FIO_OPT_C_GENERAL,
2386 .group = FIO_OPT_G_INVALID,
2388 #ifdef FIO_HAVE_IOSCHED_SWITCH
2390 .name = "ioscheduler",
2391 .lname = "I/O scheduler",
2392 .type = FIO_OPT_STR_STORE,
2393 .off1 = td_var_offset(ioscheduler),
2394 .help = "Use this IO scheduler on the backing device",
2395 .category = FIO_OPT_C_FILE,
2396 .group = FIO_OPT_G_INVALID,
2401 .lname = "Zone size",
2402 .type = FIO_OPT_STR_VAL,
2403 .off1 = td_var_offset(zone_size),
2404 .help = "Amount of data to read per zone",
2406 .interval = 1024 * 1024,
2407 .category = FIO_OPT_C_IO,
2408 .group = FIO_OPT_G_ZONE,
2411 .name = "zonerange",
2412 .lname = "Zone range",
2413 .type = FIO_OPT_STR_VAL,
2414 .off1 = td_var_offset(zone_range),
2415 .help = "Give size of an IO zone",
2417 .interval = 1024 * 1024,
2418 .category = FIO_OPT_C_IO,
2419 .group = FIO_OPT_G_ZONE,
2423 .lname = "Zone skip",
2424 .type = FIO_OPT_STR_VAL,
2425 .off1 = td_var_offset(zone_skip),
2426 .help = "Space between IO zones",
2428 .interval = 1024 * 1024,
2429 .category = FIO_OPT_C_IO,
2430 .group = FIO_OPT_G_ZONE,
2434 .lname = "Lock memory",
2435 .type = FIO_OPT_STR_VAL,
2436 .off1 = td_var_offset(lockmem),
2437 .help = "Lock down this amount of memory (per worker)",
2439 .interval = 1024 * 1024,
2440 .category = FIO_OPT_C_GENERAL,
2441 .group = FIO_OPT_G_INVALID,
2444 .name = "rwmixread",
2445 .lname = "Read/write mix read",
2446 .type = FIO_OPT_INT,
2447 .cb = str_rwmix_read_cb,
2449 .help = "Percentage of mixed workload that is reads",
2452 .inverse = "rwmixwrite",
2453 .category = FIO_OPT_C_IO,
2454 .group = FIO_OPT_G_RWMIX,
2457 .name = "rwmixwrite",
2458 .lname = "Read/write mix write",
2459 .type = FIO_OPT_INT,
2460 .cb = str_rwmix_write_cb,
2462 .help = "Percentage of mixed workload that is writes",
2465 .inverse = "rwmixread",
2466 .category = FIO_OPT_C_IO,
2467 .group = FIO_OPT_G_RWMIX,
2470 .name = "rwmixcycle",
2471 .lname = "Read/write mix cycle",
2472 .type = FIO_OPT_DEPRECATED,
2473 .category = FIO_OPT_C_IO,
2474 .group = FIO_OPT_G_RWMIX,
2479 .type = FIO_OPT_INT,
2480 .off1 = td_var_offset(nice),
2481 .help = "Set job CPU nice value",
2486 .category = FIO_OPT_C_GENERAL,
2487 .group = FIO_OPT_G_CRED,
2489 #ifdef FIO_HAVE_IOPRIO
2492 .lname = "I/O nice priority",
2493 .type = FIO_OPT_INT,
2494 .off1 = td_var_offset(ioprio),
2495 .help = "Set job IO priority value",
2499 .category = FIO_OPT_C_GENERAL,
2500 .group = FIO_OPT_G_CRED,
2503 .name = "prioclass",
2504 .lname = "I/O nice priority class",
2505 .type = FIO_OPT_INT,
2506 .off1 = td_var_offset(ioprio_class),
2507 .help = "Set job IO priority class",
2511 .category = FIO_OPT_C_GENERAL,
2512 .group = FIO_OPT_G_CRED,
2516 .name = "thinktime",
2517 .lname = "Thinktime",
2518 .type = FIO_OPT_INT,
2519 .off1 = td_var_offset(thinktime),
2520 .help = "Idle time between IO buffers (usec)",
2522 .category = FIO_OPT_C_IO,
2523 .group = FIO_OPT_G_THINKTIME,
2526 .name = "thinktime_spin",
2527 .lname = "Thinktime spin",
2528 .type = FIO_OPT_INT,
2529 .off1 = td_var_offset(thinktime_spin),
2530 .help = "Start think time by spinning this amount (usec)",
2532 .parent = "thinktime",
2534 .category = FIO_OPT_C_IO,
2535 .group = FIO_OPT_G_THINKTIME,
2538 .name = "thinktime_blocks",
2539 .lname = "Thinktime blocks",
2540 .type = FIO_OPT_INT,
2541 .off1 = td_var_offset(thinktime_blocks),
2542 .help = "IO buffer period between 'thinktime'",
2544 .parent = "thinktime",
2546 .category = FIO_OPT_C_IO,
2547 .group = FIO_OPT_G_THINKTIME,
2551 .lname = "I/O rate",
2552 .type = FIO_OPT_INT,
2553 .off1 = td_var_offset(rate[DDIR_READ]),
2554 .off2 = td_var_offset(rate[DDIR_WRITE]),
2555 .off3 = td_var_offset(rate[DDIR_TRIM]),
2556 .help = "Set bandwidth rate",
2557 .category = FIO_OPT_C_IO,
2558 .group = FIO_OPT_G_RATE,
2562 .lname = "I/O min rate",
2563 .type = FIO_OPT_INT,
2564 .off1 = td_var_offset(ratemin[DDIR_READ]),
2565 .off2 = td_var_offset(ratemin[DDIR_WRITE]),
2566 .off3 = td_var_offset(ratemin[DDIR_TRIM]),
2567 .help = "Job must meet this rate or it will be shutdown",
2570 .category = FIO_OPT_C_IO,
2571 .group = FIO_OPT_G_RATE,
2574 .name = "rate_iops",
2575 .lname = "I/O rate IOPS",
2576 .type = FIO_OPT_INT,
2577 .off1 = td_var_offset(rate_iops[DDIR_READ]),
2578 .off2 = td_var_offset(rate_iops[DDIR_WRITE]),
2579 .off3 = td_var_offset(rate_iops[DDIR_TRIM]),
2580 .help = "Limit IO used to this number of IO operations/sec",
2582 .category = FIO_OPT_C_IO,
2583 .group = FIO_OPT_G_RATE,
2586 .name = "rate_iops_min",
2587 .lname = "I/O min rate IOPS",
2588 .type = FIO_OPT_INT,
2589 .off1 = td_var_offset(rate_iops_min[DDIR_READ]),
2590 .off2 = td_var_offset(rate_iops_min[DDIR_WRITE]),
2591 .off3 = td_var_offset(rate_iops_min[DDIR_TRIM]),
2592 .help = "Job must meet this rate or it will be shut down",
2593 .parent = "rate_iops",
2595 .category = FIO_OPT_C_IO,
2596 .group = FIO_OPT_G_RATE,
2599 .name = "ratecycle",
2600 .lname = "I/O rate cycle",
2601 .type = FIO_OPT_INT,
2602 .off1 = td_var_offset(ratecycle),
2603 .help = "Window average for rate limits (msec)",
2607 .category = FIO_OPT_C_IO,
2608 .group = FIO_OPT_G_RATE,
2611 .name = "max_latency",
2612 .type = FIO_OPT_INT,
2613 .off1 = td_var_offset(max_latency),
2614 .help = "Maximum tolerated IO latency (usec)",
2615 .category = FIO_OPT_C_IO,
2616 .group = FIO_OPT_G_RATE,
2619 .name = "invalidate",
2620 .lname = "Cache invalidate",
2621 .type = FIO_OPT_BOOL,
2622 .off1 = td_var_offset(invalidate_cache),
2623 .help = "Invalidate buffer/page cache prior to running job",
2625 .category = FIO_OPT_C_IO,
2626 .group = FIO_OPT_G_IO_TYPE,
2630 .lname = "Synchronous I/O",
2631 .type = FIO_OPT_BOOL,
2632 .off1 = td_var_offset(sync_io),
2633 .help = "Use O_SYNC for buffered writes",
2635 .parent = "buffered",
2637 .category = FIO_OPT_C_IO,
2638 .group = FIO_OPT_G_IO_TYPE,
2641 .name = "create_serialize",
2642 .lname = "Create serialize",
2643 .type = FIO_OPT_BOOL,
2644 .off1 = td_var_offset(create_serialize),
2645 .help = "Serialize creating of job files",
2647 .category = FIO_OPT_C_FILE,
2648 .group = FIO_OPT_G_INVALID,
2651 .name = "create_fsync",
2652 .lname = "Create fsync",
2653 .type = FIO_OPT_BOOL,
2654 .off1 = td_var_offset(create_fsync),
2655 .help = "fsync file after creation",
2657 .category = FIO_OPT_C_FILE,
2658 .group = FIO_OPT_G_INVALID,
2661 .name = "create_on_open",
2662 .lname = "Create on open",
2663 .type = FIO_OPT_BOOL,
2664 .off1 = td_var_offset(create_on_open),
2665 .help = "Create files when they are opened for IO",
2667 .category = FIO_OPT_C_FILE,
2668 .group = FIO_OPT_G_INVALID,
2671 .name = "create_only",
2672 .type = FIO_OPT_BOOL,
2673 .off1 = td_var_offset(create_only),
2674 .help = "Only perform file creation phase",
2675 .category = FIO_OPT_C_FILE,
2680 .lname = "Pre-read files",
2681 .type = FIO_OPT_BOOL,
2682 .off1 = td_var_offset(pre_read),
2683 .help = "Pre-read files before starting official testing",
2685 .category = FIO_OPT_C_FILE,
2686 .group = FIO_OPT_G_INVALID,
2688 #ifdef FIO_HAVE_CPU_AFFINITY
2691 .lname = "CPU mask",
2692 .type = FIO_OPT_INT,
2693 .cb = str_cpumask_cb,
2694 .help = "CPU affinity mask",
2695 .category = FIO_OPT_C_GENERAL,
2696 .group = FIO_OPT_G_CRED,
2699 .name = "cpus_allowed",
2700 .lname = "CPUs allowed",
2701 .type = FIO_OPT_STR,
2702 .cb = str_cpus_allowed_cb,
2703 .help = "Set CPUs allowed",
2704 .category = FIO_OPT_C_GENERAL,
2705 .group = FIO_OPT_G_CRED,
2708 #ifdef CONFIG_LIBNUMA
2710 .name = "numa_cpu_nodes",
2711 .type = FIO_OPT_STR,
2712 .cb = str_numa_cpunodes_cb,
2713 .help = "NUMA CPU nodes bind",
2714 .category = FIO_OPT_C_GENERAL,
2715 .group = FIO_OPT_G_INVALID,
2718 .name = "numa_mem_policy",
2719 .type = FIO_OPT_STR,
2720 .cb = str_numa_mpol_cb,
2721 .help = "NUMA memory policy setup",
2722 .category = FIO_OPT_C_GENERAL,
2723 .group = FIO_OPT_G_INVALID,
2727 .name = "end_fsync",
2728 .lname = "End fsync",
2729 .type = FIO_OPT_BOOL,
2730 .off1 = td_var_offset(end_fsync),
2731 .help = "Include fsync at the end of job",
2733 .category = FIO_OPT_C_FILE,
2734 .group = FIO_OPT_G_INVALID,
2737 .name = "fsync_on_close",
2738 .lname = "Fsync on close",
2739 .type = FIO_OPT_BOOL,
2740 .off1 = td_var_offset(fsync_on_close),
2741 .help = "fsync files on close",
2743 .category = FIO_OPT_C_FILE,
2744 .group = FIO_OPT_G_INVALID,
2748 .lname = "Unlink file",
2749 .type = FIO_OPT_BOOL,
2750 .off1 = td_var_offset(unlink),
2751 .help = "Unlink created files after job has completed",
2753 .category = FIO_OPT_C_FILE,
2754 .group = FIO_OPT_G_INVALID,
2758 .lname = "Exit-all on terminate",
2759 .type = FIO_OPT_STR_SET,
2760 .cb = str_exitall_cb,
2761 .help = "Terminate all jobs when one exits",
2762 .category = FIO_OPT_C_GENERAL,
2763 .group = FIO_OPT_G_PROCESS,
2766 .name = "stonewall",
2767 .lname = "Wait for previous",
2768 .alias = "wait_for_previous",
2769 .type = FIO_OPT_STR_SET,
2770 .off1 = td_var_offset(stonewall),
2771 .help = "Insert a hard barrier between this job and previous",
2772 .category = FIO_OPT_C_GENERAL,
2773 .group = FIO_OPT_G_PROCESS,
2776 .name = "new_group",
2777 .lname = "New group",
2778 .type = FIO_OPT_STR_SET,
2779 .off1 = td_var_offset(new_group),
2780 .help = "Mark the start of a new group (for reporting)",
2781 .category = FIO_OPT_C_GENERAL,
2782 .group = FIO_OPT_G_PROCESS,
2787 .type = FIO_OPT_STR_SET,
2788 .off1 = td_var_offset(use_thread),
2789 .help = "Use threads instead of processes",
2790 .category = FIO_OPT_C_GENERAL,
2791 .group = FIO_OPT_G_PROCESS,
2794 .name = "write_bw_log",
2795 .lname = "Write bandwidth log",
2796 .type = FIO_OPT_STR_STORE,
2797 .off1 = td_var_offset(bw_log_file),
2798 .help = "Write log of bandwidth during run",
2799 .category = FIO_OPT_C_LOG,
2800 .group = FIO_OPT_G_INVALID,
2803 .name = "write_lat_log",
2804 .lname = "Write latency log",
2805 .type = FIO_OPT_STR_STORE,
2806 .off1 = td_var_offset(lat_log_file),
2807 .help = "Write log of latency during run",
2808 .category = FIO_OPT_C_LOG,
2809 .group = FIO_OPT_G_INVALID,
2812 .name = "write_iops_log",
2813 .lname = "Write IOPS log",
2814 .type = FIO_OPT_STR_STORE,
2815 .off1 = td_var_offset(iops_log_file),
2816 .help = "Write log of IOPS during run",
2817 .category = FIO_OPT_C_LOG,
2818 .group = FIO_OPT_G_INVALID,
2821 .name = "log_avg_msec",
2822 .lname = "Log averaging (msec)",
2823 .type = FIO_OPT_INT,
2824 .off1 = td_var_offset(log_avg_msec),
2825 .help = "Average bw/iops/lat logs over this period of time",
2827 .category = FIO_OPT_C_LOG,
2828 .group = FIO_OPT_G_INVALID,
2831 .name = "bwavgtime",
2832 .lname = "Bandwidth average time",
2833 .type = FIO_OPT_INT,
2834 .off1 = td_var_offset(bw_avg_time),
2835 .help = "Time window over which to calculate bandwidth"
2838 .parent = "write_bw_log",
2841 .category = FIO_OPT_C_LOG,
2842 .group = FIO_OPT_G_INVALID,
2845 .name = "iopsavgtime",
2846 .lname = "IOPS average time",
2847 .type = FIO_OPT_INT,
2848 .off1 = td_var_offset(iops_avg_time),
2849 .help = "Time window over which to calculate IOPS (msec)",
2851 .parent = "write_iops_log",
2854 .category = FIO_OPT_C_LOG,
2855 .group = FIO_OPT_G_INVALID,
2858 .name = "group_reporting",
2859 .lname = "Group reporting",
2860 .type = FIO_OPT_STR_SET,
2861 .off1 = td_var_offset(group_reporting),
2862 .help = "Do reporting on a per-group basis",
2863 .category = FIO_OPT_C_STAT,
2864 .group = FIO_OPT_G_INVALID,
2867 .name = "zero_buffers",
2868 .lname = "Zero I/O buffers",
2869 .type = FIO_OPT_STR_SET,
2870 .off1 = td_var_offset(zero_buffers),
2871 .help = "Init IO buffers to all zeroes",
2872 .category = FIO_OPT_C_IO,
2873 .group = FIO_OPT_G_IO_BUF,
2876 .name = "refill_buffers",
2877 .lname = "Refill I/O buffers",
2878 .type = FIO_OPT_STR_SET,
2879 .off1 = td_var_offset(refill_buffers),
2880 .help = "Refill IO buffers on every IO submit",
2881 .category = FIO_OPT_C_IO,
2882 .group = FIO_OPT_G_IO_BUF,
2885 .name = "scramble_buffers",
2886 .lname = "Scramble I/O buffers",
2887 .type = FIO_OPT_BOOL,
2888 .off1 = td_var_offset(scramble_buffers),
2889 .help = "Slightly scramble buffers on every IO submit",
2891 .category = FIO_OPT_C_IO,
2892 .group = FIO_OPT_G_IO_BUF,
2895 .name = "buffer_compress_percentage",
2896 .lname = "Buffer compression percentage",
2897 .type = FIO_OPT_INT,
2898 .off1 = td_var_offset(compress_percentage),
2901 .help = "How compressible the buffer is (approximately)",
2903 .category = FIO_OPT_C_IO,
2904 .group = FIO_OPT_G_IO_BUF,
2907 .name = "buffer_compress_chunk",
2908 .lname = "Buffer compression chunk size",
2909 .type = FIO_OPT_INT,
2910 .off1 = td_var_offset(compress_chunk),
2911 .parent = "buffer_compress_percentage",
2913 .help = "Size of compressible region in buffer",
2915 .category = FIO_OPT_C_IO,
2916 .group = FIO_OPT_G_IO_BUF,
2919 .name = "clat_percentiles",
2920 .lname = "Completion latency percentiles",
2921 .type = FIO_OPT_BOOL,
2922 .off1 = td_var_offset(clat_percentiles),
2923 .help = "Enable the reporting of completion latency percentiles",
2925 .category = FIO_OPT_C_STAT,
2926 .group = FIO_OPT_G_INVALID,
2929 .name = "percentile_list",
2930 .lname = "Completion latency percentile list",
2931 .type = FIO_OPT_FLOAT_LIST,
2932 .off1 = td_var_offset(percentile_list),
2933 .off2 = td_var_offset(percentile_precision),
2934 .help = "Specify a custom list of percentiles to report",
2935 .def = "1:5:10:20:30:40:50:60:70:80:90:95:99:99.5:99.9:99.95:99.99",
2936 .maxlen = FIO_IO_U_LIST_MAX_LEN,
2939 .category = FIO_OPT_C_STAT,
2940 .group = FIO_OPT_G_INVALID,
2943 #ifdef FIO_HAVE_DISK_UTIL
2945 .name = "disk_util",
2946 .lname = "Disk utilization",
2947 .type = FIO_OPT_BOOL,
2948 .off1 = td_var_offset(do_disk_util),
2949 .help = "Log disk utilization statistics",
2951 .category = FIO_OPT_C_STAT,
2952 .group = FIO_OPT_G_INVALID,
2956 .name = "gtod_reduce",
2957 .lname = "Reduce gettimeofday() calls",
2958 .type = FIO_OPT_BOOL,
2959 .help = "Greatly reduce number of gettimeofday() calls",
2960 .cb = str_gtod_reduce_cb,
2963 .category = FIO_OPT_C_STAT,
2964 .group = FIO_OPT_G_INVALID,
2967 .name = "disable_lat",
2968 .lname = "Disable all latency stats",
2969 .type = FIO_OPT_BOOL,
2970 .off1 = td_var_offset(disable_lat),
2971 .help = "Disable latency numbers",
2972 .parent = "gtod_reduce",
2975 .category = FIO_OPT_C_STAT,
2976 .group = FIO_OPT_G_INVALID,
2979 .name = "disable_clat",
2980 .lname = "Disable completion latency stats",
2981 .type = FIO_OPT_BOOL,
2982 .off1 = td_var_offset(disable_clat),
2983 .help = "Disable completion latency numbers",
2984 .parent = "gtod_reduce",
2987 .category = FIO_OPT_C_STAT,
2988 .group = FIO_OPT_G_INVALID,
2991 .name = "disable_slat",
2992 .lname = "Disable submission latency stats",
2993 .type = FIO_OPT_BOOL,
2994 .off1 = td_var_offset(disable_slat),
2995 .help = "Disable submission latency numbers",
2996 .parent = "gtod_reduce",
2999 .category = FIO_OPT_C_STAT,
3000 .group = FIO_OPT_G_INVALID,
3003 .name = "disable_bw_measurement",
3004 .lname = "Disable bandwidth stats",
3005 .type = FIO_OPT_BOOL,
3006 .off1 = td_var_offset(disable_bw),
3007 .help = "Disable bandwidth logging",
3008 .parent = "gtod_reduce",
3011 .category = FIO_OPT_C_STAT,
3012 .group = FIO_OPT_G_INVALID,
3016 .lname = "Dedicated gettimeofday() CPU",
3017 .type = FIO_OPT_INT,
3018 .cb = str_gtod_cpu_cb,
3019 .help = "Set up dedicated gettimeofday() thread on this CPU",
3020 .verify = gtod_cpu_verify,
3021 .category = FIO_OPT_C_GENERAL,
3022 .group = FIO_OPT_G_CLOCK,
3025 .name = "unified_rw_reporting",
3026 .type = FIO_OPT_BOOL,
3027 .off1 = td_var_offset(unified_rw_rep),
3028 .help = "Unify reporting across data direction",
3030 .category = FIO_OPT_C_GENERAL,
3031 .group = FIO_OPT_G_INVALID,
3034 .name = "continue_on_error",
3035 .lname = "Continue on error",
3036 .type = FIO_OPT_STR,
3037 .off1 = td_var_offset(continue_on_error),
3038 .help = "Continue on non-fatal errors during IO",
3040 .category = FIO_OPT_C_GENERAL,
3041 .group = FIO_OPT_G_ERR,
3044 .oval = ERROR_TYPE_NONE,
3045 .help = "Exit when an error is encountered",
3048 .oval = ERROR_TYPE_READ,
3049 .help = "Continue on read errors only",
3052 .oval = ERROR_TYPE_WRITE,
3053 .help = "Continue on write errors only",
3056 .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE,
3057 .help = "Continue on any IO errors",
3060 .oval = ERROR_TYPE_VERIFY,
3061 .help = "Continue on verify errors only",
3064 .oval = ERROR_TYPE_ANY,
3065 .help = "Continue on all io and verify errors",
3068 .oval = ERROR_TYPE_NONE,
3069 .help = "Alias for 'none'",
3072 .oval = ERROR_TYPE_ANY,
3073 .help = "Alias for 'all'",
3078 .name = "ignore_error",
3079 .type = FIO_OPT_STR,
3080 .cb = str_ignore_error_cb,
3081 .help = "Set a specific list of errors to ignore",
3083 .category = FIO_OPT_C_GENERAL,
3084 .group = FIO_OPT_G_ERR,
3087 .name = "error_dump",
3088 .type = FIO_OPT_BOOL,
3089 .off1 = td_var_offset(error_dump),
3091 .help = "Dump info on each error",
3092 .category = FIO_OPT_C_GENERAL,
3093 .group = FIO_OPT_G_ERR,
3098 .type = FIO_OPT_STR_STORE,
3099 .off1 = td_var_offset(profile),
3100 .help = "Select a specific builtin performance test",
3101 .category = FIO_OPT_C_PROFILE,
3102 .group = FIO_OPT_G_INVALID,
3107 .type = FIO_OPT_STR_STORE,
3108 .off1 = td_var_offset(cgroup),
3109 .help = "Add job to cgroup of this name",
3110 .category = FIO_OPT_C_GENERAL,
3111 .group = FIO_OPT_G_CGROUP,
3114 .name = "cgroup_nodelete",
3115 .lname = "Cgroup no-delete",
3116 .type = FIO_OPT_BOOL,
3117 .off1 = td_var_offset(cgroup_nodelete),
3118 .help = "Do not delete cgroups after job completion",
3121 .category = FIO_OPT_C_GENERAL,
3122 .group = FIO_OPT_G_CGROUP,
3125 .name = "cgroup_weight",
3126 .lname = "Cgroup weight",
3127 .type = FIO_OPT_INT,
3128 .off1 = td_var_offset(cgroup_weight),
3129 .help = "Use given weight for cgroup",
3133 .category = FIO_OPT_C_GENERAL,
3134 .group = FIO_OPT_G_CGROUP,
3139 .type = FIO_OPT_INT,
3140 .off1 = td_var_offset(uid),
3141 .help = "Run job with this user ID",
3142 .category = FIO_OPT_C_GENERAL,
3143 .group = FIO_OPT_G_CRED,
3147 .lname = "Group ID",
3148 .type = FIO_OPT_INT,
3149 .off1 = td_var_offset(gid),
3150 .help = "Run job with this group ID",
3151 .category = FIO_OPT_C_GENERAL,
3152 .group = FIO_OPT_G_CRED,
3157 .type = FIO_OPT_INT,
3158 .off1 = td_var_offset(kb_base),
3164 .help = "Use 1024 as the K base",
3168 .help = "Use 1000 as the K base",
3171 .help = "How many bytes per KB for reporting (1000 or 1024)",
3172 .category = FIO_OPT_C_GENERAL,
3173 .group = FIO_OPT_G_INVALID,
3176 .name = "unit_base",
3177 .lname = "Base unit for reporting (Bits or Bytes)",
3178 .type = FIO_OPT_INT,
3179 .off1 = td_var_offset(unit_base),
3184 .help = "Auto-detect",
3188 .help = "Normal (byte based)",
3192 .help = "Bit based",
3195 .help = "Bit multiple of result summary data (8 for byte, 1 for bit)",
3196 .category = FIO_OPT_C_GENERAL,
3197 .group = FIO_OPT_G_INVALID,
3200 .name = "hugepage-size",
3201 .lname = "Hugepage size",
3202 .type = FIO_OPT_INT,
3203 .off1 = td_var_offset(hugepage_size),
3204 .help = "When using hugepages, specify size of each page",
3205 .def = __fio_stringify(FIO_HUGE_PAGE),
3206 .interval = 1024 * 1024,
3207 .category = FIO_OPT_C_GENERAL,
3208 .group = FIO_OPT_G_INVALID,
3212 .lname = "I/O flow ID",
3213 .type = FIO_OPT_INT,
3214 .off1 = td_var_offset(flow_id),
3215 .help = "The flow index ID to use",
3217 .category = FIO_OPT_C_IO,
3218 .group = FIO_OPT_G_IO_FLOW,
3222 .lname = "I/O flow weight",
3223 .type = FIO_OPT_INT,
3224 .off1 = td_var_offset(flow),
3225 .help = "Weight for flow control of this job",
3226 .parent = "flow_id",
3229 .category = FIO_OPT_C_IO,
3230 .group = FIO_OPT_G_IO_FLOW,
3233 .name = "flow_watermark",
3234 .lname = "I/O flow watermark",
3235 .type = FIO_OPT_INT,
3236 .off1 = td_var_offset(flow_watermark),
3237 .help = "High watermark for flow control. This option"
3238 " should be set to the same value for all threads"
3239 " with non-zero flow.",
3240 .parent = "flow_id",
3243 .category = FIO_OPT_C_IO,
3244 .group = FIO_OPT_G_IO_FLOW,
3247 .name = "flow_sleep",
3248 .lname = "I/O flow sleep",
3249 .type = FIO_OPT_INT,
3250 .off1 = td_var_offset(flow_sleep),
3251 .help = "How many microseconds to sleep after being held"
3252 " back by the flow control mechanism",
3253 .parent = "flow_id",
3256 .category = FIO_OPT_C_IO,
3257 .group = FIO_OPT_G_IO_FLOW,
3264 static void add_to_lopt(struct option *lopt, struct fio_option *o,
3265 const char *name, int val)
3267 lopt->name = (char *) name;
3269 if (o->type == FIO_OPT_STR_SET)
3270 lopt->has_arg = no_argument;
3272 lopt->has_arg = required_argument;
3275 static void options_to_lopts(struct fio_option *opts,
3276 struct option *long_options,
3277 int i, int option_type)
3279 struct fio_option *o = &opts[0];
3281 add_to_lopt(&long_options[i], o, o->name, option_type);
3284 add_to_lopt(&long_options[i], o, o->alias, option_type);
3289 assert(i < FIO_NR_OPTIONS);
3293 void fio_options_set_ioengine_opts(struct option *long_options,
3294 struct thread_data *td)
3299 while (long_options[i].name) {
3300 if (long_options[i].val == FIO_GETOPT_IOENGINE) {
3301 memset(&long_options[i], 0, sizeof(*long_options));
3308 * Just clear out the prior ioengine options.
3313 options_to_lopts(td->io_ops->options, long_options, i,
3314 FIO_GETOPT_IOENGINE);
3317 void fio_options_dup_and_init(struct option *long_options)
3321 options_init(fio_options);
3324 while (long_options[i].name)
3327 options_to_lopts(fio_options, long_options, i, FIO_GETOPT_JOB);
3330 struct fio_keyword {
3336 static struct fio_keyword fio_keywords[] = {
3338 .word = "$pagesize",
3339 .desc = "Page size in the system",
3342 .word = "$mb_memory",
3343 .desc = "Megabytes of memory online",
3347 .desc = "Number of CPUs online in the system",