perf parse-events: Minor tidy up of event_type helper
authorIan Rogers <irogers@google.com>
Thu, 10 Jul 2025 23:51:15 +0000 (16:51 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 11 Jul 2025 19:36:40 +0000 (12:36 -0700)
commit679c098cd2db458b1899e4410150d41a550ec6d6
tree91ec38288e814eb7e424965c772925e2a45e0d2f
parent28f5aa8184c9c9b8eab35fa3884c416fe75e88e4
perf parse-events: Minor tidy up of event_type helper

Add missing breakpoint and raw types. Avoid a switch, just use a
lookup array. Switch the type to unsigned to avoid checking negative
values.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250710235126.1086011-3-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/parse-events.c
tools/perf/util/parse-events.h