Skip to content

Commit f4fdd16

Browse files
committed
perf tests arm_spe: Add test for discard mode
JIRA: https://issues.redhat.com/browse/RHEL-77936 upstream ======== commit 05cd60e Author: James Clark <[email protected]> Date: Wed Jan 8 14:29:00 2025 +0000 description =========== Add a test that checks that there were no AUX or AUXTRACE events recorded when discard mode is used. Reviewed-by: Yeoreum Yun <[email protected]> Signed-off-by: James Clark <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Graham Woodward <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Kan Liang <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rob Herring <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Veronika Molnarova <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Michael Petlan <[email protected]>
1 parent f10993c commit f4fdd16

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tools/perf/tests/shell/test_arm_spe.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,37 @@ arm_spe_system_wide_test() {
107107
arm_spe_report "SPE system-wide testing" $err
108108
}
109109

110+
arm_spe_discard_test() {
111+
echo "SPE discard mode"
112+
113+
for f in /sys/bus/event_source/devices/arm_spe_*; do
114+
if [ -e "$f/format/discard" ]; then
115+
cpu=$(cut -c -1 "$f/cpumask")
116+
break
117+
fi
118+
done
119+
120+
if [ -z $cpu ]; then
121+
arm_spe_report "SPE discard mode not present" 2
122+
return
123+
fi
124+
125+
# Test can use wildcard SPE instance and Perf will only open the event
126+
# on instances that have that format flag. But make sure the target
127+
# runs on an instance with discard mode otherwise we're not testing
128+
# anything.
129+
perf record -o ${perfdata} -e arm_spe/discard/ -N -B --no-bpf-event \
130+
-- taskset --cpu-list $cpu true
131+
132+
if perf report -i ${perfdata} --stats | grep 'AUX events\|AUXTRACE events'; then
133+
arm_spe_report "SPE discard mode found unexpected data" 1
134+
else
135+
arm_spe_report "SPE discard mode" 0
136+
fi
137+
}
138+
110139
arm_spe_snapshot_test
111140
arm_spe_system_wide_test
141+
arm_spe_discard_test
112142

113143
exit $glb_err

0 commit comments

Comments
 (0)