char *nr = get_opt_postfix(str);
td->o.ddir_seq_nr = 1;
- if (nr) {
+ td->o.ddir_seq_add = 0;
+
+ if (!nr)
+ return 0;
+
+ if (td_random(td))
td->o.ddir_seq_nr = atoi(nr);
- free(nr);
+ else {
+ long long val;
+
+ if (str_to_decimal(nr, &val, 1, td)) {
+ log_err("fio: rw postfix parsing failed\n");
+ free(nr);
+ return 1;
+ }
+
+ td->o.ddir_seq_add = val;
}
+ free(nr);
return 0;
}
+#ifdef FIO_HAVE_LIBAIO
+static int str_libaio_cb(void *data, const char *str)
+{
+ struct thread_data *td = data;
+
+ if (!strcmp(str, "userspace_reap")) {
+ td->o.userspace_libaio_reap = 1;
+ return 0;
+ }
+
+ log_err("fio: bad libaio sub-option: %s\n", str);
+ return 1;
+}
+#endif
+
static int str_mem_cb(void *data, const char *mem)
{
struct thread_data *td = data;
return start;
}
+static int str_hostname_cb(void *data, const char *input)
+{
+ struct thread_data *td = data;
+
+ td->o.filename = strdup(input);
+ return 0;
+}
+
static int str_filename_cb(void *data, const char *input)
{
struct thread_data *td = data;
return 0;
}
+static int str_write_iops_log_cb(void *data, const char *str)
+{
+ struct thread_data *td = data;
+
+ if (str)
+ td->o.iops_log_file = strdup(str);
+
+ td->o.write_iops_log = 1;
+ return 0;
+}
+
static int str_gtod_reduce_cb(void *data, int *il)
{
struct thread_data *td = data;
return 0;
}
-#define __stringify_1(x) #x
-#define __stringify(x) __stringify_1(x)
-
/*
* Map of job/command line options
*/
.prio = -1, /* must come after "directory" */
.help = "File(s) to use for the workload",
},
+ {
+ .name = "hostname",
+ .type = FIO_OPT_STR_STORE,
+ .cb = str_hostname_cb,
+ .help = "Hostname for net IO engine",
+ },
{
.name = "kb_base",
.type = FIO_OPT_INT,
#ifdef FIO_HAVE_LIBAIO
{ .ival = "libaio",
.help = "Linux native asynchronous IO",
+ .cb = str_libaio_cb,
},
#endif
#ifdef FIO_HAVE_POSIXAIO
.help = "Time window over which to calculate bandwidth"
" (msec)",
.def = "500",
+ .parent = "write_bw_log",
+ },
+ {
+ .name = "iopsavgtime",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(iops_avg_time),
+ .help = "Time window over which to calculate IOPS (msec)",
+ .def = "500",
+ .parent = "write_iops_log",
},
{
.name = "create_serialize",
},
{
.name = "stonewall",
+ .alias = "wait_for_previous",
.type = FIO_OPT_STR_SET,
.off1 = td_var_offset(stonewall),
.help = "Insert a hard barrier between this job and previous",
.cb = str_write_lat_log_cb,
.help = "Write log of latency during run",
},
+ {
+ .name = "write_iops_log",
+ .type = FIO_OPT_STR,
+ .off1 = td_var_offset(write_iops_log),
+ .cb = str_write_iops_log_cb,
+ .help = "Write log of IOPS during run",
+ },
{
.name = "hugepage-size",
.type = FIO_OPT_INT,
.off1 = td_var_offset(hugepage_size),
.help = "When using hugepages, specify size of each page",
- .def = __stringify(FIO_HUGE_PAGE),
+ .def = __fio_stringify(FIO_HUGE_PAGE),
},
{
.name = "group_reporting",
.off1 = td_var_offset(refill_buffers),
.help = "Refill IO buffers on every IO submit",
},
+ {
+ .name = "scramble_buffers",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(scramble_buffers),
+ .help = "Slightly scramble buffers on every IO submit",
+ .def = "1",
+ },
+ {
+ .name = "clat_percentiles",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(clat_percentiles),
+ .help = "Enable the reporting of completion latency percentiles",
+ .def = "0",
+ },
+ {
+ .name = "percentile_list",
+ .type = FIO_OPT_FLOAT_LIST,
+ .off1 = td_var_offset(percentile_list),
+ .off2 = td_var_offset(overwrite_plist),
+ .help = "Specify a custom list of percentiles to report",
+ .maxlen = FIO_IO_U_LIST_MAX_LEN,
+ .minfp = 0.0,
+ .maxfp = 100.0,
+ },
+
#ifdef FIO_HAVE_DISK_UTIL
{
.name = "disk_util",