perf tool_pmu: Switch to standard pmu functions and json descriptions
authorIan Rogers <irogers@google.com>
Wed, 2 Oct 2024 03:20:12 +0000 (20:20 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 11 Oct 2024 06:40:33 +0000 (23:40 -0700)
commit609aa2667f67c1588d4e741110265f74b7713177
tree31697c0518481260c9adb5592972ad81ccb829fb
parentc9b121b7fa5d99e87184d69d0852bf7f6a61179d
perf tool_pmu: Switch to standard pmu functions and json descriptions

Use the regular PMU approaches with tool json events to reduce the
amount of special tool_pmu code - tool_pmu__config_terms and
tool_pmu__for_each_event_cb are removed. Some functions remain, like
tool_pmu__str_to_event, as conveniences to metricgroups. Add
tool_pmu__skip_event/tool_pmu__num_skip_events to handle the case that
tool json events shouldn't appear on certain architectures. This isn't
done in jevents.py due to complexity in the empty-pmu-events.c and
when all vendor json is built into the tool.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20241002032016.333748-10-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/pmu.c
tools/perf/util/pmus.c
tools/perf/util/tool_pmu.c
tools/perf/util/tool_pmu.h