linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	James Clark <james.clark@linaro.org>,
	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>,
	German Gomez <german.gomez@arm.com>,
	Ali Saidi <alisaidi@amazon.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 01/14] drivers/perf: arm_spe: Expose event filter
Date: Mon, 14 Jul 2025 16:42:51 +0100	[thread overview]
Message-ID: <20250714154251.GF1093654@e132581.arm.com> (raw)
In-Reply-To: <aHUerfpLyAPEc9R_@willie-the-truck>

On Mon, Jul 14, 2025 at 04:13:49PM +0100, Will Deacon wrote:

[...]

> > > In other words, remove arm_spe_pmsevfr_res0() and the two checks that
> > > use it in arm_spe_pmu_event_init(). If userspace tries to filter events
> > > that aren't implemented, then it gets to keep the pieces.
> > 
> > Then the question is: what information should be exposed to userspace
> > so that tools can decide which events are valid?
> > 
> > I would suggest to expose a new entry, "caps/version", to indicate the
> > SPE version number. Tools can use this to apply the appropriate event
> > validation. Please let me know if this works for you.
> 
> I thought userspace typically had midr-based json files to figure this
> stuff out?

Yes, the perf tool records the CPU MIDR in the metadata.

However, I deliberately tried to avoid relying on this approach,
because the perf would then need to maintain a mapping between:

  MIDR -> Arm SPE version -> Events

Given the large number of CPU variants, maintaining this relationship
between CPU ID and SPE version, and subsequently mapping it to supported
events, would be quite complex. Additional effort would be required each
time a new CPU variant is introduced.

> The supported events aren't probe-able afaict so I don't
> think the driver can help.

Although the events are not probe-able, some events are specific to
certain Arm SPE versions. For example, E[23]:

  | Data snooped.
  | When FEAT_SPEv1p4 is implemented

With SPE version information, the perf tool can decode E[23] == 0 as:

  "No snooping" for SPEv4

  "No available information for snooping" for earlier SPE versions

Without SPE version information, it's impossible to distinguish
between these two cases.

Thanks,
Leo

  reply	other threads:[~2025-07-14 15:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 13:39 [PATCH v3 00/14] perf arm-spe: Support new events in FEAT_SPEv1p4 Leo Yan
2025-07-07 13:39 ` [PATCH v3 01/14] drivers/perf: arm_spe: Expose event filter Leo Yan
2025-07-14 13:07   ` Will Deacon
2025-07-14 15:09     ` Leo Yan
2025-07-14 15:13       ` Will Deacon
2025-07-14 15:42         ` Leo Yan [this message]
2025-07-15 11:15           ` James Clark
2025-07-17 11:43             ` Will Deacon
2025-07-07 13:39 ` [PATCH v3 02/14] perf arm_spe: Correct setting remote access Leo Yan
2025-07-07 13:39 ` [PATCH v3 03/14] perf arm_spe: Correct memory level for " Leo Yan
2025-07-07 13:39 ` [PATCH v3 04/14] perf arm_spe: Use full type for data_src Leo Yan
2025-07-07 13:39 ` [PATCH v3 05/14] perf arm_spe: Directly propagate raw event Leo Yan
2025-07-07 13:39 ` [PATCH v3 06/14] perf arm_spe: Decode event types for new features Leo Yan
2025-07-07 13:39 ` [PATCH v3 07/14] perf arm_spe: Add "event_filter" entry in meta data Leo Yan
2025-07-07 13:39 ` [PATCH v3 08/14] perf arm_spe: Refine memory level filling Leo Yan
2025-07-07 13:39 ` [PATCH v3 09/14] perf arm_spe: Separate setting of memory levels for loads and stores Leo Yan
2025-07-07 13:39 ` [PATCH v3 10/14] perf arm_spe: Fill memory levels for FEAT_SPEv1p4 Leo Yan
2025-07-07 13:39 ` [PATCH v3 11/14] perf arm_spe: Improve CPU number retrieving in per-thread mode Leo Yan
2025-07-07 13:39 ` [PATCH v3 12/14] perf arm_spe: Refactor arm_spe__get_metadata_by_cpu() Leo Yan
2025-07-07 13:39 ` [PATCH v3 13/14] perf arm_spe: Set HITM flag Leo Yan
2025-07-07 13:39 ` [PATCH v3 14/14] perf arm_spe: Allow parsing both data source and events Leo Yan

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=20250714154251.GF1093654@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alisaidi@amazon.com \
    --cc=german.gomez@arm.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --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).