Commit 316769f7 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf debug: Increase libtraceevent logging when verbose

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.

This change was previously posted:

  https://lore.kernel.org/linux-perf-users/20210923001024.550263-4-irogers@google.com/

and reverted:

  https://lore.kernel.org/linux-perf-users/20220109153446.160593-1-acme@kernel.org/

The previous failure was due to -Itools/lib being on the include path
and libtraceevent in tools/lib being version 1.1.0. This meant that when
LIBTRACEEVENT_VERSION was 1.3.0 the #if succeeded, but the header file
for libtraceevent (taken from tools/lib rather than the intended
/usr/include) was for version 1.1.0 and function definitions were
missing.

Since the previous issue the -Itools/lib include path has been
removed:

  https://lore.kernel.org/lkml/20221109184914.1357295-1-irogers@google.com/

As well as libtraceevent 1.1.0 has been removed from tools/lib:

  https://lore.kernel.org/lkml/20221130062935.2219247-1-irogers@google.com/Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Eelco Chaudron <echaudro@redhat.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Kim Phillips <kim.phillips@amd.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Link: https://lore.kernel.org/r/20230111070641.1728726-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1634bad3
...@@ -19,12 +19,19 @@ ...@@ -19,12 +19,19 @@
#include "debug.h" #include "debug.h"
#include "print_binary.h" #include "print_binary.h"
#include "target.h" #include "target.h"
#include "trace-event.h"
#include "ui/helpline.h" #include "ui/helpline.h"
#include "ui/ui.h" #include "ui/ui.h"
#include "util/parse-sublevel-options.h" #include "util/parse-sublevel-options.h"
#include <linux/ctype.h> #include <linux/ctype.h>
#ifdef HAVE_LIBTRACEEVENT
#include <traceevent/event-parse.h>
#else
#define LIBTRACEEVENT_VERSION 0
#endif
int verbose; int verbose;
int debug_peo_args; int debug_peo_args;
bool dump_trace = false, quiet = false; bool dump_trace = false, quiet = false;
...@@ -228,6 +235,14 @@ int perf_debug_option(const char *str) ...@@ -228,6 +235,14 @@ int perf_debug_option(const char *str)
/* Allow only verbose value in range (0, 10), otherwise set 0. */ /* Allow only verbose value in range (0, 10), otherwise set 0. */
verbose = (verbose < 0) || (verbose > 10) ? 0 : verbose; verbose = (verbose < 0) || (verbose > 10) ? 0 : verbose;
#if LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 3, 0)
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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment