Merge branch 'master' into gfio
authorJens Axboe <axboe@kernel.dk>
Wed, 10 Apr 2013 09:12:21 +0000 (11:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Apr 2013 09:12:21 +0000 (11:12 +0200)
Conflicts:
options.c
parse.c
server.h

Signed-off-by: Jens Axboe <axboe@kernel.dk>
1  2 
options.c
parse.c

diff --cc options.c
index c838ee00b2eb01c15d4f70bf99d9a0dd999dc140,193bdbc12af01c770f559ba08f9089e632c3465e..688d28bddc86c4e016647c55f841a7676f746472
+++ b/options.c
@@@ -936,174 -1087,6 +936,161 @@@ static int gtod_cpu_verify(struct fio_o
        return 0;
  }
  
- static int kb_base_verify(struct fio_option *o, void *data)
- {
-       struct thread_data *td = data;
-       if (td->o.kb_base != 1024 && td->o.kb_base != 1000) {
-               log_err("fio: kb_base set to nonsensical value: %u\n",
-                               td->o.kb_base);
-               return 1;
-       }
-       return 0;
- }
 +/*
 + * Option grouping
 + */
 +static struct opt_group fio_opt_groups[] = {
 +      {
 +              .name   = "General",
 +              .mask   = FIO_OPT_C_GENERAL,
 +      },
 +      {
 +              .name   = "I/O",
 +              .mask   = FIO_OPT_C_IO,
 +      },
 +      {
 +              .name   = "File",
 +              .mask   = FIO_OPT_C_FILE,
 +      },
 +      {
 +              .name   = "Statistics",
 +              .mask   = FIO_OPT_C_STAT,
 +      },
 +      {
 +              .name   = "Logging",
 +              .mask   = FIO_OPT_C_LOG,
 +      },
 +      {
 +              .name   = "Profiles",
 +              .mask   = FIO_OPT_C_PROFILE,
 +      },
 +      {
 +              .name   = NULL,
 +      },
 +};
 +
 +static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned int *mask,
 +                                             unsigned int inv_mask)
 +{
 +      struct opt_group *og;
 +      int i;
 +
 +      if (*mask == inv_mask || !*mask)
 +              return NULL;
 +
 +      for (i = 0; ogs[i].name; i++) {
 +              og = &ogs[i];
 +
 +              if (*mask & og->mask) {
 +                      *mask &= ~(og->mask);
 +                      return og;
 +              }
 +      }
 +
 +      return NULL;
 +}
 +
 +struct opt_group *opt_group_from_mask(unsigned int *mask)
 +{
 +      return __opt_group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID);
 +}
 +
 +static struct opt_group fio_opt_cat_groups[] = {
 +      {
 +              .name   = "Rate",
 +              .mask   = FIO_OPT_G_RATE,
 +      },
 +      {
 +              .name   = "Zone",
 +              .mask   = FIO_OPT_G_ZONE,
 +      },
 +      {
 +              .name   = "Read/write mix",
 +              .mask   = FIO_OPT_G_RWMIX,
 +      },
 +      {
 +              .name   = "Verify",
 +              .mask   = FIO_OPT_G_VERIFY,
 +      },
 +      {
 +              .name   = "Trim",
 +              .mask   = FIO_OPT_G_TRIM,
 +      },
 +      {
 +              .name   = "I/O Logging",
 +              .mask   = FIO_OPT_G_IOLOG,
 +      },
 +      {
 +              .name   = "I/O Depth",
 +              .mask   = FIO_OPT_G_IO_DEPTH,
 +      },
 +      {
 +              .name   = "I/O Flow",
 +              .mask   = FIO_OPT_G_IO_FLOW,
 +      },
 +      {
 +              .name   = "Description",
 +              .mask   = FIO_OPT_G_DESC,
 +      },
 +      {
 +              .name   = "Filename",
 +              .mask   = FIO_OPT_G_FILENAME,
 +      },
 +      {
 +              .name   = "General I/O",
 +              .mask   = FIO_OPT_G_IO_BASIC,
 +      },
 +      {
 +              .name   = "Cgroups",
 +              .mask   = FIO_OPT_G_CGROUP,
 +      },
 +      {
 +              .name   = "Runtime",
 +              .mask   = FIO_OPT_G_RUNTIME,
 +      },
 +      {
 +              .name   = "Process",
 +              .mask   = FIO_OPT_G_PROCESS,
 +      },
 +      {
 +              .name   = "Job credentials / priority",
 +              .mask   = FIO_OPT_G_CRED,
 +      },
 +      {
 +              .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   = "Tiobench profile",
 +              .mask   = FIO_OPT_G_TIOBENCH,
 +      },
 +
 +      {
 +              .name   = NULL,
 +      }
 +};
 +
 +struct opt_group *opt_group_cat_from_mask(unsigned int *mask)
 +{
 +      return __opt_group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);
 +}
 +
  /*
   * Map of job/command line options
   */
