From: Ali Saidi <alisaidi@amazon.com>
To: <linux-kernel@vger.kernel.org>,
<linux-perf-users@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <german.gomez@arm.com>,
<leo.yan@linaro.org>
Cc: <alisaidi@amazon.com>, <benh@kernel.crashing.org>,
<Nick.Forrington@arm.com>, <acme@kernel.org>,
<alexander.shishkin@linux.intel.com>, <andrew.kilroy@arm.com>,
<james.clark@arm.com>, <john.garry@huawei.com>,
<jolsa@kernel.org>, <kjain@linux.ibm.com>, <lihuafei1@huawei.com>,
<mark.rutland@arm.com>, <mathieu.poirier@linaro.org>,
<mingo@redhat.com>, <namhyung@kernel.org>, <peterz@infradead.org>,
<will@kernel.org>
Subject: [PATCH v3 3/3] perf mem: Support HITM for when mem_lvl_num is any
Date: Fri, 18 Mar 2022 19:59:13 +0000 [thread overview]
Message-ID: <20220318195913.17459-4-alisaidi@amazon.com> (raw)
In-Reply-To: <20220318195913.17459-1-alisaidi@amazon.com>
For loads that hit in a the LLC snoop filter and are fulfilled from a
higher level cache on arm64 Neoverse cores, it's not usually clear what
the true level of the cache the data came from (i.e. a transfer from a
core could come from it's L1 or L2). Instead of making an assumption of
where the line came from, add support for incrementing HITM if the
source is CACHE_ANY.
Since other architectures don't seem to populate the mem_lvl_num field
here there shouldn't be a change in functionality.
Signed-off-by: Ali Saidi <alisaidi@amazon.com>
---
tools/perf/util/mem-events.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index e5e405185498..084977cfebef 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -539,6 +539,15 @@ do { \
stats->ld_llchit++;
}
+ /*
+ * A hit in another cores cache must mean a llc snoop
+ * filter hit
+ */
+ if (lnum == P(LVLNUM, ANY_CACHE)) {
+ if (snoop & P(SNOOP, HITM))
+ HITM_INC(lcl_hitm);
+ }
+
if (lvl & P(LVL, LOC_RAM) || lnum == P(LVLNUM, RAM)) {
stats->lcl_dram++;
if (snoop & P(SNOOP, HIT))
--
2.32.0
next prev parent reply other threads:[~2022-03-18 19:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 19:59 [PATCH v3 0/2] perf: arm-spe: Decode SPE source and use for perf c2c Ali Saidi
2022-03-18 19:59 ` [PATCH v3 1/3] perf arm-spe: Use SPE data source for neoverse cores Ali Saidi
2022-03-22 21:18 ` Arnaldo Carvalho de Melo
2022-03-18 19:59 ` [PATCH v3 2/3] perf mem: Support mem_lvl_num in c2c command Ali Saidi
2022-03-18 19:59 ` Ali Saidi [this message]
2022-03-22 12:05 ` [PATCH v3 0/2] perf: arm-spe: Decode SPE source and use for perf c2c German Gomez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220318195913.17459-4-alisaidi@amazon.com \
--to=alisaidi@amazon.com \
--cc=Nick.Forrington@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=andrew.kilroy@arm.com \
--cc=benh@kernel.crashing.org \
--cc=german.gomez@arm.com \
--cc=james.clark@arm.com \
--cc=john.garry@huawei.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=leo.yan@linaro.org \
--cc=lihuafei1@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).