linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] perf: arm_spe: Add format option for discard mode
@ 2025-01-08 14:28 James Clark
  2025-01-08 14:28 ` [PATCH v3 1/5] " James Clark
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: James Clark @ 2025-01-08 14:28 UTC (permalink / raw)
  To: linux-arm-kernel, linux-perf-users, irogers, yeoreum.yun, will,
	mark.rutland, namhyung, acme
  Cc: robh, James Clark, Peter Zijlstra, Ingo Molnar,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, Liang, Kan,
	John Garry, Mike Leach, Leo Yan, Graham Woodward, Michael Petlan,
	Veronika Molnarova, Thomas Richter, Athira Rajeev, linux-kernel,
	bpf

Discard mode (Armv8.6) is a way to enable SPE related PMU events without
the overhead of recording any data. Add a format option, tests and docs
for it.

In theory we could make the driver drop calls to allocate the aux buffer
when discard mode is enabled. This would give a small memory saving,
but I think there is potential to interfere with any tools that don't
expect this so I left the aux allocation untouched. Even old tools that
don't know about discard mode will be able to use it because we publish
the format option. Not allocating the aux buffer will have to be added
to tools which I've done in Perf.

Tested on the FVP with SAMPLE_FEED_OP (0x812D):

 $ perf stat -e armv8_pmuv3/event=0x812D/ -- true

 Performance counter stats for 'true':

                 0      armv8_pmuv3/event=0x812D/

 $ perf record -e arm_spe/discard/ -a -N -B --no-bpf-event -o - > /dev/null &
 $ perf stat -e armv8_pmuv3/event=0x812D/ -- true

  Performance counter stats for 'true':

             17350      armv8_pmuv3/event=0x812D/

Changes since v2:
  * Use existing SPE_PMU_FEAT_* mechanism (Will)

Changes since v1:
  * Add a new section and some clarifications about the PMU events to
    the docs. (Ian)

Applies to v6.13-rc6

James Clark (5):
  perf: arm_spe: Add format option for discard mode
  perf docs: arm_spe: Document new discard mode
  perf tool: arm-spe: Pull out functions for aux buffer and tracking
    setup
  perf tool: arm-spe: Don't allocate buffer or tracking event in discard
    mode
  perf test: arm_spe: Add test for discard mode

 drivers/perf/arm_spe_pmu.c                | 22 ++++++
 tools/perf/Documentation/perf-arm-spe.txt | 26 +++++++
 tools/perf/arch/arm64/util/arm-spe.c      | 90 +++++++++++++++--------
 tools/perf/tests/shell/test_arm_spe.sh    | 30 ++++++++
 4 files changed, 136 insertions(+), 32 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH v3 0/5] perf: arm_spe: Add format option for discard mode
@ 2025-01-08 14:27 James Clark
  0 siblings, 0 replies; 11+ messages in thread
From: James Clark @ 2025-01-08 14:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-perf-users, irogers, yeoreum.yun, will,
	mark.rutland
  Cc: robh, James Clark, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Alexander Shishkin,
	Jiri Olsa, Adrian Hunter, Liang, Kan, John Garry, Mike Leach,
	Leo Yan, Graham Woodward, Michael Petlan, Veronika Molnarova,
	Athira Rajeev, Thomas Richter, linux-kernel, bpf

Discard mode (Armv8.6) is a way to enable SPE related PMU events without
the overhead of recording any data. Add a format option, tests and docs
for it.

In theory we could make the driver drop calls to allocate the aux buffer
when discard mode is enabled. This would give a small memory saving,
but I think there is potential to interfere with any tools that don't
expect this so I left the aux allocation untouched. Even old tools that
don't know about discard mode will be able to use it because we publish
the format option. Not allocating the aux buffer will have to be added
to tools which I've done in Perf.

Tested on the FVP with SAMPLE_FEED_OP (0x812D):

 $ perf stat -e armv8_pmuv3/event=0x812D/ -- true

 Performance counter stats for 'true':

                 0      armv8_pmuv3/event=0x812D/

 $ perf record -e arm_spe/discard/ -a -N -B --no-bpf-event -o - > /dev/null &
 $ perf stat -e armv8_pmuv3/event=0x812D/ -- true

  Performance counter stats for 'true':

             17350      armv8_pmuv3/event=0x812D/

Changes since v2:
  * Use existing SPE_PMU_FEAT_* mechanism (Will)

Changes since v1:
  * Add a new section and some clarifications about the PMU events to
    the docs. (Ian)

Applies to v6.13-rc6

James Clark (5):
  perf: arm_spe: Add format option for discard mode
  perf docs: arm_spe: Document new discard mode
  perf tool: arm-spe: Pull out functions for aux buffer and tracking
    setup
  perf tool: arm-spe: Don't allocate buffer or tracking event in discard
    mode
  perf test: arm_spe: Add test for discard mode

 drivers/perf/arm_spe_pmu.c                | 22 ++++++
 tools/perf/Documentation/perf-arm-spe.txt | 26 +++++++
 tools/perf/arch/arm64/util/arm-spe.c      | 90 +++++++++++++++--------
 tools/perf/tests/shell/test_arm_spe.sh    | 30 ++++++++
 4 files changed, 136 insertions(+), 32 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-01-13 14:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 14:28 [PATCH v3 0/5] perf: arm_spe: Add format option for discard mode James Clark
2025-01-08 14:28 ` [PATCH v3 1/5] " James Clark
2025-01-08 20:16   ` Yeo Reum Yun
2025-01-08 14:28 ` [PATCH v3 2/5] perf docs: arm_spe: Document new " James Clark
2025-01-08 14:28 ` [PATCH v3 3/5] perf tool: arm-spe: Pull out functions for aux buffer and tracking setup James Clark
2025-01-08 14:28 ` [PATCH v3 4/5] perf tool: arm-spe: Don't allocate buffer or tracking event in discard mode James Clark
2025-01-08 14:29 ` [PATCH v3 5/5] perf test: arm_spe: Add test for " James Clark
2025-01-10 16:22 ` [PATCH v3 0/5] perf: arm_spe: Add format option " Will Deacon
2025-01-13 14:33   ` James Clark
2025-01-13 14:45   ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2025-01-08 14:27 James Clark

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).