[PATCH v2 00/13] parse-events clean up

From: Ian Rogers
Date: Tue Jun 27 2023 - 14:10:48 EST


Remove some tokens the lexer never produces. Ensure abort paths set an
error. Previously scanning all PMUs meant bad events could fail with
an invalid token, detect this at the point parsing for a PMU fails and
add error strings. Try to be consistent in using YYNOMEM for memory
failures and YYABORT for bad input.

v2. Fix build error when building without libtraceevent.

Ian Rogers (13):
perf parse-events: Remove unused PE_PMU_EVENT_FAKE token
perf parse-events: Remove unused PE_KERNEL_PMU_EVENT token
perf parse-events: Remove two unused tokens
perf parse-events: Add more comments to parse_events_state
perf parse-events: Avoid regrouped warning for wild card events
perf parse-event: Add memory allocation test for name terms
perf parse-events: Separate YYABORT and YYNOMEM cases
perf parse-events: Move instances of YYABORT to YYNOMEM
perf parse-events: Separate ENOMEM memory handling
perf parse-events: Additional error reporting
perf parse-events: Populate error column for BPF/tracepoint events
perf parse-events: Improve location for add pmu
perf parse-events: Remove ABORT_ON

tools/perf/tests/bpf.c | 2 +-
tools/perf/util/parse-events.c | 98 +++++----
tools/perf/util/parse-events.h | 20 +-
tools/perf/util/parse-events.y | 351 +++++++++++++++++----------------
4 files changed, 258 insertions(+), 213 deletions(-)

--
2.41.0.162.gfafddb0af9-goog