X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=options.c;h=f67969eace72c7301b8c872ce16d643d68c5226b;hb=f39159a3e578a88459c80d9efd12529399c12550;hp=1886b23cd010b803b297fdae04a42b0c8684de69;hpb=f0c9c21761fcfec02948890a6288e84acb599031;p=fio.git diff --git a/options.c b/options.c index 1886b23c..f67969ea 100644 --- a/options.c +++ b/options.c @@ -530,9 +530,25 @@ static int str_verify_cpus_allowed_cb(void *data, const char *input) { struct thread_data *td = data; + if (parse_dryrun()) + return 0; + return set_cpus_allowed(td, &td->o.verify_cpumask, input); } -#endif + +#ifdef CONFIG_ZLIB +static int str_log_cpus_allowed_cb(void *data, const char *input) +{ + struct thread_data *td = data; + + if (parse_dryrun()) + return 0; + + return set_cpus_allowed(td, &td->o.log_gz_cpumask, input); +} +#endif /* CONFIG_ZLIB */ + +#endif /* FIO_HAVE_CPU_AFFINITY */ #ifdef CONFIG_LIBNUMA static int str_numa_cpunodes_cb(void *data, char *input) @@ -1029,7 +1045,7 @@ static int gtod_cpu_verify(struct fio_option *o, void *data) /* * Option grouping */ -static struct opt_group fio_opt_groups[] = { +static const struct opt_group fio_opt_groups[] = { { .name = "General", .mask = FIO_OPT_C_GENERAL, @@ -1059,17 +1075,17 @@ static struct opt_group fio_opt_groups[] = { }, }; -static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned int *mask, - unsigned int inv_mask) +static const struct opt_group *group_from_mask(const struct opt_group *ogs, + uint64_t *mask, + uint64_t inv_mask) { - struct opt_group *og; int i; if (*mask == inv_mask || !*mask) return NULL; for (i = 0; ogs[i].name; i++) { - og = &ogs[i]; + const struct opt_group *og = &ogs[i]; if (*mask & og->mask) { *mask &= ~(og->mask); @@ -1080,12 +1096,12 @@ static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned i return NULL; } -struct opt_group *opt_group_from_mask(unsigned int *mask) +const struct opt_group *opt_group_from_mask(uint64_t *mask) { - return __opt_group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID); + return group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID); } -static struct opt_group fio_opt_cat_groups[] = { +static const struct opt_group fio_opt_cat_groups[] = { { .name = "Latency profiling", .mask = FIO_OPT_G_LATPROF, @@ -1184,9 +1200,9 @@ static struct opt_group fio_opt_cat_groups[] = { } }; -struct opt_group *opt_group_cat_from_mask(unsigned int *mask) +const struct opt_group *opt_group_cat_from_mask(uint64_t *mask) { - return __opt_group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID); + return group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID); } /* @@ -1211,6 +1227,15 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_DESC, }, + { + .name = "wait_for", + .lname = "Waitee name", + .type = FIO_OPT_STR_STORE, + .off1 = td_var_offset(wait_for), + .help = "Name of the job this one wants to wait for before starting", + .category = FIO_OPT_C_GENERAL, + .group = FIO_OPT_G_DESC, + }, { .name = "filename", .lname = "Filename(s)", @@ -3126,6 +3151,15 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_PROCESS, }, + { + .name = "exitall_on_error", + .lname = "Exit-all on terminate in error", + .type = FIO_OPT_BOOL, + .off1 = td_var_offset(unlink), + .help = "Terminate all jobs when one exits in error", + .category = FIO_OPT_C_GENERAL, + .group = FIO_OPT_G_PROCESS, + }, { .name = "stonewall", .lname = "Wait for previous", @@ -3226,6 +3260,19 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_LOG, .group = FIO_OPT_G_INVALID, }, +#ifdef FIO_HAVE_CPU_AFFINITY + { + .name = "log_compression_cpus", + .lname = "Log Compression CPUs", + .type = FIO_OPT_STR, + .cb = str_log_cpus_allowed_cb, + .off1 = td_var_offset(log_gz_cpumask), + .parent = "log_compression", + .help = "Limit log compression to these CPUs", + .category = FIO_OPT_C_LOG, + .group = FIO_OPT_G_INVALID, + }, +#endif { .name = "log_store_compressed", .lname = "Log store compressed", @@ -4043,8 +4090,7 @@ static void show_closest_option(const char *opt) free(name); } -int fio_options_parse(struct thread_data *td, char **opts, int num_opts, - int dump_cmdline) +int fio_options_parse(struct thread_data *td, char **opts, int num_opts) { int i, ret, unknown; char **opts_copy; @@ -4055,7 +4101,7 @@ int fio_options_parse(struct thread_data *td, char **opts, int num_opts, for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) { struct fio_option *o; int newret = parse_option(opts_copy[i], opts[i], fio_options, - &o, td, dump_cmdline); + &o, td, &td->opt_list); if (!newret && o) fio_option_mark_set(&td->o, o); @@ -4088,7 +4134,7 @@ int fio_options_parse(struct thread_data *td, char **opts, int num_opts, if (td->eo) newret = parse_option(opts_copy[i], opts[i], td->io_ops->options, &o, - td->eo, dump_cmdline); + td->eo, &td->opt_list); ret |= newret; if (!o) { @@ -4108,7 +4154,7 @@ int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val) { int ret; - ret = parse_cmd_option(opt, val, fio_options, td); + ret = parse_cmd_option(opt, val, fio_options, td, &td->opt_list); if (!ret) { struct fio_option *o; @@ -4123,7 +4169,8 @@ int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val) int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt, char *val) { - return parse_cmd_option(opt, val, td->io_ops->options, td->eo); + return parse_cmd_option(opt, val, td->io_ops->options, td->eo, + &td->opt_list); } void fio_fill_default_options(struct thread_data *td) @@ -4312,19 +4359,19 @@ static int opt_is_set(struct thread_options *o, struct fio_option *opt) return (o->set_options[index] & ((uint64_t)1 << offset)) != 0; } -int __fio_option_is_set(struct thread_options *o, unsigned int off1) +bool __fio_option_is_set(struct thread_options *o, unsigned int off1) { struct fio_option *opt, *next; next = NULL; while ((opt = find_next_opt(o, next, off1)) != NULL) { if (opt_is_set(o, opt)) - return 1; + return true; next = opt; } - return 0; + return false; } void fio_option_mark_set(struct thread_options *o, struct fio_option *opt)