Skip to content

Commit f034fc5

Browse files
ahunter6acmel
authored andcommitted
perf tools: Fix misleading add event PMU debug message
Fix incorrect debug message: Attempting to add event pmu 'intel_pt' with '' that may result in non-fatal errors which always appears with perf record -vv and intel_pt e.g. perf record -vv -e intel_pt//u uname The message is incorrect because there will never be non-fatal errors. Suppress the message if the PMU is 'selectable' i.e. meant to be selected directly as an event. Fixes: 4ac22b4 ("perf parse-events: Make add PMU verbose output clearer") Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Link: http://lore.kernel.org/lkml/20220411061758.2458417-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent a199448 commit f034fc5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tools/perf/util/parse-events.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,9 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
15231523
bool use_uncore_alias;
15241524
LIST_HEAD(config_terms);
15251525

1526-
if (verbose > 1) {
1526+
pmu = parse_state->fake_pmu ?: perf_pmu__find(name);
1527+
1528+
if (verbose > 1 && !(pmu && pmu->selectable)) {
15271529
fprintf(stderr, "Attempting to add event pmu '%s' with '",
15281530
name);
15291531
if (head_config) {
@@ -1536,7 +1538,6 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
15361538
fprintf(stderr, "' that may result in non-fatal errors\n");
15371539
}
15381540

1539-
pmu = parse_state->fake_pmu ?: perf_pmu__find(name);
15401541
if (!pmu) {
15411542
char *err_str;
15421543

0 commit comments

Comments
 (0)