X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=init.c;h=f6a8056a2d0791b60b9ddc1d3b6f9968e1eb0c16;hb=5787d4621d3f2896bcdd3c8cd5577efcf7baaf72;hp=f983dbbb6d988328b0d2b3cceb22b259b14f2c07;hpb=3c5bd932e7a73e5515ef7ef70df1cb998ce33d54;p=fio.git diff --git a/init.c b/init.c index f983dbbb..f6a8056a 100644 --- a/init.c +++ b/init.c @@ -1452,6 +1452,26 @@ static bool wait_for_ok(const char *jobname, struct thread_options *o) return true; } +static int verify_per_group_options(struct thread_data *td, const char *jobname) +{ + struct thread_data *td2; + int i; + + for_each_td(td2, i) { + if (td->groupid != td2->groupid) + continue; + + if (td->o.stats && + td->o.lat_percentiles != td2->o.lat_percentiles) { + log_err("fio: lat_percentiles in job: %s differs from group\n", + jobname); + return 1; + } + } + + return 0; +} + /* * Treat an empty log file name the same as a one not given */ @@ -1521,7 +1541,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, if (fixup_options(td)) goto err; - if (init_dedupe_working_set_seeds(td)) + if (!td->o.dedupe_global && init_dedupe_working_set_seeds(td, 0)) goto err; /* @@ -1556,7 +1576,14 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, td->ts.sig_figs = o->sig_figs; init_thread_stat_min_vals(&td->ts); - td->ddir_seq_nr = o->ddir_seq_nr; + + /* + * td->>ddir_seq_nr needs to be initialized to 1, NOT o->ddir_seq_nr, + * so that get_next_offset gets a new random offset the first time it + * is called, instead of keeping an initial offset of 0 for the first + * nr-1 calls + */ + td->ddir_seq_nr = 1; if ((o->stonewall || o->new_group) && prev_group_jobs) { prev_group_jobs = 0; @@ -1570,6 +1597,10 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, td->groupid = groupid; prev_group_jobs++; + if (td->o.group_reporting && prev_group_jobs > 1 && + verify_per_group_options(td, jobname)) + goto err; + if (setup_rate(td)) goto err; @@ -2154,6 +2185,10 @@ static int __parse_jobs_ini(struct thread_data *td, i++; } + free(job_sections); + job_sections = NULL; + nr_job_sections = 0; + free(opts); out: free(string); @@ -2234,7 +2269,7 @@ static void usage(const char *name) printf(" --minimal\t\tMinimal (terse) output\n"); printf(" --output-format=type\tOutput format (terse,json,json+,normal)\n"); printf(" --terse-version=type\tSet terse version output format" - " (default 3, or 2 or 4)\n"); + " (default 3, or 2 or 4 or 5)\n"); printf(" --version\t\tPrint version info and exit\n"); printf(" --help\t\tPrint this page\n"); printf(" --cpuclock-test\tPerform test/validation of CPU clock\n"); @@ -2775,6 +2810,15 @@ int parse_cmd_line(int argc, char *argv[], int client_type) break; ret = fio_cmd_ioengine_option_parse(td, opt, val); + + if (ret) { + if (td) { + put_job(td); + td = NULL; + } + do_exit++; + exit_val = 1; + } break; } case 'w': @@ -2955,7 +2999,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type) log_err("%s: unrecognized option '%s'\n", argv[0], argv[optind - 1]); show_closest_option(argv[optind - 1]); - fallthrough; + fio_fallthrough; default: do_exit++; exit_val = 1;