X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=c70f6a0a125549d073d7b273b68fde8a1ae2356e;hp=2da64ba89e1c0005f15b80a792efddaf0636e510;hb=a2e4a0937bff2e93121ee8b6202c5f858f10d6fa;hpb=6730b40f1f2f9a07ac6b28d39fba293fedb1f239 diff --git a/init.c b/init.c index 2da64ba8..c70f6a0a 100644 --- a/init.c +++ b/init.c @@ -837,7 +837,7 @@ static int fixup_options(struct thread_data *td) * Windows doesn't support O_DIRECT or O_SYNC with the _open interface, * so fail if we're passed those flags */ - if (td_ioengine_flagged(td, FIO_SYNCIO) && (td->o.odirect || td->o.sync_io)) { + if (td_ioengine_flagged(td, FIO_SYNCIO) && (o->odirect || o->sync_io)) { log_err("fio: Windows does not support direct or non-buffered io with" " the synchronous ioengines. Use the 'windowsaio' ioengine" " with 'direct=1' and 'iodepth=1' instead.\n"); @@ -855,16 +855,18 @@ static int fixup_options(struct thread_data *td) if (o->compress_percentage == 100) { o->zero_buffers = 1; o->compress_percentage = 0; - } else if (!fio_option_is_set(o, refill_buffers)) + } else if (!fio_option_is_set(o, refill_buffers)) { o->refill_buffers = 1; + td->flags |= TD_F_REFILL_BUFFERS; + } } /* * Using a non-uniform random distribution excludes usage of * a random map */ - if (td->o.random_distribution != FIO_RAND_DIST_RANDOM) - td->o.norandommap = 1; + if (o->random_distribution != FIO_RAND_DIST_RANDOM) + o->norandommap = 1; /* * If size is set but less than the min block size, complain @@ -878,16 +880,16 @@ static int fixup_options(struct thread_data *td) /* * O_ATOMIC implies O_DIRECT */ - if (td->o.oatomic) - td->o.odirect = 1; + if (o->oatomic) + o->odirect = 1; /* * If randseed is set, that overrides randrepeat */ - if (fio_option_is_set(&td->o, rand_seed)) - td->o.rand_repeatable = 0; + if (fio_option_is_set(o, rand_seed)) + o->rand_repeatable = 0; - if (td_ioengine_flagged(td, FIO_NOEXTEND) && td->o.file_append) { + if (td_ioengine_flagged(td, FIO_NOEXTEND) && o->file_append) { log_err("fio: can't append/extent with IO engine %s\n", td->io_ops->name); ret = 1; } @@ -902,10 +904,24 @@ static int fixup_options(struct thread_data *td) if (!td->loops) td->loops = 1; - if (td->o.block_error_hist && td->o.nr_files != 1) { + if (o->block_error_hist && o->nr_files != 1) { log_err("fio: block error histogram only available " "with a single file per job, but %d files " - "provided\n", td->o.nr_files); + "provided\n", o->nr_files); + ret = 1; + } + + if (fio_option_is_set(o, clat_percentiles) && + !fio_option_is_set(o, lat_percentiles)) { + o->lat_percentiles = !o->clat_percentiles; + } else if (fio_option_is_set(o, lat_percentiles) && + !fio_option_is_set(o, clat_percentiles)) { + o->clat_percentiles = !o->lat_percentiles; + } else if (fio_option_is_set(o, lat_percentiles) && + fio_option_is_set(o, clat_percentiles) && + o->lat_percentiles && o->clat_percentiles) { + log_err("fio: lat_percentiles and clat_percentiles are " + "mutually exclusive\n"); ret = 1; } @@ -1023,8 +1039,6 @@ void td_fill_rand_seeds(struct thread_data *td) */ int ioengine_load(struct thread_data *td) { - const char *engine; - if (!td->o.ioengine) { log_err("fio: internal fault, no IO engine specified\n"); return 1; @@ -1043,13 +1057,9 @@ int ioengine_load(struct thread_data *td) free_ioengine(td); } - /* - * Use ->ioengine_so_path if an external ioengine is specified. - */ - engine = td->o.ioengine_so_path ?: td->o.ioengine; - td->io_ops = load_ioengine(td, engine); + td->io_ops = load_ioengine(td); if (!td->io_ops) { - log_err("fio: failed to load engine %s\n", engine); + log_err("fio: failed to load engine\n"); return 1; } @@ -1407,6 +1417,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, td->mutex = fio_mutex_init(FIO_MUTEX_LOCKED); td->ts.clat_percentiles = o->clat_percentiles; + td->ts.lat_percentiles = o->lat_percentiles; td->ts.percentile_precision = o->percentile_precision; memcpy(td->ts.percentile_list, o->percentile_list, sizeof(o->percentile_list)); @@ -1578,14 +1589,14 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, char *c5 = NULL, *c6 = NULL; int i2p = is_power_of_2(o->kb_base); - c1 = num2str(o->min_bs[DDIR_READ], 4, 1, i2p, N2S_BYTE); - c2 = num2str(o->max_bs[DDIR_READ], 4, 1, i2p, N2S_BYTE); - c3 = num2str(o->min_bs[DDIR_WRITE], 4, 1, i2p, N2S_BYTE); - c4 = num2str(o->max_bs[DDIR_WRITE], 4, 1, i2p, N2S_BYTE); + c1 = num2str(o->min_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE); + c2 = num2str(o->max_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE); + c3 = num2str(o->min_bs[DDIR_WRITE], o->sig_figs, 1, i2p, N2S_BYTE); + c4 = num2str(o->max_bs[DDIR_WRITE], o->sig_figs, 1, i2p, N2S_BYTE); if (!o->bs_is_seq_rand) { - c5 = num2str(o->min_bs[DDIR_TRIM], 4, 1, i2p, N2S_BYTE); - c6 = num2str(o->max_bs[DDIR_TRIM], 4, 1, i2p, N2S_BYTE); + c5 = num2str(o->min_bs[DDIR_TRIM], o->sig_figs, 1, i2p, N2S_BYTE); + c6 = num2str(o->max_bs[DDIR_TRIM], o->sig_figs, 1, i2p, N2S_BYTE); } log_info("%s: (g=%d): rw=%s, ", td->o.name, @@ -2106,7 +2117,7 @@ static void usage(const char *name) printf(" --inflate-log=log\tInflate and output compressed log\n"); #endif printf(" --trigger-file=file\tExecute trigger cmd when file exists\n"); - printf(" --trigger-timeout=t\tExecute trigger af this time\n"); + printf(" --trigger-timeout=t\tExecute trigger at this time\n"); printf(" --trigger=cmd\t\tSet this command as local trigger\n"); printf(" --trigger-remote=cmd\tSet this command as remote trigger\n"); printf(" --aux-path=path\tUse this path for fio state generated files\n"); @@ -2714,6 +2725,11 @@ int parse_cmd_line(int argc, char *argv[], int client_type) exit_val = 1; break; } + if (val < 1000) { + log_err("fio: status interval too small\n"); + do_exit++; + exit_val = 1; + } status_interval = val / 1000; break; } @@ -2854,13 +2870,8 @@ int parse_options(int argc, char *argv[]) return 0; log_err("No job(s) defined\n\n"); - - if (!did_arg) { - usage(argv[0]); - return 1; - } - - return 0; + usage(argv[0]); + return 1; } if (output_format & FIO_OUTPUT_NORMAL)