X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=ba22f785957d86c54523646807445f6db96053f6;hp=70b56e38f21b5dab4c1789234d3ee226acabaed5;hb=3e260a46ea9a8de224c3d0a29a608da3440f284a;hpb=6e5c4b8e46c95ca75e30e1110a0d24b2df9c47e9 diff --git a/init.c b/init.c index 70b56e38..ba22f785 100644 --- a/init.c +++ b/init.c @@ -629,6 +629,12 @@ static int fixup_options(struct thread_data *td) ret = 1; } + /* + * O_ATOMIC implies O_DIRECT + */ + if (td->o.oatomic) + td->o.odirect = 1; + return ret; } @@ -701,7 +707,10 @@ static void td_fill_rand_seeds_os(struct thread_data *td) 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) @@ -723,7 +732,9 @@ 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) @@ -910,6 +921,12 @@ static char *make_filename(char *buf, struct thread_options *o, 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 @@ -934,7 +951,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, /* * 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; } @@ -1030,20 +1047,31 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, 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); @@ -1118,9 +1146,9 @@ void add_job_opts(const char **o, int client_type) 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++; } @@ -1257,7 +1285,7 @@ int parse_jobs_ini(char *file, int is_buf, int stonewall_flag, int type) } /* - * Seperate multiple job files by a stonewall + * Separate multiple job files by a stonewall */ if (!global && stonewall) { td->o.stonewall = stonewall; @@ -1301,14 +1329,10 @@ int parse_jobs_ini(char *file, int is_buf, int stonewall_flag, int type) 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); } @@ -1358,7 +1382,7 @@ static void usage(const char *name) printf("%s [options] [job options] \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"); @@ -1458,6 +1482,10 @@ struct debug_level debug_levels[] = { .help = "Network logging", .shift = FD_NET, }, + { .name = "rate", + .help = "Rate logging", + .shift = FD_RATE, + }, { .name = NULL, }, }; @@ -1755,8 +1783,6 @@ int parse_cmd_line(int argc, char *argv[], int client_type) 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; } @@ -1930,7 +1956,7 @@ int parse_options(int argc, char *argv[]) fio_options_free(&def_thread); if (!thread_number) { - if (dump_cmdline || parse_only) + if (parse_dryrun()) return 0; if (exec_profile) return 0;