Categorize engine and profile options
authorJens Axboe <axboe@kernel.dk>
Wed, 10 Apr 2013 17:43:59 +0000 (19:43 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Apr 2013 17:43:59 +0000 (19:43 +0200)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/e4defrag.c
engines/libaio.c
engines/net.c
options.c
options.h
profiles/tiobench.c

index 6063e6c80c01dc36f82779297a28462e2ddff7a0..d9ddf752bf6e39be2bdd61c4ddee12ab2ddb9f20 100644 (file)
@@ -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,
index 4d1f3a311a18fb4ce6b6fad69258062abe785574..0dca58371c9957582fbdb329ce7717fe3e1731c8 100644 (file)
@@ -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,
index 31f7151089a56b9d1047e65d10c6f48efdbccbb0..3a352de70e492fef403ecb8315287514a7cd1199 100644 (file)
@@ -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,
index 84ac412874a2742f083d691fcfc1c70bdbb301d1..fd91eede7a2ae8a90fe78d59284627235fbecb7e 100644 (file)
--- 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,
index 50b65a237ab2299755c8e67033753374790381d1..852ccae101efe6a1184efe48109e20175b76e2fa 100644 (file)
--- 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),
 };
 
index f86a33787d9ca4e5f25fe2d096089c04b902154d..8a05d51afe9f2f69698c84a8725750b81d7cd10d 100644 (file)
@@ -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,