]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf pmus: Restructure pmu_read_sysfs to scan fewer PMUs
authorIan Rogers <irogers@google.com>
Sat, 1 Feb 2025 07:43:17 +0000 (23:43 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 5 Feb 2025 05:28:37 +0000 (21:28 -0800)
commit57e13264dcea670d5f42a067562f02aa923219e2
tree356d30f1abd26b430b400457e602e31754c72ed9
parent340c345e587ef61e15f02483b1e72e5fa168f6ad
perf pmus: Restructure pmu_read_sysfs to scan fewer PMUs

Rather than scanning core or all PMUs, allow pmu_read_sysfs to read
some combination of core, other, hwmon and tool PMUs. The PMUs that
should be read and are already read are held as bitmaps. It is known
that a "hwmon_" prefix is necessary for a hwmon PMU's name, similarly
with "tool", so only scan those PMUs in situations the PMU name or the
PMU's type number make sense to.

The number of openat system calls reduces from 276 to 98 for a hwmon
event. The number of openats for regular perf events isn't changed.

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Link: https://lore.kernel.org/r/20250201074320.746259-3-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/pmu.h
tools/perf/util/pmus.c