From 849e5b7b78004e931773838ab3fe1a19c843c01c Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 23 May 2014 14:25:06 -0400 Subject: [PATCH] Fix: saturate verbosity level to 3 Fixes #748 Signed-off-by: David Goulet --- src/bin/lttng-relayd/main.c | 5 ++++- src/bin/lttng-sessiond/main.c | 5 ++++- src/bin/lttng/lttng.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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; -- 2.34.1