perf mem: Clean up perf_mem_event__supported()
authorKan Liang <kan.liang@linux.intel.com>
Tue, 23 Jan 2024 18:50:33 +0000 (10:50 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 24 Jan 2024 22:04:46 +0000 (14:04 -0800)
commitdb95c2ce9be6e447f36423313526cfeb8cd5fc7a
tree2fc8c607fe704550366c60a7fabaf7239a2a9cb5
parentabbdd79b786e036e60f01b7907977943ebe7a74d
perf mem: Clean up perf_mem_event__supported()

For some ARCHs, e.g., ARM and AMD, to get the availability of the
mem-events, perf checks the existence of a specific PMU. For the other
ARCHs, e.g., Intel and Power, perf has to check the existence of some
specific events.

The current perf only iterates the mem-events-supported PMUs. It's not
required to check the existence of a specific PMU anymore.

Rename sysfs_name to event_name, which stores the specific mem-events.
Perf only needs to check those events for the availability of the
mem-events.

Rename perf_mem_event__supported to perf_pmu__mem_events_supported.

Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ravi Bangoria <ravi.bangoria@amd.com>
Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: james.clark@arm.com
Cc: will@kernel.org
Cc: mike.leach@linaro.org
Cc: renyu.zj@linux.alibaba.com
Cc: yuhaixin.yhx@linux.alibaba.com
Cc: tmricht@linux.ibm.com
Cc: atrajeev@linux.vnet.ibm.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: john.g.garry@oracle.com
Link: https://lore.kernel.org/r/20240123185036.3461837-5-kan.liang@linux.intel.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/arch/arm64/util/mem-events.c
tools/perf/arch/powerpc/util/mem-events.c
tools/perf/arch/x86/util/mem-events.c
tools/perf/util/mem-events.c
tools/perf/util/mem-events.h