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;
}
td->rand_seeds[FIO_RAND_BLOCK_OFF] = FIO_RANDSEED * td->thread_number;
os_random_seed(td->rand_seeds[FIO_RAND_BLOCK_OFF], &td->random_state);
- os_random_seed(td->rand_seeds[FIO_RAND_SEQ_RAND_OFF], &td->seq_rand_state);
+
+ os_random_seed(td->rand_seeds[FIO_RAND_SEQ_RAND_READ_OFF], &td->seq_rand_state[DDIR_READ]);
+ os_random_seed(td->rand_seeds[FIO_RAND_SEQ_RAND_WRITE_OFF], &td->seq_rand_state[DDIR_WRITE]);
+ os_random_seed(td->rand_seeds[FIO_RAND_SEQ_RAND_TRIM_OFF], &td->seq_rand_state[DDIR_TRIM]);
}
static void td_fill_rand_seeds_internal(struct thread_data *td)
td->rand_seeds[FIO_RAND_BLOCK_OFF] = FIO_RANDSEED * td->thread_number;
init_rand_seed(&td->__random_state, td->rand_seeds[FIO_RAND_BLOCK_OFF]);
- init_rand_seed(&td->__seq_rand_state, td->rand_seeds[FIO_RAND_SEQ_RAND_OFF]);
+ init_rand_seed(&td->__seq_rand_state[DDIR_READ], td->rand_seeds[FIO_RAND_SEQ_RAND_READ_OFF]);
+ init_rand_seed(&td->__seq_rand_state[DDIR_WRITE], td->rand_seeds[FIO_RAND_SEQ_RAND_WRITE_OFF]);
+ init_rand_seed(&td->__seq_rand_state[DDIR_TRIM], td->rand_seeds[FIO_RAND_SEQ_RAND_TRIM_OFF]);
}
void td_fill_rand_seeds(struct thread_data *td)
*/
if (td->io_ops)
return 0;
+ if (!td->o.ioengine) {
+ log_err("fio: internal fault, no IO engine specified\n");
+ return 1;
+ }
engine = get_engine_name(td->o.ioengine);
td->io_ops = load_ioengine(td, engine);
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, },
};
case FIO_GETOPT_IOENGINE: {
const char *opt = l_opts[lidx].name;
char *val = optarg;
- opt = l_opts[lidx].name;
- val = optarg;
ret = fio_cmd_ioengine_option_parse(td, opt, val);
break;
}
break;
}
- if (do_exit) {
- if (exit_val && !(is_backend || nr_clients))
- exit(exit_val);
- }
+ if (do_exit && !(is_backend || nr_clients))
+ exit(exit_val);
if (nr_clients && fio_clients_connect()) {
do_exit++;
fio_options_free(&def_thread);
if (!thread_number) {
- if (dump_cmdline || parse_only)
+ if (parse_dryrun())
return 0;
if (exec_profile)
return 0;