From: James Clark <james.clark@linaro.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH 09/12] perf arm_spe: Fill memory levels for FEAT_SPEv1p4
Date: Fri, 20 Jun 2025 11:37:10 +0100 [thread overview]
Message-ID: <c9ebcc02-cbe7-403f-a427-b1209e3c041a@linaro.org> (raw)
In-Reply-To: <20250613-arm_spe_support_hitm_overhead_v1_public-v1-9-6faecf0a8775@arm.com>
On 13/06/2025 4:53 pm, Leo Yan wrote:
> Starting with FEAT_SPEv1p4, Arm SPE provides information on Level 2 data
> cache and recently fetched events. This patch fills in the memory levels
> for these new events.
>
> The recently fetched events are matched to line-fill buffer (LFB). In
> general, the latency for accessing LFB is higher than accessing L1 cache
> but lower than accessing L2 cache. Thus, it locates in the memory
> hierarchy information between L1 cache and L2 cache.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/perf/util/arm-spe-decoder/arm-spe-decoder.h | 3 +++
> tools/perf/util/arm-spe.c | 14 ++++++++++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
> index 03da55453da8fd2e7b9e2dcba3ddcf5243599e1c..90c76928c7bf1b35cec538abdb0e88d6083fe81b 100644
> --- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
> @@ -25,6 +25,9 @@
> #define ARM_SPE_SVE_PARTIAL_PRED BIT(EV_PARTIAL_PREDICATE)
> #define ARM_SPE_SVE_EMPTY_PRED BIT(EV_EMPTY_PREDICATE)
> #define ARM_SPE_IN_TXN BIT(EV_TRANSACTIONAL)
> +#define ARM_SPE_L2D_ACCESS BIT(EV_L2D_ACCESS)
> +#define ARM_SPE_L2D_MISS BIT(EV_L2D_MISS)
> +#define ARM_SPE_RECENTLY_FETCH BIT(EV_RECENTLY_FETCHED)
FETCH -> FETCHED
Reviewed-by: James Clark <james.clark@linaro.org>
>
> enum arm_spe_op_type {
> /* First level operation type */
> diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
> index 8f18af7336db53b00b450eb4299feee350d0ecb9..2ab38d21d52f73617451a6a79f9d5ae931a34f49 100644
> --- a/tools/perf/util/arm-spe.c
> +++ b/tools/perf/util/arm-spe.c
> @@ -842,6 +842,12 @@ static void arm_spe__synth_ld_memory_level(const struct arm_spe_record *record,
> if (arm_spe_is_cache_hit(record->type, L1D)) {
> data_src->mem_lvl = PERF_MEM_LVL_L1 | PERF_MEM_LVL_HIT;
> data_src->mem_lvl_num = PERF_MEM_LVLNUM_L1;
> + } else if (record->type & ARM_SPE_RECENTLY_FETCH) {
> + data_src->mem_lvl = PERF_MEM_LVL_LFB | PERF_MEM_LVL_HIT;
> + data_src->mem_lvl_num = PERF_MEM_LVLNUM_LFB;
> + } else if (arm_spe_is_cache_hit(record->type, L2D)) {
> + data_src->mem_lvl = PERF_MEM_LVL_L2 | PERF_MEM_LVL_HIT;
> + data_src->mem_lvl_num = PERF_MEM_LVLNUM_L2;
> } else if (arm_spe_is_cache_hit(record->type, LLC)) {
> data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_HIT;
> data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
> @@ -853,6 +859,9 @@ static void arm_spe__synth_ld_memory_level(const struct arm_spe_record *record,
> } else if (arm_spe_is_cache_miss(record->type, LLC)) {
> data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_MISS;
> data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
> + } else if (arm_spe_is_cache_miss(record->type, L2D)) {
> + data_src->mem_lvl = PERF_MEM_LVL_L2 | PERF_MEM_LVL_MISS;
> + data_src->mem_lvl_num = PERF_MEM_LVLNUM_L2;
> } else if (arm_spe_is_cache_miss(record->type, L1D)) {
> data_src->mem_lvl = PERF_MEM_LVL_L1 | PERF_MEM_LVL_MISS;
> data_src->mem_lvl_num = PERF_MEM_LVLNUM_L1;
> @@ -868,6 +877,11 @@ static void arm_spe__synth_st_memory_level(const struct arm_spe_record *record,
> data_src->mem_lvl |= arm_spe_is_cache_miss(record->type, LLC) ?
> PERF_MEM_LVL_MISS : PERF_MEM_LVL_HIT;
> data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
> + } else if (arm_spe_is_cache_level(record->type, L2D)) {
> + data_src->mem_lvl = PERF_MEM_LVL_L2;
> + data_src->mem_lvl |= arm_spe_is_cache_miss(record->type, L2D) ?
> + PERF_MEM_LVL_MISS : PERF_MEM_LVL_HIT;
> + data_src->mem_lvl_num = PERF_MEM_LVLNUM_L2;
> } else if (arm_spe_is_cache_level(record->type, L1D)) {
> data_src->mem_lvl = PERF_MEM_LVL_L1;
> data_src->mem_lvl |= arm_spe_is_cache_miss(record->type, L1D) ?
>
next prev parent reply other threads:[~2025-06-20 10:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-13 15:53 [PATCH 00/12] perf arm-spe: Support new events in FEAT_SPEv1p4 Leo Yan
2025-06-13 15:53 ` [PATCH 01/12] drivers/perf: arm_spe: Store event reserved bits in driver data Leo Yan
2025-06-19 11:28 ` James Clark
2025-06-19 16:22 ` Leo Yan
2025-06-13 15:53 ` [PATCH 02/12] drivers/perf: arm_spe: Expose events capability Leo Yan
2025-06-19 11:32 ` James Clark
2025-06-19 16:24 ` Leo Yan
2025-06-13 15:53 ` [PATCH 03/12] perf arm_spe: Correct setting remote access Leo Yan
2025-06-19 13:53 ` James Clark
2025-06-19 16:45 ` Leo Yan
2025-06-13 15:53 ` [PATCH 04/12] perf arm_spe: Directly propagate raw event Leo Yan
2025-06-19 14:13 ` James Clark
2025-06-13 15:53 ` [PATCH 05/12] perf arm_spe: Decode event types for new features Leo Yan
2025-06-19 14:20 ` James Clark
2025-06-13 15:53 ` [PATCH 06/12] perf arm_spe: Add "events" entry in meta data Leo Yan
2025-06-19 15:46 ` James Clark
2025-06-13 15:53 ` [PATCH 07/12] perf arm_spe: Refine memory level filling Leo Yan
2025-06-20 10:27 ` James Clark
2025-06-13 15:53 ` [PATCH 08/12] perf arm_spe: Separate setting of memory levels for loads and stores Leo Yan
2025-06-20 10:30 ` James Clark
2025-06-13 15:53 ` [PATCH 09/12] perf arm_spe: Fill memory levels for FEAT_SPEv1p4 Leo Yan
2025-06-20 10:37 ` James Clark [this message]
2025-06-13 15:53 ` [PATCH 10/12] perf arm_spe: Refactor arm_spe__get_metadata_by_cpu() Leo Yan
2025-06-20 10:45 ` James Clark
2025-06-13 15:53 ` [PATCH 11/12] perf arm_spe: Set HITM flag Leo Yan
2025-06-20 10:51 ` James Clark
2025-06-13 15:53 ` [PATCH 12/12] perf arm_spe: Allow parsing both data source and events Leo Yan
2025-06-20 10:55 ` James Clark
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=c9ebcc02-cbe7-403f-a427-b1209e3c041a@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=leo.yan@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=namhyung@kernel.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).