linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] libtraceevent: Increase libtraceevent logging when verbose
@ 2021-06-10  6:06 Ian Rogers
  2021-06-10 14:39 ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Ian Rogers @ 2021-06-10  6:06 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, linux-kernel, linux-trace-users,
	Tzvetomir Stoyanov, Steven Rostedt
  Cc: eranian, Ian Rogers

libtraceevent has added more levels of debug printout and with changes
like:
https://lore.kernel.org/linux-trace-devel/20210507095022.1079364-3-tz.stoyanov@gmail.com
previously generated output like "registering plugin" is no longer
displayed. This change makes it so that if perf's verbose debug output
is enabled then the debug and info libtraceevent messages can be
displayed.
As this API isn't present in the deprecated tools version of
libtracevent I'm uploading this as an RFC.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/util/debug.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index 2c06abf6dcd2..700828e92fe1 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -24,6 +24,7 @@
 #include "util/parse-sublevel-options.h"
 
 #include <linux/ctype.h>
+#include <traceevent/event-parse.h>
 
 int verbose;
 int debug_peo_args;
@@ -228,6 +229,13 @@ int perf_debug_option(const char *str)
 	/* Allow only verbose value in range (0, 10), otherwise set 0. */
 	verbose = (verbose < 0) || (verbose > 10) ? 0 : verbose;
 
+	if (verbose == 1)
+		tep_set_loglevel(TEP_LOG_INFO);
+	else if (verbose == 2)
+		tep_set_loglevel(TEP_LOG_DEBUG);
+	else if (verbose >= 3)
+		tep_set_loglevel(TEP_LOG_ALL);
+
 	return 0;
 }
 
-- 
2.32.0.272.g935e593368-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-10 20:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  6:06 [RFC PATCH] libtraceevent: Increase libtraceevent logging when verbose Ian Rogers
2021-06-10 14:39 ` Steven Rostedt
2021-06-10 18:50   ` Ian Rogers
2021-06-10 19:32     ` Steven Rostedt
2021-06-10 19:08   ` Jiri Olsa
2021-06-10 19:47     ` Steven Rostedt
2021-06-10 19:59     ` Steven Rostedt
2021-06-10 20:47       ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).