Categorize engine and profile options
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/engines/e4defrag.c b/engines/e4defrag.c
index 6063e6c..d9ddf75 100644
--- a/engines/e4defrag.c
+++ b/engines/e4defrag.c
@@ -47,6 +47,8 @@
.type = FIO_OPT_STR_STORE,
.off1 = offsetof(struct e4defrag_options, donor_name),
.help = "File used as a block donor",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_E4DEFRAG,
},
{
.name = "inplace",
@@ -55,6 +57,8 @@
.minval = 0,
.maxval = 1,
.help = "Alloc and free space inside defrag event",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_E4DEFRAG,
},
{
.name = NULL,
diff --git a/engines/libaio.c b/engines/libaio.c
index 4d1f3a3..0dca583 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -32,6 +32,8 @@
.type = FIO_OPT_STR_SET,
.off1 = offsetof(struct libaio_options, userspace_reap),
.help = "Use alternative user-space reap implementation",
+ .category = FIO_OPT_C_ENGINE,
+ .category = FIO_OPT_G_LIBAIO,
},
{
.name = NULL,
diff --git a/engines/net.c b/engines/net.c
index 31f7151..3a352de 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -61,6 +61,8 @@
.type = FIO_OPT_STR_STORE,
.cb = str_hostname_cb,
.help = "Hostname for net IO engine",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_NETIO,
},
{
.name = "port",
@@ -69,6 +71,8 @@
.minval = 1,
.maxval = 65535,
.help = "Port to use for TCP or UDP net connections",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_NETIO,
},
{
.name = "protocol",
@@ -91,6 +95,8 @@
.help = "UNIX domain socket",
},
},
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_NETIO,
},
#ifdef CONFIG_TCP_NODELAY
{
@@ -98,6 +104,8 @@
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct netio_options, nodelay),
.help = "Use TCP_NODELAY on TCP connections",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_NETIO,
},
#endif
{
@@ -105,12 +113,16 @@
.type = FIO_OPT_STR_SET,
.off1 = offsetof(struct netio_options, listen),
.help = "Listen for incoming TCP connections",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_NETIO,
},
{
.name = "pingpong",
.type = FIO_OPT_STR_SET,
.off1 = offsetof(struct netio_options, pingpong),
.help = "Ping-pong IO requests",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_NETIO,
},
{
.name = NULL,
diff --git a/options.c b/options.c
index 84ac412..fd91eed 100644
--- a/options.c
+++ b/options.c
@@ -890,19 +890,6 @@
return add_dir_files(td, td->o.opendir);
}
-static int str_verify_offset_cb(void *data, unsigned long long *off)
-{
- struct thread_data *td = data;
-
- if (*off && *off < sizeof(struct verify_header)) {
- log_err("fio: verify_offset too small\n");
- return 1;
- }
-
- td->o.verify_offset = *off;
- return 0;
-}
-
static int str_verify_pattern_cb(void *data, const char *input)
{
struct thread_data *td = data;
@@ -2220,7 +2207,6 @@
.help = "Offset verify header location by N bytes",
.off1 = td_var_offset(verify_offset),
.minval = sizeof(struct verify_header),
- .cb = str_verify_offset_cb,
.parent = "verify",
.hide = 1,
.category = FIO_OPT_C_IO,
@@ -2535,7 +2521,6 @@
.lname = "I/O nice priority",
.type = FIO_OPT_INT,
.cb = str_prio_cb,
- .off1 = td_var_offset(ioprio),
.help = "Set job IO priority value",
.minval = 0,
.maxval = 7,
@@ -2548,7 +2533,6 @@
.lname = "I/O nice priority class",
.type = FIO_OPT_INT,
.cb = str_prioclass_cb,
- .off1 = td_var_offset(ioprio_class),
.help = "Set job IO priority class",
.minval = 0,
.maxval = 3,
diff --git a/options.h b/options.h
index 50b65a2..852ccae 100644
--- a/options.h
+++ b/options.h
@@ -52,6 +52,7 @@
__FIO_OPT_C_STAT,
__FIO_OPT_C_LOG,
__FIO_OPT_C_PROFILE,
+ __FIO_OPT_C_ENGINE,
__FIO_OPT_C_NR,
FIO_OPT_C_GENERAL = (1U << __FIO_OPT_C_GENERAL),
@@ -60,6 +61,7 @@
FIO_OPT_C_STAT = (1U << __FIO_OPT_C_STAT),
FIO_OPT_C_LOG = (1U << __FIO_OPT_C_LOG),
FIO_OPT_C_PROFILE = (1U << __FIO_OPT_C_PROFILE),
+ FIO_OPT_C_ENGINE = (1U << __FIO_OPT_C_ENGINE),
FIO_OPT_C_INVALID = (1U << __FIO_OPT_C_NR),
};
@@ -86,6 +88,10 @@
__FIO_OPT_G_IO_BUF,
__FIO_OPT_G_TIOBENCH,
__FIO_OPT_G_ERR,
+ __FIO_OPT_G_E4DEFRAG,
+ __FIO_OPT_G_NETIO,
+ __FIO_OPT_G_LIBAIO,
+ __FIO_OPT_G_TIOPROF,
__FIO_OPT_G_NR,
FIO_OPT_G_RATE = (1U << __FIO_OPT_G_RATE),
@@ -110,6 +116,10 @@
FIO_OPT_G_IO_BUF = (1U << __FIO_OPT_G_IO_BUF),
FIO_OPT_G_TIOBENCH = (1U << __FIO_OPT_G_TIOBENCH),
FIO_OPT_G_ERR = (1U << __FIO_OPT_G_ERR),
+ FIO_OPT_G_E4DEFRAG = (1U << __FIO_OPT_G_E4DEFRAG),
+ FIO_OPT_G_NETIO = (1U << __FIO_OPT_G_NETIO),
+ FIO_OPT_G_LIBAIO = (1U << __FIO_OPT_G_LIBAIO),
+ FIO_OPT_G_TIOPROF = (1U << __FIO_OPT_G_TIOPROF),
FIO_OPT_G_INVALID = (1U << __FIO_OPT_G_NR),
};
diff --git a/profiles/tiobench.c b/profiles/tiobench.c
index f86a337..8a05d51 100644
--- a/profiles/tiobench.c
+++ b/profiles/tiobench.c
@@ -26,6 +26,8 @@
.type = FIO_OPT_STR_VAL,
.roff1 = &size,
.help = "Size in MB",
+ .category = FIO_OPT_C_PROFILE,
+ .group = FIO_OPT_G_TIOPROF,
},
{
.name = "block",
@@ -33,24 +35,32 @@
.roff1 = &bs,
.help = "Block size in bytes",
.def = "4k",
+ .category = FIO_OPT_C_PROFILE,
+ .group = FIO_OPT_G_TIOPROF,
},
{
.name = "numruns",
.type = FIO_OPT_INT,
.roff1 = &loops,
.help = "Number of runs",
+ .category = FIO_OPT_C_PROFILE,
+ .group = FIO_OPT_G_TIOPROF,
},
{
.name = "dir",
.type = FIO_OPT_STR_STORE,
.roff1 = &dir,
.help = "Test directory",
+ .category = FIO_OPT_C_PROFILE,
+ .group = FIO_OPT_G_TIOPROF,
},
{
.name = "threads",
.type = FIO_OPT_INT,
.roff1 = &nthreads,
.help = "Number of Threads",
+ .category = FIO_OPT_C_PROFILE,
+ .group = FIO_OPT_G_TIOPROF,
},
{
.name = NULL,