Add initial support for profile specific options
[fio.git] / profiles / tiobench.c
index d239468f9f3272269089e08590c8ac69d52c4ddc..873be994dd8748ef4d8a0a8e5eb863fec717cf6e 100644 (file)
@@ -1,5 +1,11 @@
 #include "../fio.h"
 #include "../profile.h"
 #include "../fio.h"
 #include "../profile.h"
+#include "../parse.h"
+
+static unsigned long size;
+static unsigned long loops;
+static unsigned long bs;
+static char *dir;
 
 static const char *tb_opts[] = {
        "buffered=0", "size=4*1024*$mb_memory", "bs=4k", "timeout=600",
 
 static const char *tb_opts[] = {
        "buffered=0", "size=4*1024*$mb_memory", "bs=4k", "timeout=600",
@@ -11,10 +17,42 @@ static const char *tb_opts[] = {
        "name=randread", "stonewall", "rw=randread", NULL,
 };
 
        "name=randread", "stonewall", "rw=randread", NULL,
 };
 
+static struct fio_option options[] = {
+       {
+               .name   = "size",
+               .type   = FIO_OPT_INT,
+               .roff1  = &size,
+               .help   = "Size in MB",
+       },
+       {
+               .name   = "block",
+               .type   = FIO_OPT_INT,
+               .roff1  = &bs,
+               .help   = "Block size in bytes",
+               .def    = "4k",
+       },
+       {
+               .name   = "numruns",
+               .type   = FIO_OPT_INT,
+               .roff1  = &loops,
+               .help   = "Number of runs",
+       },
+       {
+               .name   = "dir",
+               .type   = FIO_OPT_STR_STORE,
+               .roff1  = &dir,
+               .help   = "Test directory",
+       },
+       {
+               .name   = NULL,
+       },
+};
+
 static struct profile_ops tiobench_profile = {
        .name           = "tiobench",
        .version        = FIO_PROFILE_VERSION,
        .def_ops        = tb_opts,
 static struct profile_ops tiobench_profile = {
        .name           = "tiobench",
        .version        = FIO_PROFILE_VERSION,
        .def_ops        = tb_opts,
+       .options        = options,
 };
 
 static void fio_init tiobench_register(void)
 };
 
 static void fio_init tiobench_register(void)