static int str_mem_cb(void *, const char *);
static int str_verify_cb(void *, const char *);
static int str_lockmem_cb(void *, unsigned long *);
+#ifdef FIO_HAVE_IOPRIO
static int str_prio_cb(void *, unsigned int *);
static int str_prioclass_cb(void *, unsigned int *);
+#endif
static int str_exitall_cb(void);
static int str_cpumask_cb(void *, unsigned int *);
.name = "bs",
.type = FIO_OPT_STR_VAL_INT,
.off1 = td_var_offset(bs[DDIR_READ]),
- },
- {
- .name = "read_bs",
- .type = FIO_OPT_STR_VAL_INT,
- .off1 = td_var_offset(bs[DDIR_READ]),
- },
- {
- .name = "write_bs",
- .type = FIO_OPT_STR_VAL_INT,
- .off1 = td_var_offset(bs[DDIR_WRITE]),
+ .off2 = td_var_offset(bs[DDIR_WRITE]),
},
{
.name = "offset",
.type = FIO_OPT_RANGE,
.off1 = td_var_offset(min_bs[DDIR_READ]),
.off2 = td_var_offset(max_bs[DDIR_READ]),
- },
- {
- .name = "read_bsrange",
- .type = FIO_OPT_RANGE,
- .off1 = td_var_offset(min_bs[DDIR_READ]),
- .off2 = td_var_offset(max_bs[DDIR_READ]),
- },
- {
- .name = "write_bsrange",
- .type = FIO_OPT_RANGE,
- .off1 = td_var_offset(min_bs[DDIR_WRITE]),
- .off2 = td_var_offset(max_bs[DDIR_WRITE]),
+ .off3 = td_var_offset(min_bs[DDIR_WRITE]),
+ .off4 = td_var_offset(max_bs[DDIR_WRITE]),
},
{
.name = "nrfiles",
static int def_timeout = DEF_TIMEOUT;
-static char fio_version_string[] = "fio 1.7";
+static char fio_version_string[] = "fio 1.8";
static char **ini_file;
static int max_jobs = MAX_JOBS;
if (td_read(td) || td_rw(td))
td->overwrite = 1;
- if (td->bs[DDIR_READ] != DEF_BS)
- td->bs[DDIR_WRITE] = td->bs[DDIR_READ];
if (!td->min_bs[DDIR_READ])
td->min_bs[DDIR_READ]= td->bs[DDIR_READ];
if (!td->max_bs[DDIR_READ])
log_err("fio: bs_unaligned may not work with raw io\n");
}
+/*
+ * This function leaks the buffer
+ */
+static char *to_kmg(unsigned int val)
+{
+ char *buf = malloc(32);
+ char post[] = { 0, 'K', 'M', 'G', 'P', -1 };
+ char *p = post;
+
+ while (*p != -1) {
+ if (val & 1023)
+ break;
+
+ val >>= 10;
+ p++;
+ }
+
+ snprintf(buf, 31, "%u%c", val, *p);
+ return buf;
+}
+
/*
* Adds a job to the list of things todo. Sanitizes the various options
* to make sure we don't have conflicts, and initializes various
if (!job_add_num) {
if (td->io_ops->flags & FIO_CPUIO)
fprintf(f_out, "%s: ioengine=cpu, cpuload=%u, cpucycle=%u\n", td->name, td->cpuload, td->cpucycle);
- else
- fprintf(f_out, "%s: (g=%d): rw=%s, odir=%d, bs=%d-%d/%d-%d, rate=%d, ioengine=%s, iodepth=%d\n", td->name, td->groupid, ddir_str[ddir], td->odirect, td->min_bs[DDIR_READ], td->max_bs[DDIR_READ], td->min_bs[DDIR_WRITE], td->max_bs[DDIR_WRITE], td->rate, td->io_ops->name, td->iodepth);
+ else {
+ char *c1, *c2, *c3, *c4;
+
+ c1 = to_kmg(td->min_bs[DDIR_READ]);
+ c2 = to_kmg(td->max_bs[DDIR_READ]);
+ c3 = to_kmg(td->min_bs[DDIR_WRITE]);
+ c4 = to_kmg(td->max_bs[DDIR_WRITE]);
+
+ fprintf(f_out, "%s: (g=%d): rw=%s, odir=%d, bs=%s-%s/%s-%s, rate=%d, ioengine=%s, iodepth=%d\n", td->name, td->groupid, ddir_str[ddir], td->odirect, c1, c2, c3, c4, td->rate, td->io_ops->name, td->iodepth);
+
+ free(c1);
+ free(c2);
+ free(c3);
+ free(c4);
+ }
} else if (job_add_num == 1)
fprintf(f_out, "...\n");
}
return 0;
}
+#ifdef FIO_HAVE_IOPRIO
static int str_prioclass_cb(void *data, unsigned int *val)
{
struct thread_data *td = data;
td->ioprio |= *val;
return 0;
}
+#endif
static int str_exitall_cb(void)
{