All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 7/7] trace-cmd dump: Add --verbose
Date: Wed, 28 Apr 2021 10:46:30 +0300	[thread overview]
Message-ID: <20210428074630.757694-8-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com>

Add new "trace-cmd dump --verbose" argument for setting the desired
log level.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 Documentation/trace-cmd/trace-cmd-dump.1.txt | 8 ++++++++
 tracecmd/trace-dump.c                        | 6 ++++++
 tracecmd/trace-usage.c                       | 1 +
 3 files changed, 15 insertions(+)

diff --git a/Documentation/trace-cmd/trace-cmd-dump.1.txt b/Documentation/trace-cmd/trace-cmd-dump.1.txt
index 0f8626fa..b1a3f90d 100644
--- a/Documentation/trace-cmd/trace-cmd-dump.1.txt
+++ b/Documentation/trace-cmd/trace-cmd-dump.1.txt
@@ -52,6 +52,14 @@ OPTIONS
     Print all meta data from the file.
 *--help*::
     Print usage information.
+*--verbose* 'level'::
+     Set the log level. Supported log levels are "none", "critical", "error", "warning",
+     "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log
+     level to specific value enables all logs from that and all previous levels.
+
+     Example: enable all critical, error and warning logs
+
+      trace-cmd report --verbose warning
 
 EXAMPLES
 --------
diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c
index 3f56f65a..5c5447bc 100644
--- a/tracecmd/trace-dump.c
+++ b/tracecmd/trace-dump.c
@@ -678,6 +678,7 @@ static void dump_file(const char *file)
 }
 
 enum {
+	OPT_verbose	= 242,
 	OPT_clock	= 243,
 	OPT_all		= 244,
 	OPT_summary	= 245,
@@ -722,6 +723,7 @@ void trace_dump(int argc, char **argv)
 			{"clock", no_argument, NULL, OPT_clock},
 			{"validate", no_argument, NULL, 'v'},
 			{"help", no_argument, NULL, '?'},
+			{"verbose", required_argument, NULL, OPT_verbose},
 			{NULL, 0, NULL, 0}
 		};
 
@@ -778,6 +780,10 @@ void trace_dump(int argc, char **argv)
 		case OPT_clock:
 			verbosity |= CLOCK;
 			break;
+		case OPT_verbose:
+			if (trace_set_verbose(optarg) < 0)
+				die("invalid verbose level %s", optarg);
+			break;
 		default:
 			usage(argv);
 		}
diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c
index 8a7e8c7b..1fc11ac3 100644
--- a/tracecmd/trace-usage.c
+++ b/tracecmd/trace-usage.c
@@ -393,6 +393,7 @@ static struct usage_help usage_help[] = {
 		"          --flyrecord information of offset and count of recorded events per CPU\n"
 		"          --clock trace clock, saved in the file\n"
 		"          -h, --help show usage information\n"
+		"          --verbose 'level' Set the desired log level\n"
 	},
 	{
 		NULL, NULL, NULL
-- 
2.30.2


      parent reply	other threads:[~2021-04-28  7:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28  7:46 [PATCH 0/7] Add --verbose option to bunch of trace-cmd commands Tzvetomir Stoyanov (VMware)
2021-04-28  7:46 ` [PATCH 1/7] trace-cmd report: Add --verbose Tzvetomir Stoyanov (VMware)
2021-04-28  7:46 ` [PATCH 2/7] trace-cmd agent: " Tzvetomir Stoyanov (VMware)
2021-04-28  7:46 ` [PATCH 3/7] trace-cmd check-events: " Tzvetomir Stoyanov (VMware)
2021-04-28  7:46 ` [PATCH 4/7] trace-cmd: Add --verbose to bunch of trace-cmd commands Tzvetomir Stoyanov (VMware)
2021-04-28  7:46 ` [PATCH 5/7] trace-cmd listen: Add --verbose Tzvetomir Stoyanov (VMware)
2021-04-28  7:46 ` [PATCH 6/7] trace-cmd stack: " Tzvetomir Stoyanov (VMware)
2021-04-28  7:46 ` Tzvetomir Stoyanov (VMware) [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=20210428074630.757694-8-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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.