Skip to content

Commit

Permalink
perf: Log error if mandatory parameters are missing
Browse files Browse the repository at this point in the history
 If "-o" (block size), "-q" (query size), "-t" (time in seconds),
 "-w" (io pattern) is absent, per doesn't report
 any message.

Signed-off-by: Ivan Betsis <[email protected]>
Signed-off-by: Alla Kiseleva <[email protected]>
  • Loading branch information
Ivan Betsis committed Jan 14, 2020
1 parent d439832 commit 40a49f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/nvme/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,18 +1337,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;
}
Expand Down

0 comments on commit 40a49f1

Please sign in to comment.