From: Jens Axboe Date: Thu, 7 Mar 2013 10:31:20 +0000 (+0100) Subject: Add --parse-only command line option X-Git-Tag: fio-2.0.15~42 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=111e032d60f2341cfe09accbfcf25ec81b9251e0 Add --parse-only command line option Sometimes it's useful just being able to verify whether a job config is valid or not, without actually starting any jobs. Signed-off-by: Jens Axboe --- diff --git a/README b/README index b662e714..317ddec6 100644 --- a/README +++ b/README @@ -134,6 +134,7 @@ Command line $ fio --debug Enable some debugging options (see below) + --parse-only Parse options only, don't start any IO --output Write output to file --runtime Runtime in seconds --latency-log Generate per-job latency logs diff --git a/init.c b/init.c index 32da42c5..c7226887 100644 --- a/init.c +++ b/init.c @@ -34,6 +34,7 @@ static char **ini_file; static int max_jobs = FIO_MAX_JOBS; static int dump_cmdline; static int def_timeout; +static int parse_only; static struct thread_data def_thread; struct thread_data *threads = NULL; @@ -150,6 +151,11 @@ static struct option l_opts[FIO_NR_OPTIONS] = { .has_arg = required_argument, .val = 'd' | FIO_CLIENT_FLAG, }, + { + .name = (char *) "parse-only", + .has_arg = no_argument, + .val = 'P' | FIO_CLIENT_FLAG, + }, { .name = (char *) "section", .has_arg = required_argument, @@ -817,7 +823,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) { + if (dump_cmdline || parse_only) { put_job(td); return 0; } @@ -1251,6 +1257,7 @@ static void usage(const char *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"); + 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"); printf(" --latency-log\t\tGenerate per-job latency logs\n"); @@ -1528,6 +1535,9 @@ int parse_cmd_line(int argc, char *argv[]) if (set_debug(optarg)) do_exit++; break; + case 'P': + parse_only = 1; + break; case 'x': { size_t new_size; @@ -1738,7 +1748,7 @@ int parse_options(int argc, char *argv[]) fio_options_free(&def_thread); if (!thread_number) { - if (dump_cmdline) + if (dump_cmdline || parse_only) return 0; if (exec_profile) return 0;