ioscheduler=str Attempt to switch the device hosting the file to the specified
io scheduler before running.
-cpuload=int If the job is a CPU cycle eater, attempt to use the specified
- percentage of CPU cycles.
-
-cpuchunks=int If the job is a CPU cycle eater, split the load into
- cycles of the given time. In microseconds.
-
disk_util=bool Generate disk utilization statistics, if the platform
supports it. Defaults to on.
enabled when polling for a minimum of 0 events (eg when
iodepth_batch_complete=0).
+[cpu] cpuload=int Attempt to use the specified percentage of CPU cycles.
+
+[cpu] cpuchunks=int Split the load into cycles of the given time. In
+ microseconds.
+
[netsplice] hostname=str
[net] hostname=str The host name or IP address to use for TCP or UDP based IO.
If the job is a TCP listener or UDP reader, the hostname is not
o->trim_zero = le32_to_cpu(top->trim_zero);
o->clat_percentiles = le32_to_cpu(top->clat_percentiles);
o->overwrite_plist = le32_to_cpu(top->overwrite_plist);
- o->cpuload = le32_to_cpu(top->cpuload);
- o->cpucycle = le32_to_cpu(top->cpucycle);
o->continue_on_error = le32_to_cpu(top->continue_on_error);
o->cgroup_weight = le32_to_cpu(top->cgroup_weight);
o->cgroup_nodelete = le32_to_cpu(top->cgroup_nodelete);
top->trim_zero = cpu_to_le32(o->trim_zero);
top->clat_percentiles = cpu_to_le32(o->clat_percentiles);
top->overwrite_plist = cpu_to_le32(o->overwrite_plist);
- top->cpuload = cpu_to_le32(o->cpuload);
- top->cpucycle = cpu_to_le32(o->cpucycle);
top->continue_on_error = cpu_to_le32(o->continue_on_error);
top->cgroup_weight = cpu_to_le32(o->cgroup_weight);
top->cgroup_nodelete = cpu_to_le32(o->cgroup_nodelete);
*/
#include "../fio.h"
+struct cpu_options {
+ struct thread_data *td;
+ unsigned int cpuload;
+ unsigned int cpucycle;
+};
+
+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_GENERAL,
+ .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_GENERAL,
+ .group = FIO_OPT_G_INVALID,
+ },
+ {
+ .name = NULL,
+ },
+};
+
+
static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u)
{
- usec_spin(td->o.cpucycle);
+ struct cpu_options *co = td->eo;
+
+ usec_spin(co->cpucycle);
return FIO_Q_COMPLETED;
}
static int fio_cpuio_init(struct thread_data *td)
{
struct thread_options *o = &td->o;
+ struct cpu_options *co = td->eo;
- if (!o->cpuload) {
+ if (!co->cpuload) {
td_vmsg(td, EINVAL, "cpu thread needs rate (cpuload=)","cpuio");
return 1;
}
- if (o->cpuload > 100)
- o->cpuload = 100;
+ if (co->cpuload > 100)
+ co->cpuload = 100;
/*
* set thinktime_sleep and thinktime_spin appropriately
*/
o->thinktime_blocks = 1;
o->thinktime_spin = 0;
- o->thinktime = (o->cpucycle * (100 - o->cpuload)) / o->cpuload;
+ o->thinktime = (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);
+
return 0;
}
.init = fio_cpuio_init,
.open_file = fio_cpuio_open,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_NOIO,
+ .options = options,
+ .option_struct_size = sizeof(struct cpu_options),
};
static void fio_init fio_cpuio_register(void)
used identically to normal parameters, with the caveat that when used on the
command line, the must come after the ioengine that defines them is selected.
.TP
+.BI (cpu)cpuload \fR=\fPint
+Attempt to use the specified percentage of CPU cycles.
+.TP
+.BI (cpu)cpuchunks \fR=\fPint
+Split the load into cycles of the given time. In microseconds.
+.TP
.BI (libaio)userspace_reap
Normally, with the libaio engine in use, fio will use
the io_getevents system call to reap newly returned events.
if (is_backend && !recursed)
fio_server_send_add_job(td);
- if (!strcmp(td->io_ops->name, "cpuio")) {
- log_info("%s: ioengine=cpu, cpuload=%u,"
- " cpucycle=%u\n", td->o.name,
- td->o.cpuload,
- td->o.cpucycle);
- } else {
+ if (!(td->io_ops->flags & FIO_NOIO)) {
char *c1, *c2, *c3, *c4;
c1 = fio_uint_to_kmg(td->o.min_bs[DDIR_READ]);
.category = FIO_OPT_C_FILE,
.group = FIO_OPT_G_INVALID,
},
- {
- .name = "cpuload",
- .lname = "CPU load",
- .type = FIO_OPT_INT,
- .off1 = td_var_offset(cpuload),
- .help = "Use this percentage of CPU",
- .category = FIO_OPT_C_GENERAL,
- .group = FIO_OPT_G_INVALID,
- },
- {
- .name = "cpuchunks",
- .lname = "CPU chunk",
- .type = FIO_OPT_INT,
- .off1 = td_var_offset(cpucycle),
- .help = "Length of the CPU burn cycles (usecs)",
- .def = "50000",
- .parent = "cpuload",
- .hide = 1,
- .category = FIO_OPT_C_GENERAL,
- .group = FIO_OPT_G_INVALID,
- },
#ifdef FIO_HAVE_CPU_AFFINITY
{
.name = "cpumask",
char *ioscheduler;
- /*
- * CPU "io" cycle burner
- */
- unsigned int cpuload;
- unsigned int cpucycle;
-
/*
* I/O Error handling
*/
uint8_t ioscheduler[FIO_TOP_STR_MAX];
- /*
- * CPU "io" cycle burner
- */
- uint32_t cpuload;
- uint32_t cpucycle;
-
/*
* I/O Error handling
*/