From e90a0adf85f75a65c02b22ba3766dff0d9d82ae6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 10 Apr 2013 19:43:59 +0200 Subject: [PATCH] Categorize engine and profile options Signed-off-by: Jens Axboe --- engines/e4defrag.c | 4 ++++ engines/libaio.c | 2 ++ engines/net.c | 12 ++++++++++++ options.c | 16 ---------------- options.h | 10 ++++++++++ profiles/tiobench.c | 10 ++++++++++ 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/engines/e4defrag.c b/engines/e4defrag.c index 6063e6c8..d9ddf752 100644 --- a/engines/e4defrag.c +++ b/engines/e4defrag.c @@ -47,6 +47,8 @@ static struct fio_option options[] = { .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 @@ static struct fio_option options[] = { .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 4d1f3a31..0dca5837 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -32,6 +32,8 @@ static struct fio_option options[] = { .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 31f71510..3a352de7 100644 --- a/engines/net.c +++ b/engines/net.c @@ -61,6 +61,8 @@ static struct fio_option options[] = { .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 @@ static struct fio_option options[] = { .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 @@ static struct fio_option options[] = { .help = "UNIX domain socket", }, }, + .category = FIO_OPT_C_ENGINE, + .group = FIO_OPT_G_NETIO, }, #ifdef CONFIG_TCP_NODELAY { @@ -98,6 +104,8 @@ static struct fio_option options[] = { .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 @@ static struct fio_option options[] = { .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 84ac4128..fd91eede 100644 --- a/options.c +++ b/options.c @@ -890,19 +890,6 @@ static int str_opendir_cb(void *data, const char fio_unused *str) 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 @@ static struct fio_option fio_options[FIO_MAX_OPTS] = { .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 @@ static struct fio_option fio_options[FIO_MAX_OPTS] = { .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 @@ static struct fio_option fio_options[FIO_MAX_OPTS] = { .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 50b65a23..852ccae1 100644 --- a/options.h +++ b/options.h @@ -52,6 +52,7 @@ enum opt_category { __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 @@ enum opt_category { 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 @@ enum opt_category_group { __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 @@ enum opt_category_group { 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 f86a3378..8a05d51a 100644 --- a/profiles/tiobench.c +++ b/profiles/tiobench.c @@ -26,6 +26,8 @@ static struct fio_option options[] = { .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 @@ static struct fio_option options[] = { .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, -- 2.25.1