All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: <linux-trace-devel@vger.kernel.org>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Subject: [PATCH 3/3] trace-cmd: Do not enforce upper limit of verbose id
Date: Fri, 25 Jun 2021 16:15:11 -0400	[thread overview]
Message-ID: <20210625201511.1206465-4-rostedt@goodmis.org> (raw)
In-Reply-To: <20210625201511.1206465-1-rostedt@goodmis.org>

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Applications that have a "verbose" option, do not usually set an upper
limit of what can be passed in. If the max is -V6, trace-cmd should not
error if someone passes in -V7. The way this is handled, is just set the
verbosity to the highest level if the number supplied is above the highest
level.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tracecmd/trace-cmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tracecmd/trace-cmd.c b/tracecmd/trace-cmd.c
index 7f5d1ffd..9fc126e4 100644
--- a/tracecmd/trace-cmd.c
+++ b/tracecmd/trace-cmd.c
@@ -68,7 +68,9 @@ int trace_set_verbose(char *level)
 
 	if (isdigit(level[0])) {
 		id = atoi(level);
-		if (id >= TEP_LOG_NONE && id <= TEP_LOG_ALL) {
+		if (id >= TEP_LOG_NONE) {
+			if (id > TEP_LOG_ALL)
+				id = TEP_LOG_ALL;
 			tracecmd_set_loglevel(id);
 			return 0;
 		}
-- 
2.30.2


      parent reply	other threads:[~2021-06-25 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 20:15 [PATCH 0/3] trace-cmd: Update verbose logic Steven Rostedt
2021-06-25 20:15 ` [PATCH 1/3] trace-cmd: Do not require --verbose to have an argument Steven Rostedt
2021-06-25 20:15 ` [PATCH 2/3] trace-cmd report: Have -V take an optional argument Steven Rostedt
2021-06-25 20:15 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210625201511.1206465-4-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.