-static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u)
-{
- __usec_sleep(td->o.cpucycle);
- return FIO_Q_COMPLETED;
-}
+struct cpu_options {
+ void *pad;
+ unsigned int cpuload;
+ unsigned int cpucycle;
+ unsigned int exit_io_done;
+};
+
+static struct fio_option options[] = {
+ {
+ .name = "cpuload",
+ .lname = "CPU load",
+ .type = FIO_OPT_INT,
+ .off1 = offsetof(struct cpu_options, cpuload),
+ .help = "Use this percentage of CPU",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_INVALID,
+ },
+ {
+ .name = "cpuchunks",
+ .lname = "CPU chunk",
+ .type = FIO_OPT_INT,
+ .off1 = offsetof(struct cpu_options, cpucycle),
+ .help = "Length of the CPU burn cycles (usecs)",
+ .def = "50000",
+ .parent = "cpuload",
+ .hide = 1,
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_INVALID,
+ },
+ {
+ .name = "exit_on_io_done",
+ .lname = "Exit when IO threads are done",
+ .type = FIO_OPT_BOOL,
+ .off1 = offsetof(struct cpu_options, exit_io_done),
+ .help = "Exit when IO threads finish",
+ .def = "0",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_INVALID,
+ },
+ {
+ .name = NULL,
+ },
+};