+1
−0
tools/perf/util/pmu-hybrid.c
0 → 100644
+49
−0
tools/perf/util/pmu-hybrid.h
0 → 100644
+18
−0
+8
−1
+4
−0
Loading
mainline inclusion from mainline-v5.13-rc1 commit 44462430 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAU6ZD Reference: https://github.com/torvalds/linux/commit/444624307c4e06d35de12df1cfe08a4964ac086f -------------------------------- commit 44462430 upstream We identify the cpu_core pmu and cpu_atom pmu by explicitly checking following files: For cpu_core, checks: "/sys/bus/event_source/devices/cpu_core/cpus" For cpu_atom, checks: "/sys/bus/event_source/devices/cpu_atom/cpus" If the 'cpus' file exists and it has data, the pmu exists. But in order not to hardcode the "cpu_core" and "cpu_atom", and make the code in a generic way. So if the path "/sys/bus/event_source/devices/cpu_xxx/cpus" exists, the hybrid pmu exists. All the detected hybrid pmus are linked to a global list 'perf_pmu__hybrid_pmus' and then next we just need to iterate the list to get all hybrid pmu by using perf_pmu__for_each_hybrid_pmu. Signed-off-by:Jin Yao <yao.jin@linux.intel.com> Reviewed-by:
Jiri Olsa <jolsa@kernel.org> 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/20210427070139.25256-6-yao.jin@linux.intel.com Signed-off-by:
Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by:
Malathi A <arunagiri.malathi@amd.com> Signed-off-by:
PvsNarasimha <PVS.NarasimhaRao@amd.com>