mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
libtraceevent: Increase libtraceevent logging when verbose
libtraceevent has added more levels of debug printout and with changes like: https://lore.kernel.org/linux-trace-devel/[email protected] 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. The code is conditionally enabled based on the libtraceevent version as discussed in the RFC: https://lore.kernel.org/lkml/[email protected]/ v2. Is a rebase and handles the case of building without LIBTRACEEVENT_DYNAMIC. Signed-off-by: Ian Rogers <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Steven Rostedt (VMware) <[email protected]> Cc: Tzvetomir Stoyanov (VMware) <[email protected]> Cc: [email protected] Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
1 parent
359cad09e4
commit
08efcb4a63
1 file changed
+19
@@ -24,6 +24,16 @@
|
||||
#include "util/parse-sublevel-options.h"
|
||||
|
||||
#include <linux/ctype.h>
|
||||
#include <traceevent/event-parse.h>
|
||||
|
||||
#define MAKE_LIBTRACEEVENT_VERSION(a, b, c) ((a)*255*255+(b)*255+(c))
|
||||
#ifndef LIBTRACEEVENT_VERSION
|
||||
/*
|
||||
* If LIBTRACEEVENT_VERSION wasn't computed then set to version 1.1.0 that ships
|
||||
* with the Linux kernel tools.
|
||||
*/
|
||||
#define LIBTRACEEVENT_VERSION MAKE_LIBTRACEEVENT_VERSION(1, 1, 0)
|
||||
#endif
|
||||
|
||||
int verbose;
|
||||
int debug_peo_args;
|
||||
@@ -228,6 +238,15 @@ 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 MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <= LIBTRACEEVENT_VERSION
|
||||
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);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user