static int fixup_options(struct thread_data *td)
{
struct thread_options *o = &td->o;
- int i, ret = 0;
+ int ret = 0;
#ifndef FIO_HAVE_PSHARED_MUTEX
if (!o->use_thread) {
ret = 1;
}
+ /*
+ * O_ATOMIC implies O_DIRECT
+ */
+ if (td->o.oatomic)
+ td->o.odirect = 1;
+
+ /*
+ * If randseed is set, that overrides randrepeat
+ */
+ if (td->o.rand_seed)
+ td->o.rand_repeatable = 0;
+
return ret;
}
unsigned long seed;
unsigned int i;
- if (!td->o.rand_repeatable)
+ if (!td->o.rand_repeatable && !td->o.rand_seed)
return init_random_state(td, td->rand_seeds, sizeof(td->rand_seeds));
- for (seed = 0x89, i = 0; i < 4; i++)
+ if (!td->o.rand_seed)
+ seed = 0x89;
+ else
+ seed = td->o.rand_seed;
+
+ for (i = 0; i < 4; i++)
seed *= 0x9e370001UL;
for (i = 0; i < FIO_RAND_NR_OFFS; i++) {
return buf;
}
+
+int parse_dryrun(void)
+{
+ return dump_cmdline || parse_only;
+}
+
/*
* 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 we are just dumping the output command line, don't add the job
*/
- if (dump_cmdline || parse_only) {
+ if (parse_dryrun()) {
put_job(td);
return 0;
}
fio_server_send_add_job(td);
if (!(td->io_ops->flags & FIO_NOIO)) {
- char *c1, *c2, *c3, *c4, *c5, *c6;
+ char *c1, *c2, *c3, *c4;
+ char *c5 = NULL, *c6 = NULL;
c1 = fio_uint_to_kmg(o->min_bs[DDIR_READ]);
c2 = fio_uint_to_kmg(o->max_bs[DDIR_READ]);
c3 = fio_uint_to_kmg(o->min_bs[DDIR_WRITE]);
c4 = fio_uint_to_kmg(o->max_bs[DDIR_WRITE]);
- c5 = fio_uint_to_kmg(o->min_bs[DDIR_TRIM]);
- c6 = fio_uint_to_kmg(o->max_bs[DDIR_TRIM]);
-
- log_info("%s: (g=%d): rw=%s, bs=%s-%s/%s-%s/%s-%s,"
- " ioengine=%s, iodepth=%u\n",
- td->o.name, td->groupid,
- ddir_str(o->td_ddir),
- c1, c2, c3, c4, c5, c6,
+
+ if (!o->bs_is_seq_rand) {
+ c5 = fio_uint_to_kmg(o->min_bs[DDIR_TRIM]);
+ c6 = fio_uint_to_kmg(o->max_bs[DDIR_TRIM]);
+ }
+
+ log_info("%s: (g=%d): rw=%s, ", td->o.name,
+ td->groupid,
+ ddir_str(o->td_ddir));
+
+ if (o->bs_is_seq_rand)
+ log_info("bs(seq/rand)=%s-%s/%s-%s, ",
+ c1, c2, c3, c4);
+ else
+ log_info("bs=%s-%s/%s-%s/%s-%s, ",
+ c1, c2, c3, c4, c5, c6);
+
+ log_info("ioengine=%s, iodepth=%u\n",
td->io_ops->name, o->iodepth);
free(c1);
td = get_new_job(0, td_parent, 0);
}
if (in_global)
- fio_options_parse(td_parent, (char **) &o[i], 1);
+ fio_options_parse(td_parent, (char **) &o[i], 1, 0);
else
- fio_options_parse(td, (char **) &o[i], 1);
+ fio_options_parse(td, (char **) &o[i], 1, 0);
i++;
}
}
/*
- * Seperate multiple job files by a stonewall
+ * Separate multiple job files by a stonewall
*/
if (!global && stonewall) {
td->o.stonewall = stonewall;
num_opts++;
}
- ret = fio_options_parse(td, opts, num_opts);
- if (!ret) {
- if (dump_cmdline)
- for (i = 0; i < num_opts; i++)
- log_info("--%s ", opts[i]);
-
+ ret = fio_options_parse(td, opts, num_opts, dump_cmdline);
+ if (!ret)
ret = add_job(td, name, 0, 0, type);
- } else {
+ else {
log_err("fio: job %s dropped\n", name);
put_job(td);
}
printf("%s [options] [job options] <job file(s)>\n", name);
printf(" --debug=options\tEnable debug logging. May be one/more of:\n"
"\t\t\tprocess,file,io,mem,blktrace,verify,random,parse,\n"
- "\t\t\tdiskutil,job,mutex,profile,time,net\n");
+ "\t\t\tdiskutil,job,mutex,profile,time,net,rate\n");
printf(" --parse-only\t\tParse options only, don't start any IO\n");
printf(" --output\t\tWrite output to file\n");
printf(" --runtime\t\tRuntime in seconds\n");
.help = "Network logging",
.shift = FD_NET,
},
+ { .name = "rate",
+ .help = "Rate logging",
+ .shift = FD_RATE,
+ },
{ .name = NULL, },
};
fio_options_free(&def_thread);
if (!thread_number) {
- if (dump_cmdline || parse_only)
+ if (parse_dryrun())
return 0;
if (exec_profile)
return 0;