perf tools: Fix misleading add event pmu debug message
Adrian Hunter
reviewerPATCH 1/1 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.
--- tools/perf/util/parse-events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/util/parse-events.c +3 -2
@@ -1523,7 +1523,9 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,bool use_uncore_alias;LIST_HEAD (config_terms); -if (verbose >1 ) { + pmu = parse_state->fake_pmu ?:perf_pmu__find (name); + +if (verbose >1 && !(pmu && pmu->selectable)) {fprintf (stderr,"Attempting to add event pmu '%s' with '" , name);if (head_config) {
@@ -1536,7 +1538,6 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,fprintf (stderr,"' that may result in non-fatal errors\n" ); } - pmu = parse_state->fake_pmu ?:perf_pmu__find (name);if (!pmu) {char *err_str;
Signature · 1 line
2.25.1
Em Mon, Apr 11, 2022 at 09:17:58AM +0300, Adrian Hunter escreveu:
Quoted 5 lines
Fix incorrect debug message:
Attempting to add event pmu '
intel_pt' with '' that may result in non-fatal errors
Quoted 8 lines
which always appears with perf record -vv and
intel_pte.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.
Thanks, applied.
- Arnaldo
Quoted 31 lines
Fixes 4ac22b484d4c79 ("perf parse-events: Make add PMU verbose output clearer")Signed-off-by Adrian Hunter <[email protected]>--- tools/perf/util/parse-events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tools/perf/util/parse-events.c +3
-2@@ -1523,7 +1523,9 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,bool use_uncore_alias;LIST_HEAD (config_terms); -if (verbose >1 ) { + pmu = parse_state->fake_pmu ?:perf_pmu__find (name); + +if (verbose >1 && !(pmu && pmu->selectable)) {fprintf (stderr,"Attempting to add event pmu '%s' with '" , name);if (head_config) {@@ -1536,7 +1538,6 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,fprintf (stderr,"' that may result in non-fatal errors\n" ); } - pmu = parse_state->fake_pmu ?:perf_pmu__find (name);if (!pmu) {char *err_str;Signature · 1 line
2.25.1
Signature · 1 line
- Arnaldo