X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=options.c;h=fae3943423e9c2d02d22e5ffa8c4b00c9fba128e;hp=2a530226f399b21585fc345b2a9766f05220a838;hb=757be0e0a61bb20dc1b76f0b222ec700ee7e22c8;hpb=9d8fc5e4351ba93617db379d30482bdc7deea3b8 diff --git a/options.c b/options.c index 2a530226..fae39434 100644 --- a/options.c +++ b/options.c @@ -4,16 +4,12 @@ #include #include #include -#include -#include -#include #include #include #include "fio.h" #include "verify.h" #include "parse.h" -#include "lib/fls.h" #include "lib/pattern.h" #include "options.h" #include "optgroup.h" @@ -61,7 +57,8 @@ struct split { }; static int split_parse_ddir(struct thread_options *o, struct split *split, - enum fio_ddir ddir, char *str, bool absolute) + enum fio_ddir ddir, char *str, bool absolute, + unsigned int max_splits) { unsigned long long perc; unsigned int i; @@ -109,8 +106,10 @@ static int split_parse_ddir(struct thread_options *o, struct split *split, split->val1[i] = val; split->val2[i] = perc; i++; - if (i == ZONESPLIT_MAX) + if (i == max_splits) { + log_err("fio: hit max of %d split entries\n", i); break; + } } split->nr = i; @@ -126,7 +125,7 @@ static int bssplit_ddir(struct thread_options *o, enum fio_ddir ddir, char *str, memset(&split, 0, sizeof(split)); - if (split_parse_ddir(o, &split, ddir, str, data)) + if (split_parse_ddir(o, &split, ddir, str, data, BSSPLIT_MAX)) return 1; if (!split.nr) return 0; @@ -846,7 +845,7 @@ static int zone_split_ddir(struct thread_options *o, enum fio_ddir ddir, memset(&split, 0, sizeof(split)); - if (split_parse_ddir(o, &split, ddir, str, absolute)) + if (split_parse_ddir(o, &split, ddir, str, absolute, ZONESPLIT_MAX)) return 1; if (!split.nr) return 0; @@ -1127,9 +1126,9 @@ static int str_steadystate_cb(void *data, const char *str) if (parse_dryrun()) return 0; - td->o.ss_state |= __FIO_SS_PCT; + td->o.ss_state |= FIO_SS_PCT; td->o.ss_limit.u.f = val; - } else if (td->o.ss_state & __FIO_SS_IOPS) { + } else if (td->o.ss_state & FIO_SS_IOPS) { if (!str_to_float(nr, &val, 0)) { log_err("fio: steadystate IOPS threshold postfix parsing failed\n"); free(nr); @@ -1518,7 +1517,7 @@ static int str_ioengine_external_cb(void *data, const char *str) return 0; } -static int rw_verify(struct fio_option *o, void *data) +static int rw_verify(const struct fio_option *o, void *data) { struct thread_data *td = cb_data_to_td(data); @@ -1531,7 +1530,7 @@ static int rw_verify(struct fio_option *o, void *data) return 0; } -static int gtod_cpu_verify(struct fio_option *o, void *data) +static int gtod_cpu_verify(const struct fio_option *o, void *data) { #ifndef FIO_HAVE_CPU_AFFINITY struct thread_data *td = cb_data_to_td(data); @@ -1817,11 +1816,6 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .help = "GUASI IO engine", }, #endif -#ifdef FIO_HAVE_BINJECT - { .ival = "binject", - .help = "binject direct inject block engine", - }, -#endif #ifdef CONFIG_RDMA { .ival = "rdma", .help = "RDMA IO engine", @@ -2440,7 +2434,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .posval = { { .ival = "0", .oval = F_ADV_NONE, - .help = "Don't issue fadvise", + .help = "Don't issue fadvise/madvise", }, { .ival = "1", .oval = F_ADV_TYPE, @@ -3456,10 +3450,20 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_IO, .group = FIO_OPT_G_RATE, }, + { + .name = "rate_ignore_thinktime", + .lname = "Rate ignore thinktime", + .type = FIO_OPT_BOOL, + .off1 = offsetof(struct thread_options, rate_ign_think), + .help = "Rated IO ignores thinktime settings", + .parent = "rate", + .category = FIO_OPT_C_IO, + .group = FIO_OPT_G_RATE, + }, { .name = "max_latency", - .lname = "Max Latency", - .type = FIO_OPT_INT, + .lname = "Max Latency (usec)", + .type = FIO_OPT_STR_VAL_TIME, .off1 = offsetof(struct thread_options, max_latency), .help = "Maximum tolerated IO latency (usec)", .is_time = 1, @@ -4895,7 +4899,7 @@ int fio_options_parse(struct thread_data *td, char **opts, int num_opts) opts_copy = dup_and_sub_options(opts, num_opts); for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) { - struct fio_option *o; + const struct fio_option *o; int newret = parse_option(opts_copy[i], opts[i], fio_options, &o, &td->o, &td->opt_list); @@ -4921,7 +4925,7 @@ int fio_options_parse(struct thread_data *td, char **opts, int num_opts) opts = opts_copy; } for (i = 0; i < num_opts; i++) { - struct fio_option *o = NULL; + const struct fio_option *o = NULL; int newret = 1; if (!opts_copy[i]) @@ -4952,9 +4956,9 @@ int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val) ret = parse_cmd_option(opt, val, fio_options, &td->o, &td->opt_list); if (!ret) { - struct fio_option *o; + const struct fio_option *o; - o = find_option(fio_options, opt); + o = find_option_c(fio_options, opt); if (o) fio_option_mark_set(&td->o, o); } @@ -5019,7 +5023,7 @@ unsigned int fio_get_kb_base(void *data) return kb_base; } -int add_option(struct fio_option *o) +int add_option(const struct fio_option *o) { struct fio_option *__o; int opt_index = 0; @@ -5156,7 +5160,7 @@ bool __fio_option_is_set(struct thread_options *o, unsigned int off1) return false; } -void fio_option_mark_set(struct thread_options *o, struct fio_option *opt) +void fio_option_mark_set(struct thread_options *o, const struct fio_option *opt) { unsigned int opt_off, index, offset;