X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fcpu.c;h=4d572b441a54921541e5d7e27ae8151c1dc4a2ce;hb=ebec344dd336784fe8c15fa042649a5e768af63d;hp=85598ef77fb9acd8d4868d6e15de1d9f64bee83f;hpb=12d02717a293cdd0c85504c958f7bf57411bb30b;p=fio.git diff --git a/engines/cpu.c b/engines/cpu.c index 85598ef7..4d572b44 100644 --- a/engines/cpu.c +++ b/engines/cpu.c @@ -6,9 +6,10 @@ * */ #include "../fio.h" +#include "../optgroup.h" struct cpu_options { - struct thread_data *td; + void *pad; unsigned int cpuload; unsigned int cpucycle; unsigned int exit_io_done; @@ -21,7 +22,7 @@ static struct fio_option options[] = { .type = FIO_OPT_INT, .off1 = offsetof(struct cpu_options, cpuload), .help = "Use this percentage of CPU", - .category = FIO_OPT_C_GENERAL, + .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_INVALID, }, { @@ -33,7 +34,7 @@ static struct fio_option options[] = { .def = "50000", .parent = "cpuload", .hide = 1, - .category = FIO_OPT_C_GENERAL, + .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_INVALID, }, { @@ -43,7 +44,7 @@ static struct fio_option options[] = { .off1 = offsetof(struct cpu_options, exit_io_done), .help = "Exit when IO threads finish", .def = "0", - .category = FIO_OPT_C_GENERAL, + .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_INVALID, }, { @@ -52,7 +53,8 @@ static struct fio_option options[] = { }; -static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u) +static enum fio_q_status fio_cpuio_queue(struct thread_data *td, + struct io_u fio_unused *io_u) { struct cpu_options *co = td->eo; @@ -83,12 +85,12 @@ static int fio_cpuio_init(struct thread_data *td) */ o->thinktime_blocks = 1; o->thinktime_spin = 0; - o->thinktime = (co->cpucycle * (100 - co->cpuload)) / co->cpuload; + o->thinktime = ((unsigned long long) co->cpucycle * (100 - co->cpuload)) / co->cpuload; o->nr_files = o->open_files = 1; - log_info("%s: ioengine=cpu, cpuload=%u, cpucycle=%u\n", td->o.name, - co->cpuload, co->cpucycle); + log_info("%s: ioengine=%s, cpuload=%u, cpucycle=%u\n", + td->o.name, td->io_ops->name, co->cpuload, co->cpucycle); return 0; }