#include "fio.h"
#include "parse.h"
-#include "fls.h"
+#include "lib/fls.h"
#define td_var_offset(var) ((size_t) &((struct thread_options *)0)->var)
char *nr = get_opt_postfix(str);
td->o.ddir_nr = 1;
- if (nr)
+ if (nr) {
td->o.ddir_nr = atoi(nr);
+ free(nr);
+ }
return 0;
}
char *nr = get_opt_postfix(str);
td->file_service_nr = 1;
- if (nr)
+ if (nr) {
td->file_service_nr = atoi(nr);
+ free(nr);
+ }
return 0;
}
char *nr = get_opt_postfix(str);
td->o.lockfile_batch = 1;
- if (nr)
+ if (nr) {
td->o.lockfile_batch = atoi(nr);
+ free(nr);
+ }
+
+ return 0;
+}
+
+static int str_gtod_reduce_cb(void *data, int *il)
+{
+ struct thread_data *td = data;
+ int val = *il;
+
+ td->o.disable_clat = !!val;
+ td->o.disable_slat = !!val;
+ td->o.disable_bw = !!val;
+ if (val)
+ td->tv_cache_mask = 63;
return 0;
}
.type = FIO_OPT_STR_STORE,
.off1 = td_var_offset(filename),
.cb = str_filename_cb,
+ .prio = 1, /* must come before "directory" */
.help = "File(s) to use for the workload",
},
{
},
{
.name = "iodepth_batch",
+ .alias = "iodepth_batch_submit",
.type = FIO_OPT_INT,
.off1 = td_var_offset(iodepth_batch),
.help = "Number of IO to submit in one go",
.minval = 1,
.def = "1",
},
+ {
+ .name = "iodepth_batch_complete",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(iodepth_batch_complete),
+ .help = "Number of IO to retrieve in one go",
+ .parent = "iodepth",
+ .minval = 0,
+ .def = "1",
+ },
{
.name = "iodepth_low",
.type = FIO_OPT_INT,
.name = "softrandommap",
.type = FIO_OPT_BOOL,
.off1 = td_var_offset(softrandommap),
- .help = "Allow randommap to fail and continue witout",
+ .help = "Set norandommap if randommap allocation fails",
.parent = "norandommap",
.def = "0",
},
.off1 = td_var_offset(time_based),
.help = "Keep running until runtime/timeout is met",
},
+ {
+ .name = "ramp_time",
+ .type = FIO_OPT_STR_VAL_TIME,
+ .off1 = td_var_offset(ramp_time),
+ .help = "Ramp up time before measuring performance",
+ },
{
.name = "mem",
.alias = "iomem",
.oval = VERIFY_CRC32,
.help = "Use crc32 checksums for verification",
},
+ { .ival = "crc32c-intel",
+ .oval = VERIFY_CRC32C_INTEL,
+ .help = "Use hw crc32c checksums for verification",
+ },
+ { .ival = "crc32c",
+ .oval = VERIFY_CRC32C,
+ .help = "Use crc32c checksums for verification",
+ },
{ .ival = "crc16",
.oval = VERIFY_CRC16,
.help = "Use crc16 checksums for verification",
.name = "disk_util",
.type = FIO_OPT_BOOL,
.off1 = td_var_offset(do_disk_util),
- .help = "Log disk utilization stats",
+ .help = "Log disk utilization statistics",
.def = "1",
},
#endif
+ {
+ .name = "gtod_reduce",
+ .type = FIO_OPT_BOOL,
+ .help = "Greatly reduce number of gettimeofday() calls",
+ .cb = str_gtod_reduce_cb,
+ .def = "0",
+ },
+ {
+ .name = "disable_clat",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(disable_clat),
+ .help = "Disable completion latency numbers",
+ .parent = "gtod_reduce",
+ .def = "0",
+ },
+ {
+ .name = "disable_slat",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(disable_slat),
+ .help = "Disable submissionn latency numbers",
+ .parent = "gtod_reduce",
+ .def = "0",
+ },
+ {
+ .name = "disable_bw_measurement",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(disable_bw),
+ .help = "Disable bandwidth logging",
+ .parent = "gtod_reduce",
+ .def = "0",
+ },
{
.name = NULL,
},
}
}
-int fio_option_parse(struct thread_data *td, const char *opt)
+int fio_options_parse(struct thread_data *td, char **opts, int num_opts)
{
- return parse_option(opt, options, td);
+ int i, ret;
+
+ sort_options(opts, options, num_opts);
+
+ for (ret = 0, i = 0; i < num_opts; i++)
+ ret |= parse_option(opts[i], options, td);
+
+ return ret;
}
int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val)