From 9a21cb5772ca3bbc9dd0e5e2ff12772fb6e75267 Mon Sep 17 00:00:00 2001 From: Ivan Betsis Date: Mon, 13 Jan 2020 14:28:26 +0200 Subject: [PATCH] perf: Log error if mandatory parameters are missing If "-o" (block size), "-q" (query size), "-t" (time in seconds), "-w" (io pattern) is absent, per doesn't report any message. Change-Id: Icfe8e7136e41b9e4698e0553def8f8f386742e56 Signed-off-by: Ivan Betsis Signed-off-by: Alla Kiseleva Signed-off-by: Alexey Marchuk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/481706 Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins --- examples/nvme/perf/perf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 0691871167..df6ee7e5aa 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -1719,18 +1719,22 @@ parse_args(int argc, char **argv) } if (!g_queue_depth) { + fprintf(stderr, "missing -q (queue size) operand\n"); usage(argv[0]); return 1; } if (!g_io_size_bytes) { + fprintf(stderr, "missing -o (block size) operand\n"); usage(argv[0]); return 1; } if (!workload_type) { + fprintf(stderr, "missing -w (io pattern type) operand\n"); usage(argv[0]); return 1; } if (!g_time_in_sec) { + fprintf(stderr, "missing -t (test time in seconds) operand\n"); usage(argv[0]); return 1; }