]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf mem: Count L2 HITM for c2c statistic
authorYicong Yang <yangyicong@hisilicon.com>
Fri, 25 Apr 2025 03:38:45 +0000 (11:38 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 May 2025 21:05:28 +0000 (18:05 -0300)
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>
tools/perf/util/mem-events.c

index 3e9131e05348a9968fb7f51574edb609114528c1..80b3069427bc4bb5ffc3ab0856c01c76d9ba3ba6 100644 (file)
@@ -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);