[PATCH 0/9] perf tools: Report event parsing errors

Jiri Olsa
2015-04-22T19:11:07Z

hi,
adding support to report error from event string parsing.

v1 changes (from RFC):
- display list of allowed terms for pmu event error [Ingo]
- changing 'invalid or unsupported event' string into
'event syntax error' for cases we know the precise error

This patchset contains support for standard parsing errors
and more logic to recognize tracepoint and 'pmu//' terms,
like:

$ sudo perf record -e 'sched:krava' ls
event syntax error: 'sched:krava'
\___ unknown tracepoint
...

$ perf record -e 'cpu/even=0x1/' ls
event syntax error: 'cpu/even=0x1/'
\___ unknown term

valid terms: pc,any,inv,edge,cmask,event,in_tx,ldlat,umask,in_tx_cp,offcore_rsp,config,config1,config2..
...

$ perf record -e cycles,cache-mises ls
event syntax error: '..es,cache-mises'
\___ parser error
...

Changes are also reachable in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/event_parse_error

thanks
jirka

---
Jiri Olsa (9):
perf tools: Add parse_events_error interface
perf tools: Add flex support for parse_events_error
perf tools: Always bail out when config_attr function fails
perf tools: Change parse_events_add_pmu interface
perf tools: Add location to pmu event terms
perf tools: Add term support for parse_events_error
perf tools: Add static terms support for parse_events_error
perf tools: Add tracepoint support for parse_events_error
perf tools: Add symbolic events support for parse_events_error

tools/perf/builtin-stat.c | 2 +-
tools/perf/tests/code-reading.c | 2 +-
tools/perf/tests/evsel-roundtrip-name.c | 4 +-
tools/perf/tests/hists_cumulate.c | 2 +-
tools/perf/tests/hists_filter.c | 4 +-
tools/perf/tests/hists_link.c | 4 +-
tools/perf/tests/hists_output.c | 2 +-
tools/perf/tests/keep-tracking.c | 4 +-
tools/perf/tests/parse-events.c | 2 +-
tools/perf/tests/perf-time-to-tsc.c | 2 +-
tools/perf/tests/pmu.c | 3 +-
tools/perf/tests/switch-tracking.c | 8 +--
tools/perf/util/parse-events.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
tools/perf/util/parse-events.h | 36 ++++++++----
tools/perf/util/parse-events.l | 41 ++++++++++++--
tools/perf/util/parse-events.y | 48 ++++++++--------
tools/perf/util/pmu.c | 57 +++++++++++++++++--
tools/perf/util/pmu.h | 6 +-
tools/perf/util/record.c | 4 +-
19 files changed, 325 insertions(+), 100 deletions(-)