@@@ -1154,12 -1125,48 +1141,10 @@@ struct fio_option fio_options[FIO_MAX_O
                .prio   = -1, /* must come after "directory" */
                .help   = "Override default $jobname.$jobnum.$filenum naming",
                .def    = "$jobname.$jobnum.$filenum",
-               .category = FIO_OPT_C_FILE,
-               .group  = FIO_OPT_G_FILENAME,
        },
 -      {
 -              .name   = "kb_base",
 -              .type   = FIO_OPT_INT,
 -              .off1   = td_var_offset(kb_base),
 -              .prio   = 1,
 -              .def    = "1024",
 -              .posval = {
 -                        { .ival = "1024",
 -                          .oval = 1024,
 -                          .help = "Use 1024 as the K base",
 -                        },
 -                        { .ival = "1000",
 -                          .oval = 1000,
 -                          .help = "Use 1000 as the K base",
 -                        },
 -              },
 -              .help   = "How many bytes per KB for reporting (1000 or 1024)",
 -      },
 -      {
 -              .name   = "unit_base",
 -              .type   = FIO_OPT_INT,
 -              .off1   = td_var_offset(unit_base),
 -              .prio   = 1,
 -              .posval = {
 -                        { .ival = "0",
 -                          .oval = 0,
 -                          .help = "Auto-detect",
 -                        },
 -                        { .ival = "8",
 -                          .oval = 8,
 -                          .help = "Normal (byte based)",
 -                        },
 -                        { .ival = "1",
 -                          .oval = 1,
 -                          .help = "Bit based",
 -                        },
 -              },
 -              .help   = "Bit multiple of result summary data (8 for byte, 1 for bit)",
 -      },
        {
                .name   = "lockfile",
 +              .lname  = "Lockfile",
                .type   = FIO_OPT_STR,
                .off1   = td_var_offset(file_lock_mode),
                .help   = "Lock file when doing IO to it",
                .type   = FIO_OPT_INT,
                .off1   = td_var_offset(gid),
                .help   = "Run job with this group ID",
-               .verify = kb_base_verify,
 +              .category = FIO_OPT_C_GENERAL,
 +              .group  = FIO_OPT_G_CRED,
 +      },
 +      {
 +              .name   = "kb_base",
 +              .lname  = "KB Base",
 +              .type   = FIO_OPT_INT,
 +              .off1   = td_var_offset(kb_base),
 +              .prio   = 1,
 +              .def    = "1024",
++              .posval = {
++                        { .ival = "1024",
++                          .oval = 1024,
++                          .help = "Use 1024 as the K base",
++                        },
++                        { .ival = "1000",
++                          .oval = 1000,
++                          .help = "Use 1000 as the K base",
++                        },
++              },
 +              .help   = "How many bytes per KB for reporting (1000 or 1024)",
 +              .category = FIO_OPT_C_GENERAL,
 +              .group  = FIO_OPT_G_INVALID,
 +      },
 +      {
 +              .name   = "unit_base",
++              .lname  = "Base unit for reporting (Bits or Bytes)",
 +              .type   = FIO_OPT_INT,
 +              .off1   = td_var_offset(unit_base),
 +              .prio   = 1,
 +              .posval = {
 +                        { .ival = "0",
 +                          .oval = 0,
 +                          .help = "Auto-detect",
 +                        },
 +                        { .ival = "8",
 +                          .oval = 8,
 +                          .help = "Normal (byte based)",
 +                        },
 +                        { .ival = "1",
 +                          .oval = 1,
 +                          .help = "Bit based",
 +                        },
 +              },
 +              .help   = "Bit multiple of result summary data (8 for byte, 1 for bit)",
 +              .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",
diff --cc parse.c
Simple merge