4 #define FIO_MAX_OPTS 512
10 #define td_var_offset(var) ((size_t) &((struct thread_options *)0)->var)
12 int add_option(struct fio_option *);
13 void invalidate_profile_options(const char *);
14 extern char *exec_profile;
16 void add_opt_posval(const char *, const char *, const char *);
17 void del_opt_posval(const char *, const char *);
19 void fio_options_free(struct thread_data *);
20 char *get_name_idx(char *, int);
21 int set_name_idx(char *, char *, int);
23 extern struct fio_option fio_options[FIO_MAX_OPTS];
25 extern int __fio_option_is_set(struct thread_options *, unsigned int off);
27 #define fio_option_is_set(__td, name) \
29 const unsigned int off = td_var_offset(name); \
30 int __r = __fio_option_is_set((__td), off); \
32 dprint(FD_PARSE, "option %s/%u not found in map\n", \
33 __fio_stringify(name), off); \
39 extern void fio_option_mark_set(struct thread_options *, struct fio_option *);
41 static inline int o_match(struct fio_option *o, const char *opt)
43 if (!strcmp(o->name, opt))
45 else if (o->alias && !strcmp(o->alias, opt))
51 static inline struct fio_option *find_option(struct fio_option *options,
56 for (o = &options[0]; o->name; o++)
69 __FIO_OPT_C_GENERAL = 0,
78 FIO_OPT_C_GENERAL = (1U << __FIO_OPT_C_GENERAL),
79 FIO_OPT_C_IO = (1U << __FIO_OPT_C_IO),
80 FIO_OPT_C_FILE = (1U << __FIO_OPT_C_FILE),
81 FIO_OPT_C_STAT = (1U << __FIO_OPT_C_STAT),
82 FIO_OPT_C_LOG = (1U << __FIO_OPT_C_LOG),
83 FIO_OPT_C_PROFILE = (1U << __FIO_OPT_C_PROFILE),
84 FIO_OPT_C_ENGINE = (1U << __FIO_OPT_C_ENGINE),
85 FIO_OPT_C_INVALID = (1U << __FIO_OPT_C_NR),
88 enum opt_category_group {
106 __FIO_OPT_G_THINKTIME,
109 __FIO_OPT_G_TIOBENCH,
111 __FIO_OPT_G_E4DEFRAG,
120 FIO_OPT_G_RATE = (1U << __FIO_OPT_G_RATE),
121 FIO_OPT_G_ZONE = (1U << __FIO_OPT_G_ZONE),
122 FIO_OPT_G_RWMIX = (1U << __FIO_OPT_G_RWMIX),
123 FIO_OPT_G_VERIFY = (1U << __FIO_OPT_G_VERIFY),
124 FIO_OPT_G_TRIM = (1U << __FIO_OPT_G_TRIM),
125 FIO_OPT_G_IOLOG = (1U << __FIO_OPT_G_IOLOG),
126 FIO_OPT_G_IO_DEPTH = (1U << __FIO_OPT_G_IO_DEPTH),
127 FIO_OPT_G_IO_FLOW = (1U << __FIO_OPT_G_IO_FLOW),
128 FIO_OPT_G_DESC = (1U << __FIO_OPT_G_DESC),
129 FIO_OPT_G_FILENAME = (1U << __FIO_OPT_G_FILENAME),
130 FIO_OPT_G_IO_BASIC = (1U << __FIO_OPT_G_IO_BASIC),
131 FIO_OPT_G_CGROUP = (1U << __FIO_OPT_G_CGROUP),
132 FIO_OPT_G_RUNTIME = (1U << __FIO_OPT_G_RUNTIME),
133 FIO_OPT_G_PROCESS = (1U << __FIO_OPT_G_PROCESS),
134 FIO_OPT_G_CRED = (1U << __FIO_OPT_G_CRED),
135 FIO_OPT_G_CLOCK = (1U << __FIO_OPT_G_CLOCK),
136 FIO_OPT_G_IO_TYPE = (1U << __FIO_OPT_G_IO_TYPE),
137 FIO_OPT_G_THINKTIME = (1U << __FIO_OPT_G_THINKTIME),
138 FIO_OPT_G_RANDOM = (1U << __FIO_OPT_G_RANDOM),
139 FIO_OPT_G_IO_BUF = (1U << __FIO_OPT_G_IO_BUF),
140 FIO_OPT_G_TIOBENCH = (1U << __FIO_OPT_G_TIOBENCH),
141 FIO_OPT_G_ERR = (1U << __FIO_OPT_G_ERR),
142 FIO_OPT_G_E4DEFRAG = (1U << __FIO_OPT_G_E4DEFRAG),
143 FIO_OPT_G_NETIO = (1U << __FIO_OPT_G_NETIO),
144 FIO_OPT_G_LIBAIO = (1U << __FIO_OPT_G_LIBAIO),
145 FIO_OPT_G_ACT = (1U << __FIO_OPT_G_ACT),
146 FIO_OPT_G_LATPROF = (1U << __FIO_OPT_G_LATPROF),
147 FIO_OPT_G_RBD = (1U << __FIO_OPT_G_RBD),
148 FIO_OPT_G_GFAPI = (1U << __FIO_OPT_G_GFAPI),
149 FIO_OPT_G_INVALID = (1U << __FIO_OPT_G_NR),
152 extern struct opt_group *opt_group_from_mask(unsigned int *mask);
153 extern struct opt_group *opt_group_cat_from_mask(unsigned int *mask);
154 extern struct fio_option *fio_option_find(const char *name);
155 extern unsigned int fio_get_kb_base(void *);