11 #include <netinet/in.h>
17 #include "lib/pattern.h"
21 char client_sockaddr_str[INET6_ADDRSTRLEN] = { 0 };
23 struct pattern_fmt_desc fmt_desc[] = {
26 .len = FIELD_SIZE(struct io_u *, offset),
27 .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 int bs_cmp(const void *p1, const void *p2)
49 const struct bssplit *bsp1 = p1;
50 const struct bssplit *bsp2 = p2;
52 return (int) bsp1->perc - (int) bsp2->perc;
57 unsigned int val1[100];
58 unsigned int val2[100];
61 static int split_parse_ddir(struct thread_options *o, struct split *split,
62 enum fio_ddir ddir, char *str)
71 while ((fname = strsep(&str, ":")) != NULL) {
77 perc_str = strstr(fname, "/");
81 perc = atoi(perc_str);
89 if (str_to_decimal(fname, &val, 1, o, 0, 0)) {
90 log_err("fio: bssplit conversion failed\n");
95 split->val2[i] = perc;
105 static int bssplit_ddir(struct thread_options *o, enum fio_ddir ddir, char *str)
107 unsigned int i, perc, perc_missing;
108 unsigned int max_bs, min_bs;
111 memset(&split, 0, sizeof(split));
113 if (split_parse_ddir(o, &split, ddir, str))
120 o->bssplit[ddir] = malloc(split.nr * sizeof(struct bssplit));
121 o->bssplit_nr[ddir] = split.nr;
122 for (i = 0; i < split.nr; i++) {
123 if (split.val1[i] > max_bs)
124 max_bs = split.val1[i];
125 if (split.val1[i] < min_bs)
126 min_bs = split.val1[i];
128 o->bssplit[ddir][i].bs = split.val1[i];
129 o->bssplit[ddir][i].perc =split.val2[i];
133 * Now check if the percentages add up, and how much is missing
135 perc = perc_missing = 0;
136 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
137 struct bssplit *bsp = &o->bssplit[ddir][i];
139 if (bsp->perc == -1U)
145 if (perc > 100 && perc_missing > 1) {
146 log_err("fio: bssplit percentages add to more than 100%%\n");
147 free(o->bssplit[ddir]);
148 o->bssplit[ddir] = NULL;
153 * If values didn't have a percentage set, divide the remains between
157 if (perc_missing == 1 && o->bssplit_nr[ddir] == 1)
159 for (i = 0; i < o->bssplit_nr[ddir]; i++) {
160 struct bssplit *bsp = &o->bssplit[ddir][i];
162 if (bsp->perc == -1U)
163 bsp->perc = (100 - perc) / perc_missing;
167 o->min_bs[ddir] = min_bs;
168 o->max_bs[ddir] = max_bs;
171 * now sort based on percentages, for ease of lookup
173 qsort(o->bssplit[ddir], o->bssplit_nr[ddir], sizeof(struct bssplit), bs_cmp);
177 typedef int (split_parse_fn)(struct thread_options *, enum fio_ddir, char *);
179 static int str_split_parse(struct thread_data *td, char *str, split_parse_fn *fn)
184 odir = strchr(str, ',');
186 ddir = strchr(odir + 1, ',');
188 ret = fn(&td->o, DDIR_TRIM, ddir + 1);
194 op = strdup(odir + 1);
195 ret = fn(&td->o, DDIR_TRIM, op);
200 ret = fn(&td->o, DDIR_WRITE, odir + 1);
203 ret = fn(&td->o, DDIR_READ, str);
209 ret = fn(&td->o, DDIR_WRITE, op);
214 ret = fn(&td->o, DDIR_TRIM, op);
218 ret = fn(&td->o, DDIR_READ, str);
224 static int str_bssplit_cb(void *data, const char *input)
226 struct thread_data *td = data;
230 p = str = strdup(input);
232 strip_blank_front(&str);
233 strip_blank_end(str);
235 ret = str_split_parse(td, str, bssplit_ddir);
237 if (parse_dryrun()) {
240 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
241 free(td->o.bssplit[i]);
242 td->o.bssplit[i] = NULL;
243 td->o.bssplit_nr[i] = 0;
251 static int str2error(char *str)
253 const char *err[] = { "EPERM", "ENOENT", "ESRCH", "EINTR", "EIO",
254 "ENXIO", "E2BIG", "ENOEXEC", "EBADF",
255 "ECHILD", "EAGAIN", "ENOMEM", "EACCES",
256 "EFAULT", "ENOTBLK", "EBUSY", "EEXIST",
257 "EXDEV", "ENODEV", "ENOTDIR", "EISDIR",
258 "EINVAL", "ENFILE", "EMFILE", "ENOTTY",
259 "ETXTBSY","EFBIG", "ENOSPC", "ESPIPE",
260 "EROFS","EMLINK", "EPIPE", "EDOM", "ERANGE" };
261 int i = 0, num = sizeof(err) / sizeof(void *);
264 if (!strcmp(err[i], str))
271 static int ignore_error_type(struct thread_data *td, int etype, char *str)
277 if (etype >= ERROR_TYPE_CNT) {
278 log_err("Illegal error type\n");
282 td->o.ignore_error_nr[etype] = 4;
283 error = malloc(4 * sizeof(struct bssplit));
286 while ((fname = strsep(&str, ":")) != NULL) {
292 * grow struct buffer, if needed
294 if (i == td->o.ignore_error_nr[etype]) {
295 td->o.ignore_error_nr[etype] <<= 1;
296 error = realloc(error, td->o.ignore_error_nr[etype]
299 if (fname[0] == 'E') {
300 error[i] = str2error(fname);
302 error[i] = atoi(fname);
304 error[i] = -error[i];
307 log_err("Unknown error %s, please use number value \n",
315 td->o.continue_on_error |= 1 << etype;
316 td->o.ignore_error_nr[etype] = i;
317 td->o.ignore_error[etype] = error;
325 static int str_ignore_error_cb(void *data, const char *input)
327 struct thread_data *td = data;
329 int type = 0, ret = 1;
334 p = str = strdup(input);
336 strip_blank_front(&str);
337 strip_blank_end(str);
343 ret = ignore_error_type(td, type, p);
353 static int str_rw_cb(void *data, const char *str)
355 struct thread_data *td = data;
356 struct thread_options *o = &td->o;
365 nr = get_opt_postfix(str);
370 o->ddir_seq_nr = atoi(nr);
374 if (str_to_decimal(nr, &val, 1, o, 0, 0)) {
375 log_err("fio: rw postfix parsing failed\n");
380 o->ddir_seq_add = val;
387 static int str_mem_cb(void *data, const char *mem)
389 struct thread_data *td = data;
391 if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP ||
392 td->o.mem_type == MEM_MMAPSHARED)
393 td->o.mmapfile = get_opt_postfix(mem);
398 static int fio_clock_source_cb(void *data, const char *str)
400 struct thread_data *td = data;
402 fio_clock_source = td->o.clocksource;
403 fio_clock_source_set = 1;
408 static int str_rwmix_read_cb(void *data, unsigned long long *val)
410 struct thread_data *td = data;
412 td->o.rwmix[DDIR_READ] = *val;
413 td->o.rwmix[DDIR_WRITE] = 100 - *val;
417 static int str_rwmix_write_cb(void *data, unsigned long long *val)
419 struct thread_data *td = data;
421 td->o.rwmix[DDIR_WRITE] = *val;
422 td->o.rwmix[DDIR_READ] = 100 - *val;
426 static int str_exitall_cb(void)
428 exitall_on_terminate = 1;
432 #ifdef FIO_HAVE_CPU_AFFINITY
433 int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index)
435 unsigned int i, index, cpus_in_mask;
436 const long max_cpu = cpus_online();
438 cpus_in_mask = fio_cpu_count(mask);
439 cpu_index = cpu_index % cpus_in_mask;
442 for (i = 0; i < max_cpu; i++) {
443 if (!fio_cpu_isset(mask, i))
446 if (cpu_index != index)
447 fio_cpu_clear(mask, i);
452 return fio_cpu_count(mask);
455 static int str_cpumask_cb(void *data, unsigned long long *val)
457 struct thread_data *td = data;
465 ret = fio_cpuset_init(&td->o.cpumask);
467 log_err("fio: cpuset_init failed\n");
468 td_verror(td, ret, "fio_cpuset_init");
472 max_cpu = cpus_online();
474 for (i = 0; i < sizeof(int) * 8; i++) {
475 if ((1 << i) & *val) {
477 log_err("fio: CPU %d too large (max=%ld)\n", i,
481 dprint(FD_PARSE, "set cpu allowed %d\n", i);
482 fio_cpu_set(&td->o.cpumask, i);
489 static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask,
496 ret = fio_cpuset_init(mask);
498 log_err("fio: cpuset_init failed\n");
499 td_verror(td, ret, "fio_cpuset_init");
503 p = str = strdup(input);
505 strip_blank_front(&str);
506 strip_blank_end(str);
508 max_cpu = cpus_online();
510 while ((cpu = strsep(&str, ",")) != NULL) {
519 while ((cpu2 = strsep(&str2, "-")) != NULL) {
529 while (icpu <= icpu2) {
530 if (icpu >= FIO_MAX_CPUS) {
531 log_err("fio: your OS only supports up to"
532 " %d CPUs\n", (int) FIO_MAX_CPUS);
536 if (icpu >= max_cpu) {
537 log_err("fio: CPU %d too large (max=%ld)\n",
543 dprint(FD_PARSE, "set cpu allowed %d\n", icpu);
544 fio_cpu_set(mask, icpu);
555 static int str_cpus_allowed_cb(void *data, const char *input)
557 struct thread_data *td = data;
562 return set_cpus_allowed(td, &td->o.cpumask, input);
565 static int str_verify_cpus_allowed_cb(void *data, const char *input)
567 struct thread_data *td = data;
572 return set_cpus_allowed(td, &td->o.verify_cpumask, input);
576 static int str_log_cpus_allowed_cb(void *data, const char *input)
578 struct thread_data *td = data;
583 return set_cpus_allowed(td, &td->o.log_gz_cpumask, input);
585 #endif /* CONFIG_ZLIB */
587 #endif /* FIO_HAVE_CPU_AFFINITY */
589 #ifdef CONFIG_LIBNUMA
590 static int str_numa_cpunodes_cb(void *data, char *input)
592 struct thread_data *td = data;
593 struct bitmask *verify_bitmask;
598 /* numa_parse_nodestring() parses a character string list
599 * of nodes into a bit mask. The bit mask is allocated by
600 * numa_allocate_nodemask(), so it should be freed by
601 * numa_free_nodemask().
603 verify_bitmask = numa_parse_nodestring(input);
604 if (verify_bitmask == NULL) {
605 log_err("fio: numa_parse_nodestring failed\n");
606 td_verror(td, 1, "str_numa_cpunodes_cb");
609 numa_free_nodemask(verify_bitmask);
611 td->o.numa_cpunodes = strdup(input);
615 static int str_numa_mpol_cb(void *data, char *input)
617 struct thread_data *td = data;
618 const char * const policy_types[] =
619 { "default", "prefer", "bind", "interleave", "local", NULL };
622 struct bitmask *verify_bitmask;
627 nodelist = strchr(input, ':');
629 /* NUL-terminate mode */
633 for (i = 0; i <= MPOL_LOCAL; i++) {
634 if (!strcmp(input, policy_types[i])) {
635 td->o.numa_mem_mode = i;
639 if (i > MPOL_LOCAL) {
640 log_err("fio: memory policy should be: default, prefer, bind, interleave, local\n");
644 switch (td->o.numa_mem_mode) {
647 * Insist on a nodelist of one node only
650 char *rest = nodelist;
651 while (isdigit(*rest))
654 log_err("fio: one node only for \'prefer\'\n");
658 log_err("fio: one node is needed for \'prefer\'\n");
662 case MPOL_INTERLEAVE:
664 * Default to online nodes with memory if no nodelist
667 nodelist = strdup("all");
672 * Don't allow a nodelist
675 log_err("fio: NO nodelist for \'local\'\n");
681 * Insist on a nodelist
684 log_err("fio: a nodelist is needed for \'bind\'\n");
691 /* numa_parse_nodestring() parses a character string list
692 * of nodes into a bit mask. The bit mask is allocated by
693 * numa_allocate_nodemask(), so it should be freed by
694 * numa_free_nodemask().
696 switch (td->o.numa_mem_mode) {
698 td->o.numa_mem_prefer_node = atoi(nodelist);
700 case MPOL_INTERLEAVE:
702 verify_bitmask = numa_parse_nodestring(nodelist);
703 if (verify_bitmask == NULL) {
704 log_err("fio: numa_parse_nodestring failed\n");
705 td_verror(td, 1, "str_numa_memnodes_cb");
708 td->o.numa_memnodes = strdup(nodelist);
709 numa_free_nodemask(verify_bitmask);
724 static int str_fst_cb(void *data, const char *str)
726 struct thread_data *td = data;
727 char *nr = get_opt_postfix(str);
729 td->file_service_nr = 1;
731 td->file_service_nr = atoi(nr);
738 #ifdef CONFIG_SYNC_FILE_RANGE
739 static int str_sfr_cb(void *data, const char *str)
741 struct thread_data *td = data;
742 char *nr = get_opt_postfix(str);
744 td->sync_file_range_nr = 1;
746 td->sync_file_range_nr = atoi(nr);
754 static int zone_cmp(const void *p1, const void *p2)
756 const struct zone_split *zsp1 = p1;
757 const struct zone_split *zsp2 = p2;
759 return (int) zsp2->access_perc - (int) zsp1->access_perc;
762 static int zone_split_ddir(struct thread_options *o, enum fio_ddir ddir,
765 unsigned int i, perc, perc_missing, sperc, sperc_missing;
768 memset(&split, 0, sizeof(split));
770 if (split_parse_ddir(o, &split, ddir, str))
775 o->zone_split[ddir] = malloc(split.nr * sizeof(struct zone_split));
776 o->zone_split_nr[ddir] = split.nr;
777 for (i = 0; i < split.nr; i++) {
778 o->zone_split[ddir][i].access_perc = split.val1[i];
779 o->zone_split[ddir][i].size_perc = split.val2[i];
783 * Now check if the percentages add up, and how much is missing
785 perc = perc_missing = 0;
786 sperc = sperc_missing = 0;
787 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
788 struct zone_split *zsp = &o->zone_split[ddir][i];
790 if (zsp->access_perc == (uint8_t) -1U)
793 perc += zsp->access_perc;
795 if (zsp->size_perc == (uint8_t) -1U)
798 sperc += zsp->size_perc;
802 if (perc > 100 || sperc > 100) {
803 log_err("fio: zone_split percentages add to more than 100%%\n");
804 free(o->zone_split[ddir]);
805 o->zone_split[ddir] = NULL;
809 log_err("fio: access percentage don't add up to 100 for zoned "
810 "random distribution (got=%u)\n", perc);
811 free(o->zone_split[ddir]);
812 o->zone_split[ddir] = NULL;
817 * If values didn't have a percentage set, divide the remains between
821 if (perc_missing == 1 && o->zone_split_nr[ddir] == 1)
823 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
824 struct zone_split *zsp = &o->zone_split[ddir][i];
826 if (zsp->access_perc == (uint8_t) -1U)
827 zsp->access_perc = (100 - perc) / perc_missing;
831 if (sperc_missing == 1 && o->zone_split_nr[ddir] == 1)
833 for (i = 0; i < o->zone_split_nr[ddir]; i++) {
834 struct zone_split *zsp = &o->zone_split[ddir][i];
836 if (zsp->size_perc == (uint8_t) -1U)
837 zsp->size_perc = (100 - sperc) / sperc_missing;
842 * now sort based on percentages, for ease of lookup
844 qsort(o->zone_split[ddir], o->zone_split_nr[ddir], sizeof(struct zone_split), zone_cmp);
848 static void __td_zone_gen_index(struct thread_data *td, enum fio_ddir ddir)
850 unsigned int i, j, sprev, aprev;
852 td->zone_state_index[ddir] = malloc(sizeof(struct zone_split_index) * 100);
855 for (i = 0; i < td->o.zone_split_nr[ddir]; i++) {
856 struct zone_split *zsp = &td->o.zone_split[ddir][i];
858 for (j = aprev; j < aprev + zsp->access_perc; j++) {
859 struct zone_split_index *zsi = &td->zone_state_index[ddir][j];
861 zsi->size_perc = sprev + zsp->size_perc;
862 zsi->size_perc_prev = sprev;
865 aprev += zsp->access_perc;
866 sprev += zsp->size_perc;
871 * Generate state table for indexes, so we don't have to do it inline from
874 static void td_zone_gen_index(struct thread_data *td)
878 td->zone_state_index = malloc(DDIR_RWDIR_CNT *
879 sizeof(struct zone_split_index *));
881 for (i = 0; i < DDIR_RWDIR_CNT; i++)
882 __td_zone_gen_index(td, i);
885 static int parse_zoned_distribution(struct thread_data *td, const char *input)
890 p = str = strdup(input);
892 strip_blank_front(&str);
893 strip_blank_end(str);
895 /* We expect it to start like that, bail if not */
896 if (strncmp(str, "zoned:", 6)) {
897 log_err("fio: mismatch in zoned input <%s>\n", str);
901 str += strlen("zoned:");
903 ret = str_split_parse(td, str, zone_split_ddir);
907 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
910 dprint(FD_PARSE, "zone ddir %d (nr=%u): \n", i, td->o.zone_split_nr[i]);
912 for (j = 0; j < td->o.zone_split_nr[i]; j++) {
913 struct zone_split *zsp = &td->o.zone_split[i][j];
915 dprint(FD_PARSE, "\t%d: %u/%u\n", j, zsp->access_perc,
920 if (parse_dryrun()) {
923 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
924 free(td->o.zone_split[i]);
925 td->o.zone_split[i] = NULL;
926 td->o.zone_split_nr[i] = 0;
933 td_zone_gen_index(td);
935 for (i = 0; i < DDIR_RWDIR_CNT; i++)
936 td->o.zone_split_nr[i] = 0;
942 static int str_random_distribution_cb(void *data, const char *str)
944 struct thread_data *td = data;
948 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
950 else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
951 val = FIO_DEF_PARETO;
952 else if (td->o.random_distribution == FIO_RAND_DIST_GAUSS)
954 else if (td->o.random_distribution == FIO_RAND_DIST_ZONED)
955 return parse_zoned_distribution(td, str);
959 nr = get_opt_postfix(str);
960 if (nr && !str_to_float(nr, &val, 0)) {
961 log_err("fio: random postfix parsing failed\n");
968 if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) {
970 log_err("fio: zipf theta must different than 1.0\n");
975 td->o.zipf_theta.u.f = val;
976 } else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) {
977 if (val <= 0.00 || val >= 1.00) {
978 log_err("fio: pareto input out of range (0 < input < 1.0)\n");
983 td->o.pareto_h.u.f = val;
985 if (val <= 0.00 || val >= 100.0) {
986 log_err("fio: normal deviation out of range (0 < input < 100.0)\n");
991 td->o.gauss_dev.u.f = val;
998 * Return next name in the string. Files are separated with ':'. If the ':'
999 * is escaped with a '\', then that ':' is part of the filename and does not
1000 * indicate a new file.
1002 static char *get_next_name(char **ptr)
1007 if (!str || !strlen(str))
1013 * No colon, we are done
1015 p = strchr(str, ':');
1022 * We got a colon, but it's the first character. Skip and
1030 if (*(p - 1) != '\\') {
1036 memmove(p - 1, p, strlen(p) + 1);
1044 static int get_max_name_idx(char *input)
1046 unsigned int cur_idx;
1049 p = str = strdup(input);
1050 for (cur_idx = 0; ; cur_idx++)
1051 if (get_next_name(&str) == NULL)
1059 * Returns the directory at the index, indexes > entires will be
1060 * assigned via modulo division of the index
1062 int set_name_idx(char *target, size_t tlen, char *input, int index)
1064 unsigned int cur_idx;
1066 char *fname, *str, *p;
1068 p = str = strdup(input);
1070 index %= get_max_name_idx(input);
1071 for (cur_idx = 0; cur_idx <= index; cur_idx++)
1072 fname = get_next_name(&str);
1074 if (client_sockaddr_str[0]) {
1075 len = snprintf(target, tlen, "%s/%s.", fname,
1076 client_sockaddr_str);
1078 len = snprintf(target, tlen, "%s/", fname);
1080 target[tlen - 1] = '\0';
1086 static int str_filename_cb(void *data, const char *input)
1088 struct thread_data *td = data;
1089 char *fname, *str, *p;
1091 p = str = strdup(input);
1093 strip_blank_front(&str);
1094 strip_blank_end(str);
1096 if (!td->files_index)
1099 while ((fname = get_next_name(&str)) != NULL) {
1102 add_file(td, fname, 0, 1);
1109 static int str_directory_cb(void *data, const char fio_unused *unused)
1111 struct thread_data *td = data;
1113 char *dirname, *str, *p;
1119 p = str = strdup(td->o.directory);
1120 while ((dirname = get_next_name(&str)) != NULL) {
1121 if (lstat(dirname, &sb) < 0) {
1124 log_err("fio: %s is not a directory\n", dirname);
1125 td_verror(td, ret, "lstat");
1128 if (!S_ISDIR(sb.st_mode)) {
1129 log_err("fio: %s is not a directory\n", dirname);
1140 static int str_opendir_cb(void *data, const char fio_unused *str)
1142 struct thread_data *td = data;
1147 if (!td->files_index)
1150 return add_dir_files(td, td->o.opendir);
1153 static int str_buffer_pattern_cb(void *data, const char *input)
1155 struct thread_data *td = data;
1158 /* FIXME: for now buffer pattern does not support formats */
1159 ret = parse_and_fill_pattern(input, strlen(input), td->o.buffer_pattern,
1160 MAX_PATTERN_SIZE, NULL, 0, NULL, NULL);
1165 td->o.buffer_pattern_bytes = ret;
1166 if (!td->o.compress_percentage)
1167 td->o.refill_buffers = 0;
1168 td->o.scramble_buffers = 0;
1169 td->o.zero_buffers = 0;
1174 static int str_buffer_compress_cb(void *data, unsigned long long *il)
1176 struct thread_data *td = data;
1178 td->flags |= TD_F_COMPRESS;
1179 td->o.compress_percentage = *il;
1183 static int str_dedupe_cb(void *data, unsigned long long *il)
1185 struct thread_data *td = data;
1187 td->flags |= TD_F_COMPRESS;
1188 td->o.dedupe_percentage = *il;
1189 td->o.refill_buffers = 1;
1193 static int str_verify_pattern_cb(void *data, const char *input)
1195 struct thread_data *td = data;
1198 td->o.verify_fmt_sz = ARRAY_SIZE(td->o.verify_fmt);
1199 ret = parse_and_fill_pattern(input, strlen(input), td->o.verify_pattern,
1200 MAX_PATTERN_SIZE, fmt_desc, sizeof(fmt_desc),
1201 td->o.verify_fmt, &td->o.verify_fmt_sz);
1206 td->o.verify_pattern_bytes = ret;
1208 * VERIFY_* could already be set
1210 if (!fio_option_is_set(&td->o, verify))
1211 td->o.verify = VERIFY_PATTERN;
1216 static int str_gtod_reduce_cb(void *data, int *il)
1218 struct thread_data *td = data;
1221 td->o.disable_lat = !!val;
1222 td->o.disable_clat = !!val;
1223 td->o.disable_slat = !!val;
1224 td->o.disable_bw = !!val;
1225 td->o.clat_percentiles = !val;
1227 td->tv_cache_mask = 63;
1232 static int str_size_cb(void *data, unsigned long long *__val)
1234 struct thread_data *td = data;
1235 unsigned long long v = *__val;
1237 if (parse_is_percent(v)) {
1239 td->o.size_percent = -1ULL - v;
1246 static int rw_verify(struct fio_option *o, void *data)
1248 struct thread_data *td = data;
1250 if (read_only && td_write(td)) {
1251 log_err("fio: job <%s> has write bit set, but fio is in"
1252 " read-only mode\n", td->o.name);
1259 static int gtod_cpu_verify(struct fio_option *o, void *data)
1261 #ifndef FIO_HAVE_CPU_AFFINITY
1262 struct thread_data *td = data;
1264 if (td->o.gtod_cpu) {
1265 log_err("fio: platform must support CPU affinity for"
1266 "gettimeofday() offloading\n");
1275 * Map of job/command line options
1277 struct fio_option fio_options[FIO_MAX_OPTS] = {
1279 .name = "description",
1280 .lname = "Description of job",
1281 .type = FIO_OPT_STR_STORE,
1282 .off1 = td_var_offset(description),
1283 .help = "Text job description",
1284 .category = FIO_OPT_C_GENERAL,
1285 .group = FIO_OPT_G_DESC,
1289 .lname = "Job name",
1290 .type = FIO_OPT_STR_STORE,
1291 .off1 = td_var_offset(name),
1292 .help = "Name of this job",
1293 .category = FIO_OPT_C_GENERAL,
1294 .group = FIO_OPT_G_DESC,
1298 .lname = "Waitee name",
1299 .type = FIO_OPT_STR_STORE,
1300 .off1 = td_var_offset(wait_for),
1301 .help = "Name of the job this one wants to wait for before starting",
1302 .category = FIO_OPT_C_GENERAL,
1303 .group = FIO_OPT_G_DESC,
1307 .lname = "Filename(s)",
1308 .type = FIO_OPT_STR_STORE,
1309 .off1 = td_var_offset(filename),
1310 .cb = str_filename_cb,
1311 .prio = -1, /* must come after "directory" */
1312 .help = "File(s) to use for the workload",
1313 .category = FIO_OPT_C_FILE,
1314 .group = FIO_OPT_G_FILENAME,
1317 .name = "directory",
1318 .lname = "Directory",
1319 .type = FIO_OPT_STR_STORE,
1320 .off1 = td_var_offset(directory),
1321 .cb = str_directory_cb,
1322 .help = "Directory to store files in",
1323 .category = FIO_OPT_C_FILE,
1324 .group = FIO_OPT_G_FILENAME,
1327 .name = "filename_format",
1328 .type = FIO_OPT_STR_STORE,
1329 .off1 = td_var_offset(filename_format),
1330 .prio = -1, /* must come after "directory" */
1331 .help = "Override default $jobname.$jobnum.$filenum naming",
1332 .def = "$jobname.$jobnum.$filenum",
1333 .category = FIO_OPT_C_FILE,
1334 .group = FIO_OPT_G_FILENAME,
1338 .lname = "Lockfile",
1339 .type = FIO_OPT_STR,
1340 .off1 = td_var_offset(file_lock_mode),
1341 .help = "Lock file when doing IO to it",
1343 .parent = "filename",
1346 .category = FIO_OPT_C_FILE,
1347 .group = FIO_OPT_G_FILENAME,
1350 .oval = FILE_LOCK_NONE,
1351 .help = "No file locking",
1353 { .ival = "exclusive",
1354 .oval = FILE_LOCK_EXCLUSIVE,
1355 .help = "Exclusive file lock",
1358 .ival = "readwrite",
1359 .oval = FILE_LOCK_READWRITE,
1360 .help = "Read vs write lock",
1366 .lname = "Open directory",
1367 .type = FIO_OPT_STR_STORE,
1368 .off1 = td_var_offset(opendir),
1369 .cb = str_opendir_cb,
1370 .help = "Recursively add files from this directory and down",
1371 .category = FIO_OPT_C_FILE,
1372 .group = FIO_OPT_G_FILENAME,
1376 .lname = "Read/write",
1377 .alias = "readwrite",
1378 .type = FIO_OPT_STR,
1380 .off1 = td_var_offset(td_ddir),
1381 .help = "IO direction",
1383 .verify = rw_verify,
1384 .category = FIO_OPT_C_IO,
1385 .group = FIO_OPT_G_IO_BASIC,
1388 .oval = TD_DDIR_READ,
1389 .help = "Sequential read",
1392 .oval = TD_DDIR_WRITE,
1393 .help = "Sequential write",
1396 .oval = TD_DDIR_TRIM,
1397 .help = "Sequential trim",
1399 { .ival = "randread",
1400 .oval = TD_DDIR_RANDREAD,
1401 .help = "Random read",
1403 { .ival = "randwrite",
1404 .oval = TD_DDIR_RANDWRITE,
1405 .help = "Random write",
1407 { .ival = "randtrim",
1408 .oval = TD_DDIR_RANDTRIM,
1409 .help = "Random trim",
1413 .help = "Sequential read and write mix",
1415 { .ival = "readwrite",
1417 .help = "Sequential read and write mix",
1420 .oval = TD_DDIR_RANDRW,
1421 .help = "Random read and write mix"
1423 { .ival = "trimwrite",
1424 .oval = TD_DDIR_TRIMWRITE,
1425 .help = "Trim and write mix, trims preceding writes"
1430 .name = "rw_sequencer",
1431 .lname = "RW Sequencer",
1432 .type = FIO_OPT_STR,
1433 .off1 = td_var_offset(rw_seq),
1434 .help = "IO offset generator modifier",
1435 .def = "sequential",
1436 .category = FIO_OPT_C_IO,
1437 .group = FIO_OPT_G_IO_BASIC,
1439 { .ival = "sequential",
1441 .help = "Generate sequential offsets",
1443 { .ival = "identical",
1444 .oval = RW_SEQ_IDENT,
1445 .help = "Generate identical offsets",
1452 .lname = "IO Engine",
1453 .type = FIO_OPT_STR_STORE,
1454 .off1 = td_var_offset(ioengine),
1455 .help = "IO engine to use",
1456 .def = FIO_PREFERRED_ENGINE,
1457 .category = FIO_OPT_C_IO,
1458 .group = FIO_OPT_G_IO_BASIC,
1461 .help = "Use read/write",
1464 .help = "Use pread/pwrite",
1467 .help = "Use readv/writev",
1469 #ifdef CONFIG_PWRITEV
1471 .help = "Use preadv/pwritev",
1474 #ifdef CONFIG_PWRITEV2
1475 { .ival = "pvsync2",
1476 .help = "Use preadv2/pwritev2",
1479 #ifdef CONFIG_LIBAIO
1481 .help = "Linux native asynchronous IO",
1484 #ifdef CONFIG_POSIXAIO
1485 { .ival = "posixaio",
1486 .help = "POSIX asynchronous IO",
1489 #ifdef CONFIG_SOLARISAIO
1490 { .ival = "solarisaio",
1491 .help = "Solaris native asynchronous IO",
1494 #ifdef CONFIG_WINDOWSAIO
1495 { .ival = "windowsaio",
1496 .help = "Windows native asynchronous IO"
1501 .help = "Rados Block Device asynchronous IO"
1505 .help = "Memory mapped IO"
1507 #ifdef CONFIG_LINUX_SPLICE
1509 .help = "splice/vmsplice based IO",
1511 { .ival = "netsplice",
1512 .help = "splice/vmsplice to/from the network",
1515 #ifdef FIO_HAVE_SGIO
1517 .help = "SCSI generic v3 IO",
1521 .help = "Testing engine (no data transfer)",
1524 .help = "Network IO",
1527 .help = "CPU cycle burner engine",
1531 .help = "GUASI IO engine",
1534 #ifdef FIO_HAVE_BINJECT
1535 { .ival = "binject",
1536 .help = "binject direct inject block engine",
1541 .help = "RDMA IO engine",
1544 #ifdef CONFIG_FUSION_AW
1545 { .ival = "fusion-aw-sync",
1546 .help = "Fusion-io atomic write engine",
1549 #ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
1550 { .ival = "e4defrag",
1551 .help = "ext4 defrag engine",
1554 #ifdef CONFIG_LINUX_FALLOCATE
1556 .help = "fallocate() file based engine",
1561 .help = "Glusterfs libgfapi(sync) based engine"
1563 { .ival = "gfapi_async",
1564 .help = "Glusterfs libgfapi(async) based engine"
1567 #ifdef CONFIG_LIBHDFS
1568 { .ival = "libhdfs",
1569 .help = "Hadoop Distributed Filesystem (HDFS) engine"
1572 #ifdef CONFIG_PMEMBLK
1573 { .ival = "pmemblk",
1574 .help = "NVML libpmemblk based IO engine",
1578 { .ival = "external",
1579 .help = "Load external engine (append name)",
1585 .lname = "IO Depth",
1586 .type = FIO_OPT_INT,
1587 .off1 = td_var_offset(iodepth),
1588 .help = "Number of IO buffers to keep in flight",
1592 .category = FIO_OPT_C_IO,
1593 .group = FIO_OPT_G_IO_BASIC,
1596 .name = "iodepth_batch",
1597 .lname = "IO Depth batch",
1598 .alias = "iodepth_batch_submit",
1599 .type = FIO_OPT_INT,
1600 .off1 = td_var_offset(iodepth_batch),
1601 .help = "Number of IO buffers to submit in one go",
1602 .parent = "iodepth",
1607 .category = FIO_OPT_C_IO,
1608 .group = FIO_OPT_G_IO_BASIC,
1611 .name = "iodepth_batch_complete_min",
1612 .lname = "Min IO depth batch complete",
1613 .alias = "iodepth_batch_complete",
1614 .type = FIO_OPT_INT,
1615 .off1 = td_var_offset(iodepth_batch_complete_min),
1616 .help = "Min number of IO buffers to retrieve in one go",
1617 .parent = "iodepth",
1622 .category = FIO_OPT_C_IO,
1623 .group = FIO_OPT_G_IO_BASIC,
1626 .name = "iodepth_batch_complete_max",
1627 .lname = "Max IO depth batch complete",
1628 .type = FIO_OPT_INT,
1629 .off1 = td_var_offset(iodepth_batch_complete_max),
1630 .help = "Max number of IO buffers to retrieve in one go",
1631 .parent = "iodepth",
1635 .category = FIO_OPT_C_IO,
1636 .group = FIO_OPT_G_IO_BASIC,
1639 .name = "iodepth_low",
1640 .lname = "IO Depth batch low",
1641 .type = FIO_OPT_INT,
1642 .off1 = td_var_offset(iodepth_low),
1643 .help = "Low water mark for queuing depth",
1644 .parent = "iodepth",
1647 .category = FIO_OPT_C_IO,
1648 .group = FIO_OPT_G_IO_BASIC,
1651 .name = "io_submit_mode",
1652 .lname = "IO submit mode",
1653 .type = FIO_OPT_STR,
1654 .off1 = td_var_offset(io_submit_mode),
1655 .help = "How IO submissions and completions are done",
1657 .category = FIO_OPT_C_IO,
1658 .group = FIO_OPT_G_IO_BASIC,
1661 .oval = IO_MODE_INLINE,
1662 .help = "Submit and complete IO inline",
1664 { .ival = "offload",
1665 .oval = IO_MODE_OFFLOAD,
1666 .help = "Offload submit and complete to threads",
1673 .type = FIO_OPT_STR_VAL,
1675 .off1 = td_var_offset(size),
1676 .help = "Total size of device or files",
1677 .interval = 1024 * 1024,
1678 .category = FIO_OPT_C_IO,
1679 .group = FIO_OPT_G_INVALID,
1683 .alias = "io_limit",
1685 .type = FIO_OPT_STR_VAL,
1686 .off1 = td_var_offset(io_limit),
1687 .interval = 1024 * 1024,
1688 .category = FIO_OPT_C_IO,
1689 .group = FIO_OPT_G_INVALID,
1692 .name = "fill_device",
1693 .lname = "Fill device",
1695 .type = FIO_OPT_BOOL,
1696 .off1 = td_var_offset(fill_device),
1697 .help = "Write until an ENOSPC error occurs",
1699 .category = FIO_OPT_C_FILE,
1700 .group = FIO_OPT_G_INVALID,
1704 .lname = "File size",
1705 .type = FIO_OPT_STR_VAL,
1706 .off1 = td_var_offset(file_size_low),
1707 .off2 = td_var_offset(file_size_high),
1709 .help = "Size of individual files",
1710 .interval = 1024 * 1024,
1711 .category = FIO_OPT_C_FILE,
1712 .group = FIO_OPT_G_INVALID,
1715 .name = "file_append",
1716 .lname = "File append",
1717 .type = FIO_OPT_BOOL,
1718 .off1 = td_var_offset(file_append),
1719 .help = "IO will start at the end of the file(s)",
1721 .category = FIO_OPT_C_FILE,
1722 .group = FIO_OPT_G_INVALID,
1726 .lname = "IO offset",
1727 .alias = "fileoffset",
1728 .type = FIO_OPT_STR_VAL,
1729 .off1 = td_var_offset(start_offset),
1730 .help = "Start IO from this offset",
1732 .interval = 1024 * 1024,
1733 .category = FIO_OPT_C_IO,
1734 .group = FIO_OPT_G_INVALID,
1737 .name = "offset_increment",
1738 .lname = "IO offset increment",
1739 .type = FIO_OPT_STR_VAL,
1740 .off1 = td_var_offset(offset_increment),
1741 .help = "What is the increment from one offset to the next",
1745 .interval = 1024 * 1024,
1746 .category = FIO_OPT_C_IO,
1747 .group = FIO_OPT_G_INVALID,
1750 .name = "number_ios",
1751 .lname = "Number of IOs to perform",
1752 .type = FIO_OPT_STR_VAL,
1753 .off1 = td_var_offset(number_ios),
1754 .help = "Force job completion after this number of IOs",
1756 .category = FIO_OPT_C_IO,
1757 .group = FIO_OPT_G_INVALID,
1761 .lname = "Block size",
1762 .alias = "blocksize",
1763 .type = FIO_OPT_INT,
1764 .off1 = td_var_offset(bs[DDIR_READ]),
1765 .off2 = td_var_offset(bs[DDIR_WRITE]),
1766 .off3 = td_var_offset(bs[DDIR_TRIM]),
1768 .help = "Block size unit",
1773 .category = FIO_OPT_C_IO,
1774 .group = FIO_OPT_G_INVALID,
1778 .lname = "Block size align",
1779 .alias = "blockalign",
1780 .type = FIO_OPT_INT,
1781 .off1 = td_var_offset(ba[DDIR_READ]),
1782 .off2 = td_var_offset(ba[DDIR_WRITE]),
1783 .off3 = td_var_offset(ba[DDIR_TRIM]),
1785 .help = "IO block offset alignment",
1789 .category = FIO_OPT_C_IO,
1790 .group = FIO_OPT_G_INVALID,
1794 .lname = "Block size range",
1795 .alias = "blocksize_range",
1796 .type = FIO_OPT_RANGE,
1797 .off1 = td_var_offset(min_bs[DDIR_READ]),
1798 .off2 = td_var_offset(max_bs[DDIR_READ]),
1799 .off3 = td_var_offset(min_bs[DDIR_WRITE]),
1800 .off4 = td_var_offset(max_bs[DDIR_WRITE]),
1801 .off5 = td_var_offset(min_bs[DDIR_TRIM]),
1802 .off6 = td_var_offset(max_bs[DDIR_TRIM]),
1804 .help = "Set block size range (in more detail than bs)",
1808 .category = FIO_OPT_C_IO,
1809 .group = FIO_OPT_G_INVALID,
1813 .lname = "Block size split",
1814 .type = FIO_OPT_STR,
1815 .cb = str_bssplit_cb,
1816 .off1 = td_var_offset(bssplit),
1817 .help = "Set a specific mix of block sizes",
1820 .category = FIO_OPT_C_IO,
1821 .group = FIO_OPT_G_INVALID,
1824 .name = "bs_unaligned",
1825 .lname = "Block size unaligned",
1826 .alias = "blocksize_unaligned",
1827 .type = FIO_OPT_STR_SET,
1828 .off1 = td_var_offset(bs_unaligned),
1829 .help = "Don't sector align IO buffer sizes",
1832 .category = FIO_OPT_C_IO,
1833 .group = FIO_OPT_G_INVALID,
1836 .name = "bs_is_seq_rand",
1837 .lname = "Block size division is seq/random (not read/write)",
1838 .type = FIO_OPT_BOOL,
1839 .off1 = td_var_offset(bs_is_seq_rand),
1840 .help = "Consider any blocksize setting to be sequential,random",
1842 .parent = "blocksize",
1843 .category = FIO_OPT_C_IO,
1844 .group = FIO_OPT_G_INVALID,
1847 .name = "randrepeat",
1848 .lname = "Random repeatable",
1849 .type = FIO_OPT_BOOL,
1850 .off1 = td_var_offset(rand_repeatable),
1851 .help = "Use repeatable random IO pattern",
1855 .category = FIO_OPT_C_IO,
1856 .group = FIO_OPT_G_RANDOM,
1860 .lname = "The random generator seed",
1861 .type = FIO_OPT_STR_VAL,
1862 .off1 = td_var_offset(rand_seed),
1863 .help = "Set the random generator seed value",
1866 .category = FIO_OPT_C_IO,
1867 .group = FIO_OPT_G_RANDOM,
1870 .name = "use_os_rand",
1871 .lname = "Use OS random",
1872 .type = FIO_OPT_DEPRECATED,
1873 .off1 = td_var_offset(dep_use_os_rand),
1874 .category = FIO_OPT_C_IO,
1875 .group = FIO_OPT_G_RANDOM,
1878 .name = "norandommap",
1879 .lname = "No randommap",
1880 .type = FIO_OPT_STR_SET,
1881 .off1 = td_var_offset(norandommap),
1882 .help = "Accept potential duplicate random blocks",
1886 .category = FIO_OPT_C_IO,
1887 .group = FIO_OPT_G_RANDOM,
1890 .name = "softrandommap",
1891 .lname = "Soft randommap",
1892 .type = FIO_OPT_BOOL,
1893 .off1 = td_var_offset(softrandommap),
1894 .help = "Set norandommap if randommap allocation fails",
1895 .parent = "norandommap",
1898 .category = FIO_OPT_C_IO,
1899 .group = FIO_OPT_G_RANDOM,
1902 .name = "random_generator",
1903 .type = FIO_OPT_STR,
1904 .off1 = td_var_offset(random_generator),
1905 .help = "Type of random number generator to use",
1906 .def = "tausworthe",
1908 { .ival = "tausworthe",
1909 .oval = FIO_RAND_GEN_TAUSWORTHE,
1910 .help = "Strong Tausworthe generator",
1913 .oval = FIO_RAND_GEN_LFSR,
1914 .help = "Variable length LFSR",
1917 .ival = "tausworthe64",
1918 .oval = FIO_RAND_GEN_TAUSWORTHE64,
1919 .help = "64-bit Tausworthe variant",
1922 .category = FIO_OPT_C_IO,
1923 .group = FIO_OPT_G_RANDOM,
1926 .name = "random_distribution",
1927 .type = FIO_OPT_STR,
1928 .off1 = td_var_offset(random_distribution),
1929 .cb = str_random_distribution_cb,
1930 .help = "Random offset distribution generator",
1934 .oval = FIO_RAND_DIST_RANDOM,
1935 .help = "Completely random",
1938 .oval = FIO_RAND_DIST_ZIPF,
1939 .help = "Zipf distribution",
1942 .oval = FIO_RAND_DIST_PARETO,
1943 .help = "Pareto distribution",
1946 .oval = FIO_RAND_DIST_GAUSS,
1947 .help = "Normal (gaussian) distribution",
1950 .oval = FIO_RAND_DIST_ZONED,
1951 .help = "Zoned random distribution",
1955 .category = FIO_OPT_C_IO,
1956 .group = FIO_OPT_G_RANDOM,
1959 .name = "percentage_random",
1960 .lname = "Percentage Random",
1961 .type = FIO_OPT_INT,
1962 .off1 = td_var_offset(perc_rand[DDIR_READ]),
1963 .off2 = td_var_offset(perc_rand[DDIR_WRITE]),
1964 .off3 = td_var_offset(perc_rand[DDIR_TRIM]),
1966 .help = "Percentage of seq/random mix that should be random",
1967 .def = "100,100,100",
1969 .inverse = "percentage_sequential",
1970 .category = FIO_OPT_C_IO,
1971 .group = FIO_OPT_G_RANDOM,
1974 .name = "percentage_sequential",
1975 .lname = "Percentage Sequential",
1976 .type = FIO_OPT_DEPRECATED,
1977 .category = FIO_OPT_C_IO,
1978 .group = FIO_OPT_G_RANDOM,
1981 .name = "allrandrepeat",
1982 .type = FIO_OPT_BOOL,
1983 .off1 = td_var_offset(allrand_repeatable),
1984 .help = "Use repeatable random numbers for everything",
1986 .category = FIO_OPT_C_IO,
1987 .group = FIO_OPT_G_RANDOM,
1991 .lname = "Number of files",
1992 .alias = "nr_files",
1993 .type = FIO_OPT_INT,
1994 .off1 = td_var_offset(nr_files),
1995 .help = "Split job workload between this number of files",
1998 .category = FIO_OPT_C_FILE,
1999 .group = FIO_OPT_G_INVALID,
2002 .name = "openfiles",
2003 .lname = "Number of open files",
2004 .type = FIO_OPT_INT,
2005 .off1 = td_var_offset(open_files),
2006 .help = "Number of files to keep open at the same time",
2007 .category = FIO_OPT_C_FILE,
2008 .group = FIO_OPT_G_INVALID,
2011 .name = "file_service_type",
2012 .lname = "File service type",
2013 .type = FIO_OPT_STR,
2015 .off1 = td_var_offset(file_service_type),
2016 .help = "How to select which file to service next",
2017 .def = "roundrobin",
2018 .category = FIO_OPT_C_FILE,
2019 .group = FIO_OPT_G_INVALID,
2022 .oval = FIO_FSERVICE_RANDOM,
2023 .help = "Choose a file at random",
2025 { .ival = "roundrobin",
2026 .oval = FIO_FSERVICE_RR,
2027 .help = "Round robin select files",
2029 { .ival = "sequential",
2030 .oval = FIO_FSERVICE_SEQ,
2031 .help = "Finish one file before moving to the next",
2034 .parent = "nrfiles",
2037 #ifdef CONFIG_POSIX_FALLOCATE
2039 .name = "fallocate",
2040 .lname = "Fallocate",
2041 .type = FIO_OPT_STR,
2042 .off1 = td_var_offset(fallocate_mode),
2043 .help = "Whether pre-allocation is performed when laying out files",
2045 .category = FIO_OPT_C_FILE,
2046 .group = FIO_OPT_G_INVALID,
2049 .oval = FIO_FALLOCATE_NONE,
2050 .help = "Do not pre-allocate space",
2053 .oval = FIO_FALLOCATE_POSIX,
2054 .help = "Use posix_fallocate()",
2056 #ifdef CONFIG_LINUX_FALLOCATE
2058 .oval = FIO_FALLOCATE_KEEP_SIZE,
2059 .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)",
2062 /* Compatibility with former boolean values */
2064 .oval = FIO_FALLOCATE_NONE,
2065 .help = "Alias for 'none'",
2068 .oval = FIO_FALLOCATE_POSIX,
2069 .help = "Alias for 'posix'",
2073 #endif /* CONFIG_POSIX_FALLOCATE */
2075 .name = "fadvise_hint",
2076 .lname = "Fadvise hint",
2077 .type = FIO_OPT_BOOL,
2078 .off1 = td_var_offset(fadvise_hint),
2079 .help = "Use fadvise() to advise the kernel on IO pattern",
2081 .category = FIO_OPT_C_FILE,
2082 .group = FIO_OPT_G_INVALID,
2084 #ifdef FIO_HAVE_STREAMID
2086 .name = "fadvise_stream",
2087 .lname = "Fadvise stream",
2088 .type = FIO_OPT_INT,
2089 .off1 = td_var_offset(fadvise_stream),
2090 .help = "Use fadvise() to set stream ID",
2091 .category = FIO_OPT_C_FILE,
2092 .group = FIO_OPT_G_INVALID,
2098 .type = FIO_OPT_INT,
2099 .off1 = td_var_offset(fsync_blocks),
2100 .help = "Issue fsync for writes every given number of blocks",
2103 .category = FIO_OPT_C_FILE,
2104 .group = FIO_OPT_G_INVALID,
2107 .name = "fdatasync",
2108 .lname = "Fdatasync",
2109 .type = FIO_OPT_INT,
2110 .off1 = td_var_offset(fdatasync_blocks),
2111 .help = "Issue fdatasync for writes every given number of blocks",
2114 .category = FIO_OPT_C_FILE,
2115 .group = FIO_OPT_G_INVALID,
2118 .name = "write_barrier",
2119 .lname = "Write barrier",
2120 .type = FIO_OPT_INT,
2121 .off1 = td_var_offset(barrier_blocks),
2122 .help = "Make every Nth write a barrier write",
2125 .category = FIO_OPT_C_IO,
2126 .group = FIO_OPT_G_INVALID,
2128 #ifdef CONFIG_SYNC_FILE_RANGE
2130 .name = "sync_file_range",
2131 .lname = "Sync file range",
2133 { .ival = "wait_before",
2134 .oval = SYNC_FILE_RANGE_WAIT_BEFORE,
2135 .help = "SYNC_FILE_RANGE_WAIT_BEFORE",
2139 .oval = SYNC_FILE_RANGE_WRITE,
2140 .help = "SYNC_FILE_RANGE_WRITE",
2144 .ival = "wait_after",
2145 .oval = SYNC_FILE_RANGE_WAIT_AFTER,
2146 .help = "SYNC_FILE_RANGE_WAIT_AFTER",
2150 .type = FIO_OPT_STR_MULTI,
2152 .off1 = td_var_offset(sync_file_range),
2153 .help = "Use sync_file_range()",
2154 .category = FIO_OPT_C_FILE,
2155 .group = FIO_OPT_G_INVALID,
2160 .lname = "Direct I/O",
2161 .type = FIO_OPT_BOOL,
2162 .off1 = td_var_offset(odirect),
2163 .help = "Use O_DIRECT IO (negates buffered)",
2165 .inverse = "buffered",
2166 .category = FIO_OPT_C_IO,
2167 .group = FIO_OPT_G_IO_TYPE,
2171 .lname = "Atomic I/O",
2172 .type = FIO_OPT_BOOL,
2173 .off1 = td_var_offset(oatomic),
2174 .help = "Use Atomic IO with O_DIRECT (implies O_DIRECT)",
2176 .category = FIO_OPT_C_IO,
2177 .group = FIO_OPT_G_IO_TYPE,
2181 .lname = "Buffered I/O",
2182 .type = FIO_OPT_BOOL,
2183 .off1 = td_var_offset(odirect),
2185 .help = "Use buffered IO (negates direct)",
2187 .inverse = "direct",
2188 .category = FIO_OPT_C_IO,
2189 .group = FIO_OPT_G_IO_TYPE,
2192 .name = "overwrite",
2193 .lname = "Overwrite",
2194 .type = FIO_OPT_BOOL,
2195 .off1 = td_var_offset(overwrite),
2196 .help = "When writing, set whether to overwrite current data",
2198 .category = FIO_OPT_C_FILE,
2199 .group = FIO_OPT_G_INVALID,
2204 .type = FIO_OPT_INT,
2205 .off1 = td_var_offset(loops),
2206 .help = "Number of times to run the job",
2209 .category = FIO_OPT_C_GENERAL,
2210 .group = FIO_OPT_G_RUNTIME,
2214 .lname = "Number of jobs",
2215 .type = FIO_OPT_INT,
2216 .off1 = td_var_offset(numjobs),
2217 .help = "Duplicate this job this many times",
2220 .category = FIO_OPT_C_GENERAL,
2221 .group = FIO_OPT_G_RUNTIME,
2224 .name = "startdelay",
2225 .lname = "Start delay",
2226 .type = FIO_OPT_STR_VAL_TIME,
2227 .off1 = td_var_offset(start_delay),
2228 .off2 = td_var_offset(start_delay_high),
2229 .help = "Only start job when this period has passed",
2233 .category = FIO_OPT_C_GENERAL,
2234 .group = FIO_OPT_G_RUNTIME,
2240 .type = FIO_OPT_STR_VAL_TIME,
2241 .off1 = td_var_offset(timeout),
2242 .help = "Stop workload when this amount of time has passed",
2246 .category = FIO_OPT_C_GENERAL,
2247 .group = FIO_OPT_G_RUNTIME,
2250 .name = "time_based",
2251 .lname = "Time based",
2252 .type = FIO_OPT_STR_SET,
2253 .off1 = td_var_offset(time_based),
2254 .help = "Keep running until runtime/timeout is met",
2255 .category = FIO_OPT_C_GENERAL,
2256 .group = FIO_OPT_G_RUNTIME,
2259 .name = "verify_only",
2260 .lname = "Verify only",
2261 .type = FIO_OPT_STR_SET,
2262 .off1 = td_var_offset(verify_only),
2263 .help = "Verifies previously written data is still valid",
2264 .category = FIO_OPT_C_GENERAL,
2265 .group = FIO_OPT_G_RUNTIME,
2268 .name = "ramp_time",
2269 .lname = "Ramp time",
2270 .type = FIO_OPT_STR_VAL_TIME,
2271 .off1 = td_var_offset(ramp_time),
2272 .help = "Ramp up time before measuring performance",
2275 .category = FIO_OPT_C_GENERAL,
2276 .group = FIO_OPT_G_RUNTIME,
2279 .name = "clocksource",
2280 .lname = "Clock source",
2281 .type = FIO_OPT_STR,
2282 .cb = fio_clock_source_cb,
2283 .off1 = td_var_offset(clocksource),
2284 .help = "What type of timing source to use",
2285 .category = FIO_OPT_C_GENERAL,
2286 .group = FIO_OPT_G_CLOCK,
2288 #ifdef CONFIG_GETTIMEOFDAY
2289 { .ival = "gettimeofday",
2291 .help = "Use gettimeofday(2) for timing",
2294 #ifdef CONFIG_CLOCK_GETTIME
2295 { .ival = "clock_gettime",
2296 .oval = CS_CGETTIME,
2297 .help = "Use clock_gettime(2) for timing",
2300 #ifdef ARCH_HAVE_CPU_CLOCK
2302 .oval = CS_CPUCLOCK,
2303 .help = "Use CPU private clock",
2311 .lname = "I/O Memory",
2312 .type = FIO_OPT_STR,
2314 .off1 = td_var_offset(mem_type),
2315 .help = "Backing type for IO buffers",
2317 .category = FIO_OPT_C_IO,
2318 .group = FIO_OPT_G_INVALID,
2322 .help = "Use malloc(3) for IO buffers",
2324 #ifndef CONFIG_NO_SHM
2327 .help = "Use shared memory segments for IO buffers",
2329 #ifdef FIO_HAVE_HUGETLB
2330 { .ival = "shmhuge",
2331 .oval = MEM_SHMHUGE,
2332 .help = "Like shm, but use huge pages",
2338 .help = "Use mmap(2) (file or anon) for IO buffers",
2340 { .ival = "mmapshared",
2341 .oval = MEM_MMAPSHARED,
2342 .help = "Like mmap, but use the shared flag",
2344 #ifdef FIO_HAVE_HUGETLB
2345 { .ival = "mmaphuge",
2346 .oval = MEM_MMAPHUGE,
2347 .help = "Like mmap, but use huge pages",
2353 .name = "iomem_align",
2354 .alias = "mem_align",
2355 .lname = "I/O memory alignment",
2356 .type = FIO_OPT_INT,
2357 .off1 = td_var_offset(mem_align),
2359 .help = "IO memory buffer offset alignment",
2363 .category = FIO_OPT_C_IO,
2364 .group = FIO_OPT_G_INVALID,
2369 .type = FIO_OPT_STR,
2370 .off1 = td_var_offset(verify),
2371 .help = "Verify data written",
2373 .category = FIO_OPT_C_IO,
2374 .group = FIO_OPT_G_VERIFY,
2377 .oval = VERIFY_NONE,
2378 .help = "Don't do IO verification",
2382 .help = "Use md5 checksums for verification",
2385 .oval = VERIFY_CRC64,
2386 .help = "Use crc64 checksums for verification",
2389 .oval = VERIFY_CRC32,
2390 .help = "Use crc32 checksums for verification",
2392 { .ival = "crc32c-intel",
2393 .oval = VERIFY_CRC32C,
2394 .help = "Use crc32c checksums for verification (hw assisted, if available)",
2397 .oval = VERIFY_CRC32C,
2398 .help = "Use crc32c checksums for verification (hw assisted, if available)",
2401 .oval = VERIFY_CRC16,
2402 .help = "Use crc16 checksums for verification",
2405 .oval = VERIFY_CRC7,
2406 .help = "Use crc7 checksums for verification",
2409 .oval = VERIFY_SHA1,
2410 .help = "Use sha1 checksums for verification",
2413 .oval = VERIFY_SHA256,
2414 .help = "Use sha256 checksums for verification",
2417 .oval = VERIFY_SHA512,
2418 .help = "Use sha512 checksums for verification",
2421 .oval = VERIFY_XXHASH,
2422 .help = "Use xxhash checksums for verification",
2424 /* Meta information was included into verify_header,
2425 * 'meta' verification is implied by default. */
2427 .oval = VERIFY_HDR_ONLY,
2428 .help = "Use io information for verification. "
2429 "Now is implied by default, thus option is obsolete, "
2432 { .ival = "pattern",
2433 .oval = VERIFY_PATTERN_NO_HDR,
2434 .help = "Verify strict pattern",
2438 .oval = VERIFY_NULL,
2439 .help = "Pretend to verify",
2444 .name = "do_verify",
2445 .lname = "Perform verify step",
2446 .type = FIO_OPT_BOOL,
2447 .off1 = td_var_offset(do_verify),
2448 .help = "Run verification stage after write",
2452 .category = FIO_OPT_C_IO,
2453 .group = FIO_OPT_G_VERIFY,
2456 .name = "verifysort",
2457 .lname = "Verify sort",
2458 .type = FIO_OPT_BOOL,
2459 .off1 = td_var_offset(verifysort),
2460 .help = "Sort written verify blocks for read back",
2464 .category = FIO_OPT_C_IO,
2465 .group = FIO_OPT_G_VERIFY,
2468 .name = "verifysort_nr",
2469 .type = FIO_OPT_INT,
2470 .off1 = td_var_offset(verifysort_nr),
2471 .help = "Pre-load and sort verify blocks for a read workload",
2476 .category = FIO_OPT_C_IO,
2477 .group = FIO_OPT_G_VERIFY,
2480 .name = "verify_interval",
2481 .lname = "Verify interval",
2482 .type = FIO_OPT_INT,
2483 .off1 = td_var_offset(verify_interval),
2484 .minval = 2 * sizeof(struct verify_header),
2485 .help = "Store verify buffer header every N bytes",
2488 .interval = 2 * sizeof(struct verify_header),
2489 .category = FIO_OPT_C_IO,
2490 .group = FIO_OPT_G_VERIFY,
2493 .name = "verify_offset",
2494 .lname = "Verify offset",
2495 .type = FIO_OPT_INT,
2496 .help = "Offset verify header location by N bytes",
2497 .off1 = td_var_offset(verify_offset),
2498 .minval = sizeof(struct verify_header),
2501 .category = FIO_OPT_C_IO,
2502 .group = FIO_OPT_G_VERIFY,
2505 .name = "verify_pattern",
2506 .lname = "Verify pattern",
2507 .type = FIO_OPT_STR,
2508 .cb = str_verify_pattern_cb,
2509 .off1 = td_var_offset(verify_pattern),
2510 .help = "Fill pattern for IO buffers",
2513 .category = FIO_OPT_C_IO,
2514 .group = FIO_OPT_G_VERIFY,
2517 .name = "verify_fatal",
2518 .lname = "Verify fatal",
2519 .type = FIO_OPT_BOOL,
2520 .off1 = td_var_offset(verify_fatal),
2522 .help = "Exit on a single verify failure, don't continue",
2525 .category = FIO_OPT_C_IO,
2526 .group = FIO_OPT_G_VERIFY,
2529 .name = "verify_dump",
2530 .lname = "Verify dump",
2531 .type = FIO_OPT_BOOL,
2532 .off1 = td_var_offset(verify_dump),
2534 .help = "Dump contents of good and bad blocks on failure",
2537 .category = FIO_OPT_C_IO,
2538 .group = FIO_OPT_G_VERIFY,
2541 .name = "verify_async",
2542 .lname = "Verify asynchronously",
2543 .type = FIO_OPT_INT,
2544 .off1 = td_var_offset(verify_async),
2546 .help = "Number of async verifier threads to use",
2549 .category = FIO_OPT_C_IO,
2550 .group = FIO_OPT_G_VERIFY,
2553 .name = "verify_backlog",
2554 .lname = "Verify backlog",
2555 .type = FIO_OPT_STR_VAL,
2556 .off1 = td_var_offset(verify_backlog),
2557 .help = "Verify after this number of blocks are written",
2560 .category = FIO_OPT_C_IO,
2561 .group = FIO_OPT_G_VERIFY,
2564 .name = "verify_backlog_batch",
2565 .lname = "Verify backlog batch",
2566 .type = FIO_OPT_INT,
2567 .off1 = td_var_offset(verify_batch),
2568 .help = "Verify this number of IO blocks",
2571 .category = FIO_OPT_C_IO,
2572 .group = FIO_OPT_G_VERIFY,
2574 #ifdef FIO_HAVE_CPU_AFFINITY
2576 .name = "verify_async_cpus",
2577 .lname = "Async verify CPUs",
2578 .type = FIO_OPT_STR,
2579 .cb = str_verify_cpus_allowed_cb,
2580 .off1 = td_var_offset(verify_cpumask),
2581 .help = "Set CPUs allowed for async verify threads",
2582 .parent = "verify_async",
2584 .category = FIO_OPT_C_IO,
2585 .group = FIO_OPT_G_VERIFY,
2589 .name = "experimental_verify",
2590 .off1 = td_var_offset(experimental_verify),
2591 .type = FIO_OPT_BOOL,
2592 .help = "Enable experimental verification",
2594 .category = FIO_OPT_C_IO,
2595 .group = FIO_OPT_G_VERIFY,
2598 .name = "verify_state_load",
2599 .lname = "Load verify state",
2600 .off1 = td_var_offset(verify_state),
2601 .type = FIO_OPT_BOOL,
2602 .help = "Load verify termination state",
2604 .category = FIO_OPT_C_IO,
2605 .group = FIO_OPT_G_VERIFY,
2608 .name = "verify_state_save",
2609 .lname = "Save verify state",
2610 .off1 = td_var_offset(verify_state_save),
2611 .type = FIO_OPT_BOOL,
2613 .help = "Save verify state on termination",
2615 .category = FIO_OPT_C_IO,
2616 .group = FIO_OPT_G_VERIFY,
2618 #ifdef FIO_HAVE_TRIM
2620 .name = "trim_percentage",
2621 .lname = "Trim percentage",
2622 .type = FIO_OPT_INT,
2623 .off1 = td_var_offset(trim_percentage),
2626 .help = "Number of verify blocks to discard/trim",
2631 .category = FIO_OPT_C_IO,
2632 .group = FIO_OPT_G_TRIM,
2635 .name = "trim_verify_zero",
2636 .lname = "Verify trim zero",
2637 .type = FIO_OPT_BOOL,
2638 .help = "Verify that trim/discarded blocks are returned as zeroes",
2639 .off1 = td_var_offset(trim_zero),
2640 .parent = "trim_percentage",
2643 .category = FIO_OPT_C_IO,
2644 .group = FIO_OPT_G_TRIM,
2647 .name = "trim_backlog",
2648 .lname = "Trim backlog",
2649 .type = FIO_OPT_STR_VAL,
2650 .off1 = td_var_offset(trim_backlog),
2651 .help = "Trim after this number of blocks are written",
2652 .parent = "trim_percentage",
2655 .category = FIO_OPT_C_IO,
2656 .group = FIO_OPT_G_TRIM,
2659 .name = "trim_backlog_batch",
2660 .lname = "Trim backlog batch",
2661 .type = FIO_OPT_INT,
2662 .off1 = td_var_offset(trim_batch),
2663 .help = "Trim this number of IO blocks",
2664 .parent = "trim_percentage",
2667 .category = FIO_OPT_C_IO,
2668 .group = FIO_OPT_G_TRIM,
2672 .name = "write_iolog",
2673 .lname = "Write I/O log",
2674 .type = FIO_OPT_STR_STORE,
2675 .off1 = td_var_offset(write_iolog_file),
2676 .help = "Store IO pattern to file",
2677 .category = FIO_OPT_C_IO,
2678 .group = FIO_OPT_G_IOLOG,
2681 .name = "read_iolog",
2682 .lname = "Read I/O log",
2683 .type = FIO_OPT_STR_STORE,
2684 .off1 = td_var_offset(read_iolog_file),
2685 .help = "Playback IO pattern from file",
2686 .category = FIO_OPT_C_IO,
2687 .group = FIO_OPT_G_IOLOG,
2690 .name = "replay_no_stall",
2691 .lname = "Don't stall on replay",
2692 .type = FIO_OPT_BOOL,
2693 .off1 = td_var_offset(no_stall),
2695 .parent = "read_iolog",
2697 .help = "Playback IO pattern file as fast as possible without stalls",
2698 .category = FIO_OPT_C_IO,
2699 .group = FIO_OPT_G_IOLOG,
2702 .name = "replay_redirect",
2703 .lname = "Redirect device for replay",
2704 .type = FIO_OPT_STR_STORE,
2705 .off1 = td_var_offset(replay_redirect),
2706 .parent = "read_iolog",
2708 .help = "Replay all I/O onto this device, regardless of trace device",
2709 .category = FIO_OPT_C_IO,
2710 .group = FIO_OPT_G_IOLOG,
2713 .name = "replay_scale",
2714 .lname = "Replace offset scale factor",
2715 .type = FIO_OPT_INT,
2716 .off1 = td_var_offset(replay_scale),
2717 .parent = "read_iolog",
2719 .help = "Align offsets to this blocksize",
2720 .category = FIO_OPT_C_IO,
2721 .group = FIO_OPT_G_IOLOG,
2724 .name = "replay_align",
2725 .lname = "Replace alignment",
2726 .type = FIO_OPT_INT,
2727 .off1 = td_var_offset(replay_align),
2728 .parent = "read_iolog",
2729 .help = "Scale offset down by this factor",
2730 .category = FIO_OPT_C_IO,
2731 .group = FIO_OPT_G_IOLOG,
2735 .name = "exec_prerun",
2736 .lname = "Pre-execute runnable",
2737 .type = FIO_OPT_STR_STORE,
2738 .off1 = td_var_offset(exec_prerun),
2739 .help = "Execute this file prior to running job",
2740 .category = FIO_OPT_C_GENERAL,
2741 .group = FIO_OPT_G_INVALID,
2744 .name = "exec_postrun",
2745 .lname = "Post-execute runnable",
2746 .type = FIO_OPT_STR_STORE,
2747 .off1 = td_var_offset(exec_postrun),
2748 .help = "Execute this file after running job",
2749 .category = FIO_OPT_C_GENERAL,
2750 .group = FIO_OPT_G_INVALID,
2752 #ifdef FIO_HAVE_IOSCHED_SWITCH
2754 .name = "ioscheduler",
2755 .lname = "I/O scheduler",
2756 .type = FIO_OPT_STR_STORE,
2757 .off1 = td_var_offset(ioscheduler),
2758 .help = "Use this IO scheduler on the backing device",
2759 .category = FIO_OPT_C_FILE,
2760 .group = FIO_OPT_G_INVALID,
2765 .lname = "Zone size",
2766 .type = FIO_OPT_STR_VAL,
2767 .off1 = td_var_offset(zone_size),
2768 .help = "Amount of data to read per zone",
2770 .interval = 1024 * 1024,
2771 .category = FIO_OPT_C_IO,
2772 .group = FIO_OPT_G_ZONE,
2775 .name = "zonerange",
2776 .lname = "Zone range",
2777 .type = FIO_OPT_STR_VAL,
2778 .off1 = td_var_offset(zone_range),
2779 .help = "Give size of an IO zone",
2781 .interval = 1024 * 1024,
2782 .category = FIO_OPT_C_IO,
2783 .group = FIO_OPT_G_ZONE,
2787 .lname = "Zone skip",
2788 .type = FIO_OPT_STR_VAL,
2789 .off1 = td_var_offset(zone_skip),
2790 .help = "Space between IO zones",
2792 .interval = 1024 * 1024,
2793 .category = FIO_OPT_C_IO,
2794 .group = FIO_OPT_G_ZONE,
2798 .lname = "Lock memory",
2799 .type = FIO_OPT_STR_VAL,
2800 .off1 = td_var_offset(lockmem),
2801 .help = "Lock down this amount of memory (per worker)",
2803 .interval = 1024 * 1024,
2804 .category = FIO_OPT_C_GENERAL,
2805 .group = FIO_OPT_G_INVALID,
2808 .name = "rwmixread",
2809 .lname = "Read/write mix read",
2810 .type = FIO_OPT_INT,
2811 .cb = str_rwmix_read_cb,
2812 .off1 = td_var_offset(rwmix[DDIR_READ]),
2814 .help = "Percentage of mixed workload that is reads",
2817 .inverse = "rwmixwrite",
2818 .category = FIO_OPT_C_IO,
2819 .group = FIO_OPT_G_RWMIX,
2822 .name = "rwmixwrite",
2823 .lname = "Read/write mix write",
2824 .type = FIO_OPT_INT,
2825 .cb = str_rwmix_write_cb,
2826 .off1 = td_var_offset(rwmix[DDIR_WRITE]),
2828 .help = "Percentage of mixed workload that is writes",
2831 .inverse = "rwmixread",
2832 .category = FIO_OPT_C_IO,
2833 .group = FIO_OPT_G_RWMIX,
2836 .name = "rwmixcycle",
2837 .lname = "Read/write mix cycle",
2838 .type = FIO_OPT_DEPRECATED,
2839 .category = FIO_OPT_C_IO,
2840 .group = FIO_OPT_G_RWMIX,
2845 .type = FIO_OPT_INT,
2846 .off1 = td_var_offset(nice),
2847 .help = "Set job CPU nice value",
2852 .category = FIO_OPT_C_GENERAL,
2853 .group = FIO_OPT_G_CRED,
2855 #ifdef FIO_HAVE_IOPRIO
2858 .lname = "I/O nice priority",
2859 .type = FIO_OPT_INT,
2860 .off1 = td_var_offset(ioprio),
2861 .help = "Set job IO priority value",
2865 .category = FIO_OPT_C_GENERAL,
2866 .group = FIO_OPT_G_CRED,
2869 .name = "prioclass",
2870 .lname = "I/O nice priority class",
2871 .type = FIO_OPT_INT,
2872 .off1 = td_var_offset(ioprio_class),
2873 .help = "Set job IO priority class",
2877 .category = FIO_OPT_C_GENERAL,
2878 .group = FIO_OPT_G_CRED,
2882 .name = "thinktime",
2883 .lname = "Thinktime",
2884 .type = FIO_OPT_INT,
2885 .off1 = td_var_offset(thinktime),
2886 .help = "Idle time between IO buffers (usec)",
2889 .category = FIO_OPT_C_IO,
2890 .group = FIO_OPT_G_THINKTIME,
2893 .name = "thinktime_spin",
2894 .lname = "Thinktime spin",
2895 .type = FIO_OPT_INT,
2896 .off1 = td_var_offset(thinktime_spin),
2897 .help = "Start think time by spinning this amount (usec)",
2900 .parent = "thinktime",
2902 .category = FIO_OPT_C_IO,
2903 .group = FIO_OPT_G_THINKTIME,
2906 .name = "thinktime_blocks",
2907 .lname = "Thinktime blocks",
2908 .type = FIO_OPT_INT,
2909 .off1 = td_var_offset(thinktime_blocks),
2910 .help = "IO buffer period between 'thinktime'",
2912 .parent = "thinktime",
2914 .category = FIO_OPT_C_IO,
2915 .group = FIO_OPT_G_THINKTIME,
2919 .lname = "I/O rate",
2920 .type = FIO_OPT_INT,
2921 .off1 = td_var_offset(rate[DDIR_READ]),
2922 .off2 = td_var_offset(rate[DDIR_WRITE]),
2923 .off3 = td_var_offset(rate[DDIR_TRIM]),
2924 .help = "Set bandwidth rate",
2925 .category = FIO_OPT_C_IO,
2926 .group = FIO_OPT_G_RATE,
2931 .lname = "I/O min rate",
2932 .type = FIO_OPT_INT,
2933 .off1 = td_var_offset(ratemin[DDIR_READ]),
2934 .off2 = td_var_offset(ratemin[DDIR_WRITE]),
2935 .off3 = td_var_offset(ratemin[DDIR_TRIM]),
2936 .help = "Job must meet this rate or it will be shutdown",
2939 .category = FIO_OPT_C_IO,
2940 .group = FIO_OPT_G_RATE,
2943 .name = "rate_iops",
2944 .lname = "I/O rate IOPS",
2945 .type = FIO_OPT_INT,
2946 .off1 = td_var_offset(rate_iops[DDIR_READ]),
2947 .off2 = td_var_offset(rate_iops[DDIR_WRITE]),
2948 .off3 = td_var_offset(rate_iops[DDIR_TRIM]),
2949 .help = "Limit IO used to this number of IO operations/sec",
2951 .category = FIO_OPT_C_IO,
2952 .group = FIO_OPT_G_RATE,
2955 .name = "rate_iops_min",
2956 .lname = "I/O min rate IOPS",
2957 .type = FIO_OPT_INT,
2958 .off1 = td_var_offset(rate_iops_min[DDIR_READ]),
2959 .off2 = td_var_offset(rate_iops_min[DDIR_WRITE]),
2960 .off3 = td_var_offset(rate_iops_min[DDIR_TRIM]),
2961 .help = "Job must meet this rate or it will be shut down",
2962 .parent = "rate_iops",
2964 .category = FIO_OPT_C_IO,
2965 .group = FIO_OPT_G_RATE,
2968 .name = "rate_process",
2969 .lname = "Rate Process",
2970 .type = FIO_OPT_STR,
2971 .off1 = td_var_offset(rate_process),
2972 .help = "What process controls how rated IO is managed",
2974 .category = FIO_OPT_C_IO,
2975 .group = FIO_OPT_G_RATE,
2978 .oval = RATE_PROCESS_LINEAR,
2979 .help = "Linear rate of IO",
2983 .oval = RATE_PROCESS_POISSON,
2984 .help = "Rate follows Poisson process",
2990 .name = "rate_cycle",
2991 .alias = "ratecycle",
2992 .lname = "I/O rate cycle",
2993 .type = FIO_OPT_INT,
2994 .off1 = td_var_offset(ratecycle),
2995 .help = "Window average for rate limits (msec)",
2999 .category = FIO_OPT_C_IO,
3000 .group = FIO_OPT_G_RATE,
3003 .name = "max_latency",
3004 .type = FIO_OPT_INT,
3005 .off1 = td_var_offset(max_latency),
3006 .help = "Maximum tolerated IO latency (usec)",
3008 .category = FIO_OPT_C_IO,
3009 .group = FIO_OPT_G_LATPROF,
3012 .name = "latency_target",
3013 .lname = "Latency Target (usec)",
3014 .type = FIO_OPT_STR_VAL_TIME,
3015 .off1 = td_var_offset(latency_target),
3016 .help = "Ramp to max queue depth supporting this latency",
3018 .category = FIO_OPT_C_IO,
3019 .group = FIO_OPT_G_LATPROF,
3022 .name = "latency_window",
3023 .lname = "Latency Window (usec)",
3024 .type = FIO_OPT_STR_VAL_TIME,
3025 .off1 = td_var_offset(latency_window),
3026 .help = "Time to sustain latency_target",
3028 .category = FIO_OPT_C_IO,
3029 .group = FIO_OPT_G_LATPROF,
3032 .name = "latency_percentile",
3033 .lname = "Latency Percentile",
3034 .type = FIO_OPT_FLOAT_LIST,
3035 .off1 = td_var_offset(latency_percentile),
3036 .help = "Percentile of IOs must be below latency_target",
3041 .category = FIO_OPT_C_IO,
3042 .group = FIO_OPT_G_LATPROF,
3045 .name = "invalidate",
3046 .lname = "Cache invalidate",
3047 .type = FIO_OPT_BOOL,
3048 .off1 = td_var_offset(invalidate_cache),
3049 .help = "Invalidate buffer/page cache prior to running job",
3051 .category = FIO_OPT_C_IO,
3052 .group = FIO_OPT_G_IO_TYPE,
3056 .lname = "Synchronous I/O",
3057 .type = FIO_OPT_BOOL,
3058 .off1 = td_var_offset(sync_io),
3059 .help = "Use O_SYNC for buffered writes",
3061 .parent = "buffered",
3063 .category = FIO_OPT_C_IO,
3064 .group = FIO_OPT_G_IO_TYPE,
3067 .name = "create_serialize",
3068 .lname = "Create serialize",
3069 .type = FIO_OPT_BOOL,
3070 .off1 = td_var_offset(create_serialize),
3071 .help = "Serialize creating of job files",
3073 .category = FIO_OPT_C_FILE,
3074 .group = FIO_OPT_G_INVALID,
3077 .name = "create_fsync",
3078 .lname = "Create fsync",
3079 .type = FIO_OPT_BOOL,
3080 .off1 = td_var_offset(create_fsync),
3081 .help = "fsync file after creation",
3083 .category = FIO_OPT_C_FILE,
3084 .group = FIO_OPT_G_INVALID,
3087 .name = "create_on_open",
3088 .lname = "Create on open",
3089 .type = FIO_OPT_BOOL,
3090 .off1 = td_var_offset(create_on_open),
3091 .help = "Create files when they are opened for IO",
3093 .category = FIO_OPT_C_FILE,
3094 .group = FIO_OPT_G_INVALID,
3097 .name = "create_only",
3098 .type = FIO_OPT_BOOL,
3099 .off1 = td_var_offset(create_only),
3100 .help = "Only perform file creation phase",
3101 .category = FIO_OPT_C_FILE,
3105 .name = "allow_file_create",
3106 .lname = "Allow file create",
3107 .type = FIO_OPT_BOOL,
3108 .off1 = td_var_offset(allow_create),
3109 .help = "Permit fio to create files, if they don't exist",
3111 .category = FIO_OPT_C_FILE,
3112 .group = FIO_OPT_G_FILENAME,
3115 .name = "allow_mounted_write",
3116 .lname = "Allow mounted write",
3117 .type = FIO_OPT_BOOL,
3118 .off1 = td_var_offset(allow_mounted_write),
3119 .help = "Allow writes to a mounted partition",
3121 .category = FIO_OPT_C_FILE,
3122 .group = FIO_OPT_G_FILENAME,
3126 .lname = "Pre-read files",
3127 .type = FIO_OPT_BOOL,
3128 .off1 = td_var_offset(pre_read),
3129 .help = "Pre-read files before starting official testing",
3131 .category = FIO_OPT_C_FILE,
3132 .group = FIO_OPT_G_INVALID,
3134 #ifdef FIO_HAVE_CPU_AFFINITY
3137 .lname = "CPU mask",
3138 .type = FIO_OPT_INT,
3139 .cb = str_cpumask_cb,
3140 .off1 = td_var_offset(cpumask),
3141 .help = "CPU affinity mask",
3142 .category = FIO_OPT_C_GENERAL,
3143 .group = FIO_OPT_G_CRED,
3146 .name = "cpus_allowed",
3147 .lname = "CPUs allowed",
3148 .type = FIO_OPT_STR,
3149 .cb = str_cpus_allowed_cb,
3150 .off1 = td_var_offset(cpumask),
3151 .help = "Set CPUs allowed",
3152 .category = FIO_OPT_C_GENERAL,
3153 .group = FIO_OPT_G_CRED,
3156 .name = "cpus_allowed_policy",
3157 .lname = "CPUs allowed distribution policy",
3158 .type = FIO_OPT_STR,
3159 .off1 = td_var_offset(cpus_allowed_policy),
3160 .help = "Distribution policy for cpus_allowed",
3161 .parent = "cpus_allowed",
3165 .oval = FIO_CPUS_SHARED,
3166 .help = "Mask shared between threads",
3169 .oval = FIO_CPUS_SPLIT,
3170 .help = "Mask split between threads",
3173 .category = FIO_OPT_C_GENERAL,
3174 .group = FIO_OPT_G_CRED,
3177 #ifdef CONFIG_LIBNUMA
3179 .name = "numa_cpu_nodes",
3180 .type = FIO_OPT_STR,
3181 .cb = str_numa_cpunodes_cb,
3182 .off1 = td_var_offset(numa_cpunodes),
3183 .help = "NUMA CPU nodes bind",
3184 .category = FIO_OPT_C_GENERAL,
3185 .group = FIO_OPT_G_INVALID,
3188 .name = "numa_mem_policy",
3189 .type = FIO_OPT_STR,
3190 .cb = str_numa_mpol_cb,
3191 .off1 = td_var_offset(numa_memnodes),
3192 .help = "NUMA memory policy setup",
3193 .category = FIO_OPT_C_GENERAL,
3194 .group = FIO_OPT_G_INVALID,
3198 .name = "end_fsync",
3199 .lname = "End fsync",
3200 .type = FIO_OPT_BOOL,
3201 .off1 = td_var_offset(end_fsync),
3202 .help = "Include fsync at the end of job",
3204 .category = FIO_OPT_C_FILE,
3205 .group = FIO_OPT_G_INVALID,
3208 .name = "fsync_on_close",
3209 .lname = "Fsync on close",
3210 .type = FIO_OPT_BOOL,
3211 .off1 = td_var_offset(fsync_on_close),
3212 .help = "fsync files on close",
3214 .category = FIO_OPT_C_FILE,
3215 .group = FIO_OPT_G_INVALID,
3219 .lname = "Unlink file",
3220 .type = FIO_OPT_BOOL,
3221 .off1 = td_var_offset(unlink),
3222 .help = "Unlink created files after job has completed",
3224 .category = FIO_OPT_C_FILE,
3225 .group = FIO_OPT_G_INVALID,
3229 .lname = "Exit-all on terminate",
3230 .type = FIO_OPT_STR_SET,
3231 .cb = str_exitall_cb,
3232 .help = "Terminate all jobs when one exits",
3233 .category = FIO_OPT_C_GENERAL,
3234 .group = FIO_OPT_G_PROCESS,
3237 .name = "exitall_on_error",
3238 .lname = "Exit-all on terminate in error",
3239 .type = FIO_OPT_BOOL,
3240 .off1 = td_var_offset(unlink),
3241 .help = "Terminate all jobs when one exits in error",
3242 .category = FIO_OPT_C_GENERAL,
3243 .group = FIO_OPT_G_PROCESS,
3246 .name = "stonewall",
3247 .lname = "Wait for previous",
3248 .alias = "wait_for_previous",
3249 .type = FIO_OPT_STR_SET,
3250 .off1 = td_var_offset(stonewall),
3251 .help = "Insert a hard barrier between this job and previous",
3252 .category = FIO_OPT_C_GENERAL,
3253 .group = FIO_OPT_G_PROCESS,
3256 .name = "new_group",
3257 .lname = "New group",
3258 .type = FIO_OPT_STR_SET,
3259 .off1 = td_var_offset(new_group),
3260 .help = "Mark the start of a new group (for reporting)",
3261 .category = FIO_OPT_C_GENERAL,
3262 .group = FIO_OPT_G_PROCESS,
3267 .type = FIO_OPT_STR_SET,
3268 .off1 = td_var_offset(use_thread),
3269 .help = "Use threads instead of processes",
3270 #ifdef CONFIG_NO_SHM
3274 .category = FIO_OPT_C_GENERAL,
3275 .group = FIO_OPT_G_PROCESS,
3278 .name = "per_job_logs",
3279 .type = FIO_OPT_BOOL,
3280 .off1 = td_var_offset(per_job_logs),
3281 .help = "Include job number in generated log files or not",
3283 .category = FIO_OPT_C_LOG,
3284 .group = FIO_OPT_G_INVALID,
3287 .name = "write_bw_log",
3288 .lname = "Write bandwidth log",
3289 .type = FIO_OPT_STR_STORE,
3290 .off1 = td_var_offset(bw_log_file),
3291 .help = "Write log of bandwidth during run",
3292 .category = FIO_OPT_C_LOG,
3293 .group = FIO_OPT_G_INVALID,
3296 .name = "write_lat_log",
3297 .lname = "Write latency log",
3298 .type = FIO_OPT_STR_STORE,
3299 .off1 = td_var_offset(lat_log_file),
3300 .help = "Write log of latency during run",
3301 .category = FIO_OPT_C_LOG,
3302 .group = FIO_OPT_G_INVALID,
3305 .name = "write_iops_log",
3306 .lname = "Write IOPS log",
3307 .type = FIO_OPT_STR_STORE,
3308 .off1 = td_var_offset(iops_log_file),
3309 .help = "Write log of IOPS during run",
3310 .category = FIO_OPT_C_LOG,
3311 .group = FIO_OPT_G_INVALID,
3314 .name = "log_avg_msec",
3315 .lname = "Log averaging (msec)",
3316 .type = FIO_OPT_INT,
3317 .off1 = td_var_offset(log_avg_msec),
3318 .help = "Average bw/iops/lat logs over this period of time",
3320 .category = FIO_OPT_C_LOG,
3321 .group = FIO_OPT_G_INVALID,
3324 .name = "log_max_value",
3325 .lname = "Log maximum instead of average",
3326 .type = FIO_OPT_BOOL,
3327 .off1 = td_var_offset(log_max),
3328 .help = "Log max sample in a window instead of average",
3330 .category = FIO_OPT_C_LOG,
3331 .group = FIO_OPT_G_INVALID,
3334 .name = "log_offset",
3335 .lname = "Log offset of IO",
3336 .type = FIO_OPT_BOOL,
3337 .off1 = td_var_offset(log_offset),
3338 .help = "Include offset of IO for each log entry",
3340 .category = FIO_OPT_C_LOG,
3341 .group = FIO_OPT_G_INVALID,
3345 .name = "log_compression",
3346 .lname = "Log compression",
3347 .type = FIO_OPT_INT,
3348 .off1 = td_var_offset(log_gz),
3349 .help = "Log in compressed chunks of this size",
3351 .maxval = 512 * 1024 * 1024ULL,
3352 .category = FIO_OPT_C_LOG,
3353 .group = FIO_OPT_G_INVALID,
3355 #ifdef FIO_HAVE_CPU_AFFINITY
3357 .name = "log_compression_cpus",
3358 .lname = "Log Compression CPUs",
3359 .type = FIO_OPT_STR,