]> git.itanic.dy.fi Git - linux-stable/commit
perf/x86/ibs: Set mem_lvl_num, mem_remote and mem_hops for data_src
authorNamhyung Kim <namhyung@kernel.org>
Tue, 25 Jul 2023 15:02:06 +0000 (20:32 +0530)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 26 Jul 2023 10:28:45 +0000 (12:28 +0200)
commit8bfc20baa9355d2ce6b031ff8bdb62c9456923f7
tree9c0e0d6662fd3beed5badbf91f42330c7c3d694a
parent5c6e623f1b8ebca39eeefba4b18d574eb5acf0bd
perf/x86/ibs: Set mem_lvl_num, mem_remote and mem_hops for data_src

Kernel IBS driver wasn't using new PERF_MEM_* APIs due to some of its
limitations. Mainly:

1. mem_lvl_num doesn't allow setting multiple sources whereas old API
   allows it. Setting multiple data sources is useful because IBS on
   pre-zen4 uarch doesn't provide fine granular DataSrc details (there
   is only one such DataSrc(2h) though).
2. perf mem sorting logic (sort__lvl_cmp()) ignores mem_lvl_num. perf
   c2c (c2c_decode_stats()) does not use mem_lvl_num at all.

1st one can be handled using ANY_CACHE with HOPS_0. 2nd is purely perf
tool specific issue and should be fixed separately.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230725150206.184-4-ravi.bangoria@amd.com
arch/x86/events/amd/ibs.c