perf mem: Add mem_events into the supported perf_pmu
authorKan Liang <kan.liang@linux.intel.com>
Tue, 23 Jan 2024 18:50:30 +0000 (10:50 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 24 Jan 2024 22:03:33 +0000 (14:03 -0800)
commitbb65acdc832ec84fa42d752c50247e968381d057
tree4b2dcd13e6fb2a4cfeb062e449995e720abd411f
parent68f87f24f953cf3147afa01ef123d8fd3c1162b6
perf mem: Add mem_events into the supported perf_pmu

With the mem_events, perf doesn't need to read sysfs for each PMU to
find the mem-events-supported PMU. The patch also makes it possible to
clean up the related __weak functions later.

The patch is only to add the mem_events into the perf_pmu for all ARCHs.
It will be used in the later cleanup patches.

Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Tested-by: Ravi Bangoria <ravi.bangoria@amd.com>
Tested-by: Leo Yan <leo.yan@linaro.org>
Tested-by: Kajol Jain <kjain@linux.ibm.com>
Suggested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.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-2-kan.liang@linux.intel.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/arch/arm/util/pmu.c
tools/perf/arch/arm64/util/mem-events.c
tools/perf/arch/arm64/util/mem-events.h [new file with mode: 0644]
tools/perf/arch/x86/util/mem-events.c
tools/perf/arch/x86/util/mem-events.h [new file with mode: 0644]
tools/perf/arch/x86/util/pmu.c
tools/perf/util/mem-events.c
tools/perf/util/mem-events.h
tools/perf/util/pmu.c
tools/perf/util/pmu.h