#include "lib/fls.h"
#include "lib/pattern.h"
#include "options.h"
+#include "optgroup.h"
#include "crc/crc32c.h"
return set_cpus_allowed(td, &td->o.verify_cpumask, input);
}
+#ifdef CONFIG_ZLIB
static int str_log_cpus_allowed_cb(void *data, const char *input)
{
struct thread_data *td = data;
return set_cpus_allowed(td, &td->o.log_gz_cpumask, input);
}
+#endif /* CONFIG_ZLIB */
-#endif
+#endif /* FIO_HAVE_CPU_AFFINITY */
#ifdef CONFIG_LIBNUMA
static int str_numa_cpunodes_cb(void *data, char *input)
return 0;
}
-/*
- * Option grouping
- */
-static struct opt_group fio_opt_groups[] = {
- {
- .name = "General",
- .mask = FIO_OPT_C_GENERAL,
- },
- {
- .name = "I/O",
- .mask = FIO_OPT_C_IO,
- },
- {
- .name = "File",
- .mask = FIO_OPT_C_FILE,
- },
- {
- .name = "Statistics",
- .mask = FIO_OPT_C_STAT,
- },
- {
- .name = "Logging",
- .mask = FIO_OPT_C_LOG,
- },
- {
- .name = "Profiles",
- .mask = FIO_OPT_C_PROFILE,
- },
- {
- .name = NULL,
- },
-};
-
-static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned int *mask,
- unsigned int 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];
-
- if (*mask & og->mask) {
- *mask &= ~(og->mask);
- return og;
- }
- }
-
- return NULL;
-}
-
-struct opt_group *opt_group_from_mask(unsigned int *mask)
-{
- return __opt_group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID);
-}
-
-static struct opt_group fio_opt_cat_groups[] = {
- {
- .name = "Latency profiling",
- .mask = FIO_OPT_G_LATPROF,
- },
- {
- .name = "Rate",
- .mask = FIO_OPT_G_RATE,
- },
- {
- .name = "Zone",
- .mask = FIO_OPT_G_ZONE,
- },
- {
- .name = "Read/write mix",
- .mask = FIO_OPT_G_RWMIX,
- },
- {
- .name = "Verify",
- .mask = FIO_OPT_G_VERIFY,
- },
- {
- .name = "Trim",
- .mask = FIO_OPT_G_TRIM,
- },
- {
- .name = "I/O Logging",
- .mask = FIO_OPT_G_IOLOG,
- },
- {
- .name = "I/O Depth",
- .mask = FIO_OPT_G_IO_DEPTH,
- },
- {
- .name = "I/O Flow",
- .mask = FIO_OPT_G_IO_FLOW,
- },
- {
- .name = "Description",
- .mask = FIO_OPT_G_DESC,
- },
- {
- .name = "Filename",
- .mask = FIO_OPT_G_FILENAME,
- },
- {
- .name = "General I/O",
- .mask = FIO_OPT_G_IO_BASIC,
- },
- {
- .name = "Cgroups",
- .mask = FIO_OPT_G_CGROUP,
- },
- {
- .name = "Runtime",
- .mask = FIO_OPT_G_RUNTIME,
- },
- {
- .name = "Process",
- .mask = FIO_OPT_G_PROCESS,
- },
- {
- .name = "Job credentials / priority",
- .mask = FIO_OPT_G_CRED,
- },
- {
- .name = "Clock settings",
- .mask = FIO_OPT_G_CLOCK,
- },
- {
- .name = "I/O Type",
- .mask = FIO_OPT_G_IO_TYPE,
- },
- {
- .name = "I/O Thinktime",
- .mask = FIO_OPT_G_THINKTIME,
- },
- {
- .name = "Randomizations",
- .mask = FIO_OPT_G_RANDOM,
- },
- {
- .name = "I/O buffers",
- .mask = FIO_OPT_G_IO_BUF,
- },
- {
- .name = "Tiobench profile",
- .mask = FIO_OPT_G_TIOBENCH,
- },
- {
- .name = "MTD",
- .mask = FIO_OPT_G_MTD,
- },
-
- {
- .name = NULL,
- }
-};
-
-struct opt_group *opt_group_cat_from_mask(unsigned int *mask)
-{
- return __opt_group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);
-}
-
/*
* Map of job/command line options
*/
.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)",
int fio_options_parse(struct thread_data *td, char **opts, int num_opts)
{
- struct flist_head *opt_list = NULL;
int i, ret, unknown;
char **opts_copy;
- if (!is_def_thread(td))
- opt_list = &td->opt_list;
-
sort_options(opts, fio_options, 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;
int newret = parse_option(opts_copy[i], opts[i], fio_options,
- &o, td, opt_list);
+ &o, td, &td->opt_list);
if (!newret && o)
fio_option_mark_set(&td->o, o);
if (td->eo)
newret = parse_option(opts_copy[i], opts[i],
td->io_ops->options, &o,
- td->eo, opt_list);
+ td->eo, &td->opt_list);
ret |= newret;
if (!o) {
{
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;
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)
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)