Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf docs: arm_spe: Document new discard mode

Document the flag along with PMU events to hint what it's used for and
give an example with other useful options to get minimal output.

Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Link: https://lore.kernel.org/r/20250108142904.401139-3-james.clark@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>

authored by

James Clark and committed by
Will Deacon
ba113eca d28d95bc

+26
+26
tools/perf/Documentation/perf-arm-spe.txt
··· 150 150 pct_enable=1 - collect physical timestamp instead of virtual timestamp (PMSCR.PCT) - requires privilege 151 151 store_filter=1 - collect stores only (PMSFCR.ST) 152 152 ts_enable=1 - enable timestamping with value of generic timer (PMSCR.TS) 153 + discard=1 - enable SPE PMU events but don't collect sample data - see 'Discard mode' (PMBLIMITR.FM = DISCARD) 153 154 154 155 +++*+++ Latency is the total latency from the point at which sampling started on that instruction, rather 155 156 than only the execution latency. ··· 221 220 222 221 Increase sampling interval (see above) 223 222 223 + PMU events 224 + ~~~~~~~~~~ 225 + 226 + SPE has events that can be counted on core PMUs. These are prefixed with 227 + SAMPLE_, for example SAMPLE_POP, SAMPLE_FEED, SAMPLE_COLLISION and 228 + SAMPLE_FEED_BR. 229 + 230 + These events will only count when an SPE event is running on the same core that 231 + the PMU event is opened on, otherwise they read as 0. There are various ways to 232 + ensure that the PMU event and SPE event are scheduled together depending on the 233 + way the event is opened. For example opening both events as per-process events 234 + on the same process, although it's not guaranteed that the PMU event is enabled 235 + first when context switching. For that reason it may be better to open the PMU 236 + event as a systemwide event and then open SPE on the process of interest. 237 + 238 + Discard mode 239 + ~~~~~~~~~~~~ 240 + 241 + SPE related (SAMPLE_* etc) core PMU events can be used without the overhead of 242 + collecting sample data if discard mode is supported (optional from Armv8.6). 243 + First run a system wide SPE session (or on the core of interest) using options 244 + to minimize output. Then run perf stat: 245 + 246 + perf record -e arm_spe/discard/ -a -N -B --no-bpf-event -o - > /dev/null & 247 + perf stat -e SAMPLE_FEED_LD 224 248 225 249 SEE ALSO 226 250 --------