summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-12-18 21:51:21 -0700
committerMohamad Ayyash <mkayyash@google.com>2015-03-06 17:58:10 -0800
commit3c0f526fe3fd4f9254cbc2c3ee960294155a8123 (patch)
treefcabf49e8958e7dbb1bf550c40806f80a2d8a5ef
parentc180342e1293259ca8d23ed0298aa6c32815fee5 (diff)
downloadfio-3c0f526fe3fd4f9254cbc2c3ee960294155a8123.tar.gz
options: add debug code for failure to lookup option names
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--options.c2
-rw-r--r--options.h11
2 files changed, 10 insertions, 3 deletions
diff --git a/options.c b/options.c
index 80a7047e..6ceefbc1 100644
--- a/options.c
+++ b/options.c
@@ -4206,7 +4206,7 @@ int __fio_option_is_set(struct thread_options *o, unsigned int off1)
if (!opt) {
log_err("fio: no option found at offset %u\n", off1);
- return 0;
+ return -1;
}
opt_off = opt - &fio_options[0];
diff --git a/options.h b/options.h
index fa015c39..e8308846 100644
--- a/options.h
+++ b/options.h
@@ -24,8 +24,15 @@ 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) \
- __fio_option_is_set((__td), td_var_offset(name))
+#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 *);