perf tools: Check if mem_events is supported for hybrid platform
authorJin Yao <yao.jin@linux.intel.com>
Thu, 27 May 2021 00:16:06 +0000 (08:16 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 1 Jun 2021 14:04:33 +0000 (11:04 -0300)
commite7ce8d11bfb06a06c1e00830c223514086191649
tree0f757378edd478b17ed3d093e70f558e64f79eb4
parenta91ffcf30e0002e6f52d4c2cd9639443e514e88a
perf tools: Check if mem_events is supported for hybrid platform

Check if the mem_events ('mem-loads' and 'mem-stores') exist
in the sysfs path.

For Alderlake, the hybrid cpu pmu are "cpu_core" and "cpu_atom".
Check the existing of following paths:

/sys/devices/cpu_atom/events/mem-loads
/sys/devices/cpu_atom/events/mem-stores
/sys/devices/cpu_core/events/mem-loads
/sys/devices/cpu_core/events/mem-stores

If the patch exists, the mem_event is supported.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210527001610.10553-5-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/mem-events.c