4 #define FIO_MAX_OPTS 512
11 #define td_var_offset(var) ((size_t) &((struct thread_options *)0)->var)
13 int add_option(struct fio_option *);
14 void invalidate_profile_options(const char *);
15 extern char *exec_profile;
17 void add_opt_posval(const char *, const char *, const char *);
18 void del_opt_posval(const char *, const char *);
20 void fio_options_free(struct thread_data *);
21 char *get_name_idx(char *, int);
22 int set_name_idx(char *, char *, int);
24 extern char client_sockaddr_str[INET6_ADDRSTRLEN]; /* used with --client option */
26 extern struct fio_option fio_options[FIO_MAX_OPTS];
28 extern int __fio_option_is_set(struct thread_options *, unsigned int off);
30 #define fio_option_is_set(__td, name) \
32 const unsigned int off = td_var_offset(name); \
33 int __r = __fio_option_is_set((__td), off); \
35 dprint(FD_PARSE, "option %s/%u not found in map\n", \
36 __fio_stringify(name), off); \
42 extern void fio_option_mark_set(struct thread_options *, struct fio_option *);
44 static inline int o_match(struct fio_option *o, const char *opt)
46 if (!strcmp(o->name, opt))
48 else if (o->alias && !strcmp(o->alias, opt))
54 static inline struct fio_option *find_option(struct fio_option *options,
59 for (o = &options[0]; o->name; o++)
72 __FIO_OPT_C_GENERAL = 0,
81 FIO_OPT_C_GENERAL = (1U << __FIO_OPT_C_GENERAL),
82 FIO_OPT_C_IO = (1U << __FIO_OPT_C_IO),
83 FIO_OPT_C_FILE = (1U << __FIO_OPT_C_FILE),
84 FIO_OPT_C_STAT = (1U << __FIO_OPT_C_STAT),
85 FIO_OPT_C_LOG = (1U << __FIO_OPT_C_LOG),
86 FIO_OPT_C_PROFILE = (1U << __FIO_OPT_C_PROFILE),
87 FIO_OPT_C_ENGINE = (1U << __FIO_OPT_C_ENGINE),
88 FIO_OPT_C_INVALID = (1U << __FIO_OPT_C_NR),
91 enum opt_category_group {
101 __FIO_OPT_G_FILENAME,
102 __FIO_OPT_G_IO_BASIC,
109 __FIO_OPT_G_THINKTIME,
112 __FIO_OPT_G_TIOBENCH,
114 __FIO_OPT_G_E4DEFRAG,
124 FIO_OPT_G_RATE = (1U << __FIO_OPT_G_RATE),
125 FIO_OPT_G_ZONE = (1U << __FIO_OPT_G_ZONE),
126 FIO_OPT_G_RWMIX = (1U << __FIO_OPT_G_RWMIX),
127 FIO_OPT_G_VERIFY = (1U << __FIO_OPT_G_VERIFY),
128 FIO_OPT_G_TRIM = (1U << __FIO_OPT_G_TRIM),
129 FIO_OPT_G_IOLOG = (1U << __FIO_OPT_G_IOLOG),
130 FIO_OPT_G_IO_DEPTH = (1U << __FIO_OPT_G_IO_DEPTH),
131 FIO_OPT_G_IO_FLOW = (1U << __FIO_OPT_G_IO_FLOW),
132 FIO_OPT_G_DESC = (1U << __FIO_OPT_G_DESC),
133 FIO_OPT_G_FILENAME = (1U << __FIO_OPT_G_FILENAME),
134 FIO_OPT_G_IO_BASIC = (1U << __FIO_OPT_G_IO_BASIC),
135 FIO_OPT_G_CGROUP = (1U << __FIO_OPT_G_CGROUP),
136 FIO_OPT_G_RUNTIME = (1U << __FIO_OPT_G_RUNTIME),
137 FIO_OPT_G_PROCESS = (1U << __FIO_OPT_G_PROCESS),
138 FIO_OPT_G_CRED = (1U << __FIO_OPT_G_CRED),
139 FIO_OPT_G_CLOCK = (1U << __FIO_OPT_G_CLOCK),
140 FIO_OPT_G_IO_TYPE = (1U << __FIO_OPT_G_IO_TYPE),
141 FIO_OPT_G_THINKTIME = (1U << __FIO_OPT_G_THINKTIME),
142 FIO_OPT_G_RANDOM = (1U << __FIO_OPT_G_RANDOM),
143 FIO_OPT_G_IO_BUF = (1U << __FIO_OPT_G_IO_BUF),
144 FIO_OPT_G_TIOBENCH = (1U << __FIO_OPT_G_TIOBENCH),
145 FIO_OPT_G_ERR = (1U << __FIO_OPT_G_ERR),
146 FIO_OPT_G_E4DEFRAG = (1U << __FIO_OPT_G_E4DEFRAG),
147 FIO_OPT_G_NETIO = (1U << __FIO_OPT_G_NETIO),
148 FIO_OPT_G_LIBAIO = (1U << __FIO_OPT_G_LIBAIO),
149 FIO_OPT_G_ACT = (1U << __FIO_OPT_G_ACT),
150 FIO_OPT_G_LATPROF = (1U << __FIO_OPT_G_LATPROF),
151 FIO_OPT_G_RBD = (1U << __FIO_OPT_G_RBD),
152 FIO_OPT_G_GFAPI = (1U << __FIO_OPT_G_GFAPI),
153 FIO_OPT_G_MTD = (1U << __FIO_OPT_G_MTD),
154 FIO_OPT_G_INVALID = (1U << __FIO_OPT_G_NR),
157 extern struct opt_group *opt_group_from_mask(unsigned int *mask);
158 extern struct opt_group *opt_group_cat_from_mask(unsigned int *mask);
159 extern struct fio_option *fio_option_find(const char *name);
160 extern unsigned int fio_get_kb_base(void *);