X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=profiles%2Ftiobench.c;h=7a7030afac0697c871179cb53e0188e138876737;hp=f86a33787d9ca4e5f25fe2d096089c04b902154d;hb=8271963e39a0a6bfee4d848e1fae4f4e27685204;hpb=f5b6bb85364fcb8b2ac8d922ca65afd9dfabc9bb diff --git a/profiles/tiobench.c b/profiles/tiobench.c index f86a3378..7a7030af 100644 --- a/profiles/tiobench.c +++ b/profiles/tiobench.c @@ -14,43 +14,70 @@ static const char *tb_opts[] = { "buffered=0", sz_idx, bs_idx, loop_idx, dir_idx, t_idx, "timeout=600", "group_reporting", "thread", "overwrite=1", "filename=.fio.tio.1:.fio.tio.2:.fio.tio.3:.fio.tio.4", + "ioengine=sync", "name=seqwrite", "rw=write", "end_fsync=1", "name=randwrite", "stonewall", "rw=randwrite", "end_fsync=1", "name=seqread", "stonewall", "rw=read", "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, }, { .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, + .group = FIO_OPT_G_TIOBENCH, }, { .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, }, { .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, }, { .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, }, { .name = NULL, @@ -60,9 +87,8 @@ static struct fio_option options[] = { /* * Fill our private options into the command line */ -static void tb_prep_cmdline(void) +static int tb_prep_cmdline(void) { - /* * tiobench uses size as MB, so multiply up */ @@ -81,14 +107,16 @@ static void tb_prep_cmdline(void) sprintf(dir_idx, "directory=./"); sprintf(t_idx, "numjobs=%u", nthreads); + return 0; } static struct profile_ops tiobench_profile = { .name = "tiobench", .desc = "tiotest/tiobench benchmark", - .options = options, .prep_cmd = tb_prep_cmdline, .cmdline = tb_opts, + .options = options, + .opt_data = &tiobench_options, }; static void fio_init tiobench_register(void)