printing: whitespace damage
[fio.git] / options.c
index 1b0117ef182955e41afa59c04236d313fe7fcac4..161b416378ef506424ac6cbb2988c9380bd32051 100644 (file)
--- a/options.c
+++ b/options.c
@@ -962,6 +962,22 @@ static struct opt_group fio_opt_cat_groups[] = {
                .name   = "Clock settings",
                .mask   = FIO_OPT_G_CLOCK,
        },
+       {
+               .name   = "I/O Type",
+               .mask   = FIO_OPT_G_IO_TYPE,
+       },
+       {
+               .name   = "I/O Thinktime",
+               .mask   = FIO_OPT_G_THINKTIME,
+       },
+       {
+               .name   = "Randomizations",
+               .mask   = FIO_OPT_G_RANDOM,
+       },
+       {
+               .name   = "I/O buffers",
+               .mask   = FIO_OPT_G_IO_BUF,
+       },
        {
                .name   = NULL,
        }
@@ -1394,7 +1410,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .parent = "rw",
                .hide   = 1,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_RANDOM,
        },
        {
                .name   = "use_os_rand",
@@ -1406,7 +1422,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .parent = "rw",
                .hide   = 1,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_RANDOM,
        },
        {
                .name   = "norandommap",
@@ -1416,8 +1432,9 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "Accept potential duplicate random blocks",
                .parent = "rw",
                .hide   = 1,
+               .hide_on_set = 1,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_RANDOM,
        },
        {
                .name   = "softrandommap",
@@ -1429,7 +1446,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .hide   = 1,
                .def    = "0",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_RANDOM,
        },
        {
                .name   = "nrfiles",
@@ -1596,8 +1613,9 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .off1   = td_var_offset(odirect),
                .help   = "Use O_DIRECT IO (negates buffered)",
                .def    = "0",
+               .inverse = "buffered",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_TYPE,
        },
        {
                .name   = "buffered",
@@ -1607,8 +1625,9 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .neg    = 1,
                .help   = "Use buffered IO (negates direct)",
                .def    = "1",
+               .inverse = "direct",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_TYPE,
        },
        {
                .name   = "overwrite",
@@ -1768,7 +1787,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .cb     = str_verify_cb,
                .def    = "0",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_VERIFY,
                .posval = {
                          { .ival = "0",
                            .oval = VERIFY_NONE,
@@ -2203,7 +2222,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "Idle time between IO buffers (usec)",
                .def    = "0",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_THINKTIME,
        },
        {
                .name   = "thinktime_spin",
@@ -2215,7 +2234,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .parent = "thinktime",
                .hide   = 1,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_THINKTIME,
        },
        {
                .name   = "thinktime_blocks",
@@ -2227,7 +2246,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .parent = "thinktime",
                .hide   = 1,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_THINKTIME,
        },
        {
                .name   = "rate",
@@ -2294,7 +2313,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "Invalidate buffer/page cache prior to running job",
                .def    = "1",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_TYPE,
        },
        {
                .name   = "sync",
@@ -2306,34 +2325,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .parent = "buffered",
                .hide   = 1,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
-       },
-       {
-               .name   = "bwavgtime",
-               .lname  = "Bandwidth average time",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(bw_avg_time),
-               .help   = "Time window over which to calculate bandwidth"
-                         " (msec)",
-               .def    = "500",
-               .parent = "write_bw_log",
-               .hide   = 1,
-               .interval = 100,
-               .category = FIO_OPT_C_LOG,
-               .group  = FIO_OPT_G_INVALID,
-       },
-       {
-               .name   = "iopsavgtime",
-               .lname  = "IOPS average time",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(iops_avg_time),
-               .help   = "Time window over which to calculate IOPS (msec)",
-               .def    = "500",
-               .parent = "write_iops_log",
-               .hide   = 1,
-               .interval = 100,
-               .category = FIO_OPT_C_LOG,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_TYPE,
        },
        {
                .name   = "create_serialize",
@@ -2375,27 +2367,6 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .category = FIO_OPT_C_FILE,
                .group  = FIO_OPT_G_INVALID,
        },
-       {
-               .name   = "cpuload",
-               .lname  = "CPU load",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(cpuload),
-               .help   = "Use this percentage of CPU",
-               .category = FIO_OPT_C_GENERAL,
-               .group  = FIO_OPT_G_INVALID,
-       },
-       {
-               .name   = "cpuchunks",
-               .lname  = "CPU chunk",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(cpucycle),
-               .help   = "Length of the CPU burn cycles (usecs)",
-               .def    = "50000",
-               .parent = "cpuload",
-               .hide   = 1,
-               .category = FIO_OPT_C_GENERAL,
-               .group  = FIO_OPT_G_INVALID,
-       },
 #ifdef FIO_HAVE_CPU_AFFINITY
        {
                .name   = "cpumask",
@@ -2524,14 +2495,30 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .group  = FIO_OPT_G_INVALID,
        },
        {
-               .name   = "hugepage-size",
-               .lname  = "Hugepage size",
+               .name   = "bwavgtime",
+               .lname  = "Bandwidth average time",
                .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(hugepage_size),
-               .help   = "When using hugepages, specify size of each page",
-               .def    = __fio_stringify(FIO_HUGE_PAGE),
-               .interval = 1024 * 1024,
-               .category = FIO_OPT_C_GENERAL,
+               .off1   = td_var_offset(bw_avg_time),
+               .help   = "Time window over which to calculate bandwidth"
+                         " (msec)",
+               .def    = "500",
+               .parent = "write_bw_log",
+               .hide   = 1,
+               .interval = 100,
+               .category = FIO_OPT_C_LOG,
+               .group  = FIO_OPT_G_INVALID,
+       },
+       {
+               .name   = "iopsavgtime",
+               .lname  = "IOPS average time",
+               .type   = FIO_OPT_INT,
+               .off1   = td_var_offset(iops_avg_time),
+               .help   = "Time window over which to calculate IOPS (msec)",
+               .def    = "500",
+               .parent = "write_iops_log",
+               .hide   = 1,
+               .interval = 100,
+               .category = FIO_OPT_C_LOG,
                .group  = FIO_OPT_G_INVALID,
        },
        {
@@ -2551,7 +2538,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .off1   = td_var_offset(zero_buffers),
                .help   = "Init IO buffers to all zeroes",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_BUF,
        },
        {
                .name   = "refill_buffers",
@@ -2560,7 +2547,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .off1   = td_var_offset(refill_buffers),
                .help   = "Refill IO buffers on every IO submit",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_BUF,
        },
        {
                .name   = "scramble_buffers",
@@ -2570,7 +2557,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "Slightly scramble buffers on every IO submit",
                .def    = "1",
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_BUF,
        },
        {
                .name   = "buffer_compress_percentage",
@@ -2582,7 +2569,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "How compressible the buffer is (approximately)",
                .interval = 5,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_BUF,
        },
        {
                .name   = "buffer_compress_chunk",
@@ -2594,7 +2581,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "Size of compressible region in buffer",
                .interval = 256,
                .category = FIO_OPT_C_IO,
-               .group  = FIO_OPT_G_INVALID,
+               .group  = FIO_OPT_G_IO_BUF,
        },
        {
                .name   = "clat_percentiles",
@@ -2639,6 +2626,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "Greatly reduce number of gettimeofday() calls",
                .cb     = str_gtod_reduce_cb,
                .def    = "0",
+               .hide_on_set = 1,
                .category = FIO_OPT_C_STAT,
                .group  = FIO_OPT_G_INVALID,
        },
@@ -2815,6 +2803,17 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .category = FIO_OPT_C_GENERAL,
                .group  = FIO_OPT_G_INVALID,
        },
+       {
+               .name   = "hugepage-size",
+               .lname  = "Hugepage size",
+               .type   = FIO_OPT_INT,
+               .off1   = td_var_offset(hugepage_size),
+               .help   = "When using hugepages, specify size of each page",
+               .def    = __fio_stringify(FIO_HUGE_PAGE),
+               .interval = 1024 * 1024,
+               .category = FIO_OPT_C_GENERAL,
+               .group  = FIO_OPT_G_INVALID,
+       },
        {
                .name   = "flow_id",
                .lname  = "I/O flow ID",
@@ -3347,3 +3346,9 @@ void fio_options_free(struct thread_data *td)
                td->eo = NULL;
        }
 }
+
+struct fio_option *fio_option_find(const char *name)
+{
+       return find_option(fio_options, name);
+}
+