options: add debug code for failure to lookup option names
[fio.git] / options.h
index b2e2c0c8fed232f9213a8647d81f266a82cae3dd..e830884660266cf3fb2471ace132bb20bd9c9e1b 100644 (file)
--- a/options.h
+++ b/options.h
@@ -22,6 +22,20 @@ int set_name_idx(char *, char *, int);
 
 extern struct fio_option fio_options[FIO_MAX_OPTS];
 
+extern int __fio_option_is_set(struct thread_options *, unsigned int off);
+
+#define fio_option_is_set(__td, name)                                  \
+({                                                                     \
+       int __r = __fio_option_is_set((__td), td_var_offset(name));     \
+       if (__r == -1) {                                                \
+               log_err("fio: wanted %s\n", __fio_stringify(name));     \
+               __r = 0;                                                \
+       }                                                               \
+       __r;                                                            \
+})
+
+extern void fio_option_mark_set(struct thread_options *, struct fio_option *);
+
 static inline int o_match(struct fio_option *o, const char *opt)
 {
        if (!strcmp(o->name, opt))