Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <leo.yan@arm.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Cc: CaiJingtao <caijingtao@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Junhao He <hejunhao3@huawei.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Cc: Yushan Wang <wangyushan12@huawei.com>
Cc: Zeng Tao <prime.zeng@hisilicon.com>
Cc: xueshan2@huawei.com
Link: https://lore.kernel.org/r/20250425033845.57671-4-yangyicong@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Yicong Yang and committed by
Arnaldo Carvalho de Melo
fa9b3578 846b62b3

+4 -1
+4 -1
tools/perf/util/mem-events.c
··· 677 677 if (lvl & P(LVL, LFB)) stats->ld_fbhit++; 678 678 if (lvl & P(LVL, L1 )) stats->ld_l1hit++; 679 679 if (lvl & P(LVL, L2)) { 680 - stats->ld_l2hit++; 680 + if (snoop & P(SNOOP, HITM)) 681 + HITM_INC(lcl_hitm); 682 + else 683 + stats->ld_l2hit++; 681 684 682 685 if (snoopx & P(SNOOPX, PEER)) 683 686 PEER_INC(lcl_peer);