2 #include "../profile.h"
5 static unsigned long long size;
6 static unsigned int loops = 1;
7 static unsigned int bs = 4096;
8 static unsigned int nthreads = 1;
11 char sz_idx[80], bs_idx[80], loop_idx[80], dir_idx[80], t_idx[80];
13 static const char *tb_opts[] = {
14 "buffered=0", sz_idx, bs_idx, loop_idx, dir_idx, t_idx,
15 "timeout=600", "group_reporting", "thread", "overwrite=1",
16 "filename=.fio.tio.1:.fio.tio.2:.fio.tio.3:.fio.tio.4",
17 "name=seqwrite", "rw=write", "end_fsync=1",
18 "name=randwrite", "stonewall", "rw=randwrite", "end_fsync=1",
19 "name=seqread", "stonewall", "rw=read",
20 "name=randread", "stonewall", "rw=randread", NULL,
23 static struct fio_option options[] = {
26 .lname = "Tiobench size",
27 .type = FIO_OPT_STR_VAL,
30 .category = FIO_OPT_C_PROFILE,
31 .group = FIO_OPT_G_TIOBENCH,
35 .lname = "Tiobench block",
38 .help = "Block size in bytes",
40 .category = FIO_OPT_C_PROFILE,
41 .group = FIO_OPT_G_TIOBENCH,
45 .lname = "Tiobench numruns",
48 .help = "Number of runs",
49 .category = FIO_OPT_C_PROFILE,
50 .group = FIO_OPT_G_TIOBENCH,
54 .lname = "Tiobench directory",
55 .type = FIO_OPT_STR_STORE,
57 .help = "Test directory",
58 .category = FIO_OPT_C_PROFILE,
59 .group = FIO_OPT_G_TIOBENCH,
63 .lname = "Tiobench threads",
66 .help = "Number of Threads",
67 .category = FIO_OPT_C_PROFILE,
68 .group = FIO_OPT_G_TIOBENCH,
76 * Fill our private options into the command line
78 static void tb_prep_cmdline(void)
82 * tiobench uses size as MB, so multiply up
84 size *= 1024 * 1024ULL;
86 sprintf(sz_idx, "size=%llu", size);
88 strcpy(sz_idx, "size=4*1024*$mb_memory");
90 sprintf(bs_idx, "bs=%u", bs);
91 sprintf(loop_idx, "loops=%u", loops);
94 sprintf(dir_idx, "directory=%s", dir);
96 sprintf(dir_idx, "directory=./");
98 sprintf(t_idx, "numjobs=%u", nthreads);
101 static struct profile_ops tiobench_profile = {
103 .desc = "tiotest/tiobench benchmark",
105 .prep_cmd = tb_prep_cmdline,
109 static void fio_init tiobench_register(void)
111 if (register_profile(&tiobench_profile))
112 log_err("fio: failed to register profile 'tiobench'\n");
115 static void fio_exit tiobench_unregister(void)
117 unregister_profile(&tiobench_profile);