From: Brian Behlendorf Date: Fri, 7 Dec 2012 17:53:55 +0000 (-0800) Subject: splat command verbose behavior X-Git-Tag: spl-0.6.0-rc13~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=576ec6aac4a4a15754892824643cedb30d652c39;p=spl splat command verbose behavior The splat command takes a verbose option which when set prints the internal debug log for every test. This is helpful when tracking down a common failure, but for a rare failure the volume of log data is distracting. Therefore, the verbose option has been adjusted to allow only printing the debug log on failure. The legacy behavior is still available by specifying the verbose option twice. For example: $ splat -t all:all # Never print the debug log $ splat -v -t all:all # Only print debug log on failure $ splat -vv -t all:all # Always print the debug log Signed-off-by: Brian Behlendorf --- diff --git a/cmd/splat.c b/cmd/splat.c index 2fa0c50..f4caa56 100644 --- a/cmd/splat.c +++ b/cmd/splat.c @@ -431,7 +431,8 @@ static int test_run(cmd_args_t *args, test_t *test) fflush(stdout); free(cmd); - if (args->args_verbose) { + if ((args->args_verbose == 1 && rc) || + (args->args_verbose >= 2)) { if ((rc = read(splatctl_fd, splat_buffer, splat_buffer_size - 1)) < 0) { fprintf(stdout, "Error reading results: %d\n", rc);