Re: [PATCH] perf tools: report initial event parsing error

From: Jiri Olsa
Date: Mon Nov 11 2019 - 07:02:44 EST


On Fri, Nov 08, 2019 at 10:15:33AM -0800, Ian Rogers wrote:
> Record the first event parsing error and report. Implementing feedback
> from Jiri Olsa:
> https://lkml.org/lkml/2019/10/28/680
>
> An example error is:
>
> $ tools/perf/perf stat -e c/c/
> WARNING: multiple event parsing errors
> event syntax error: 'c/c/'
> \___ unknown term
>
> valid terms: event,filter_rem,filter_opc0,edge,filter_isoc,filter_tid,filter_loc,filter_nc,inv,umask,filter_opc1,tid_en,thresh,filter_all_op,filter_not_nm,filter_state,filter_nm,config,config1,config2,name,period,percore
>
> Initial error:
> event syntax error: 'c/c/'
> \___ Cannot find PMU `c'. Missing kernel support?

not sure where this got lost or if it was there before,
but the index should point to zero to have the 'arrow' aligned

jirka


---
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index a369bbc289b2..6bae9d6edc12 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1366,7 +1366,7 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
if (asprintf(&err_str,
"Cannot find PMU `%s'. Missing kernel support?",
name) >= 0)
- parse_events__handle_error(err, -1, err_str, NULL);
+ parse_events__handle_error(err, 0, err_str, NULL);
return -EINVAL;
}