From: David Goulet Date: Fri, 23 May 2014 18:25:06 +0000 (-0400) Subject: Fix: saturate verbosity level to 3 X-Git-Tag: v2.5.0-rc1~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=849e5b7b78004e931773838ab3fe1a19c843c01c;p=lttng-tools.git Fix: saturate verbosity level to 3 Fixes #748 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 93b08fcaa..ac03cf846 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -251,7 +251,10 @@ int set_option(int opt, const char *arg, const char *optname) if (arg) { lttng_opt_verbose = config_parse_value(arg); } else { - lttng_opt_verbose += 1; + /* Only 3 level of verbosity (-vvv). */ + if (lttng_opt_verbose < 3) { + lttng_opt_verbose += 1; + } } break; default: diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 1d218b170..4d700d1e5 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4238,7 +4238,10 @@ static int set_option(int opt, const char *arg, const char *optname) if (arg) { lttng_opt_verbose = config_parse_value(arg); } else { - lttng_opt_verbose += 1; + /* Only 3 level of verbosity (-vvv). */ + if (lttng_opt_verbose < 3) { + lttng_opt_verbose += 1; + } } break; case 'Z': diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 3227499f5..d4d40f077 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -437,7 +437,10 @@ static int parse_args(int argc, char **argv) ret = 0; goto end; case 'v': - lttng_opt_verbose += 1; + /* There is only 3 possible level of verbosity. (-vvv) */ + if (lttng_opt_verbose < 3) { + lttng_opt_verbose += 1; + } break; case 'q': lttng_opt_quiet = 1;