X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=profiles%2Ftiobench.c;h=99c88c4507006176707804fc133aa8d45080169d;hp=bdb5985da006b11a4c611c48fc5e4e9e93f9b912;hb=7b504eddc4b039f2db3a0626bd08f880c5f4de27;hpb=eb0c74ae74ce458dd55b7a7d11c5ba7ae59bf5ed diff --git a/profiles/tiobench.c b/profiles/tiobench.c index bdb5985d..99c88c45 100644 --- a/profiles/tiobench.c +++ b/profiles/tiobench.c @@ -21,12 +21,23 @@ static const char *tb_opts[] = { "name=randread", "stonewall", "rw=randread", NULL, }; +struct tiobench_options { + unsigned int pad; + unsigned long long size; + unsigned int loops; + unsigned int bs; + unsigned int nthreads; + char *dir; +}; + +static struct tiobench_options tiobench_options; + static struct fio_option options[] = { { .name = "size", .lname = "Tiobench size", .type = FIO_OPT_STR_VAL, - .roff1 = &size, + .off1 = offsetof(struct tiobench_options, size), .help = "Size in MB", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, @@ -35,7 +46,7 @@ static struct fio_option options[] = { .name = "block", .lname = "Tiobench block", .type = FIO_OPT_INT, - .roff1 = &bs, + .off1 = offsetof(struct tiobench_options, bs), .help = "Block size in bytes", .def = "4k", .category = FIO_OPT_C_PROFILE, @@ -45,7 +56,7 @@ static struct fio_option options[] = { .name = "numruns", .lname = "Tiobench numruns", .type = FIO_OPT_INT, - .roff1 = &loops, + .off1 = offsetof(struct tiobench_options, loops), .help = "Number of runs", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, @@ -54,7 +65,7 @@ static struct fio_option options[] = { .name = "dir", .lname = "Tiobench directory", .type = FIO_OPT_STR_STORE, - .roff1 = &dir, + .off1 = offsetof(struct tiobench_options, dir), .help = "Test directory", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, @@ -63,7 +74,7 @@ static struct fio_option options[] = { .name = "threads", .lname = "Tiobench threads", .type = FIO_OPT_INT, - .roff1 = &nthreads, + .off1 = offsetof(struct tiobench_options, nthreads), .help = "Number of Threads", .category = FIO_OPT_C_PROFILE, .group = FIO_OPT_G_TIOBENCH, @@ -105,6 +116,8 @@ static struct profile_ops tiobench_profile = { .options = options, .prep_cmd = tb_prep_cmdline, .cmdline = tb_opts, + .options = options, + .opt_data = &tiobench_options, }; static void fio_init tiobench_register(void)