From: Yicong Yang Date: Fri, 25 Apr 2025 03:38:45 +0000 (+0800) Subject: perf mem: Count L2 HITM for c2c statistic X-Git-Tag: v6.16-rc1~57^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa9b3578ed628641504ab74958bbe36a42c2615a;p=thirdparty%2Flinux.git perf mem: Count L2 HITM for c2c statistic L2 HITM is not counted in c2c statistic decoding. Count it for lcl_hitm like how we handle L2 Peer snoop. Reviewed-by: Leo Yan Signed-off-by: Yicong Yang Cc: CaiJingtao Cc: Catalin Marinas Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Jonathan Cameron Cc: Junhao He Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: Yushan Wang Cc: Zeng Tao Cc: xueshan2@huawei.com Link: https://lore.kernel.org/r/20250425033845.57671-4-yangyicong@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index 3e9131e05348a..80b3069427bc4 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c @@ -677,7 +677,10 @@ do { \ if (lvl & P(LVL, LFB)) stats->ld_fbhit++; if (lvl & P(LVL, L1 )) stats->ld_l1hit++; if (lvl & P(LVL, L2)) { - stats->ld_l2hit++; + if (snoop & P(SNOOP, HITM)) + HITM_INC(lcl_hitm); + else + stats->ld_l2hit++; if (snoopx & P(SNOOPX, PEER)) PEER_INC(lcl_peer);