[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250108142904.401139-6-james.clark@linaro.org>
Date: Wed, 8 Jan 2025 14:29:00 +0000
From: James Clark <james.clark@...aro.org>
To: linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org,
irogers@...gle.com,
yeoreum.yun@....com,
will@...nel.org,
mark.rutland@....com,
namhyung@...nel.org,
acme@...nel.org
Cc: robh@...nel.org,
James Clark <james.clark@...aro.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
John Garry <john.g.garry@...cle.com>,
Mike Leach <mike.leach@...aro.org>,
Leo Yan <leo.yan@...ux.dev>,
Graham Woodward <graham.woodward@....com>,
Veronika Molnarova <vmolnaro@...hat.com>,
Michael Petlan <mpetlan@...hat.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org
Subject: [PATCH v3 5/5] perf test: arm_spe: Add test for discard mode
Add a test that checks that there were no AUX or AUXTRACE events
recorded when discard mode is used.
Reviewed-by: Yeoreum Yun <yeoreum.yun@....com>
Signed-off-by: James Clark <james.clark@...aro.org>
---
tools/perf/tests/shell/test_arm_spe.sh | 30 ++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/tools/perf/tests/shell/test_arm_spe.sh b/tools/perf/tests/shell/test_arm_spe.sh
index 3258368634f7..a69aab70dd8a 100755
--- a/tools/perf/tests/shell/test_arm_spe.sh
+++ b/tools/perf/tests/shell/test_arm_spe.sh
@@ -107,7 +107,37 @@ arm_spe_system_wide_test() {
arm_spe_report "SPE system-wide testing" $err
}
+arm_spe_discard_test() {
+ echo "SPE discard mode"
+
+ for f in /sys/bus/event_source/devices/arm_spe_*; do
+ if [ -e "$f/format/discard" ]; then
+ cpu=$(cut -c -1 "$f/cpumask")
+ break
+ fi
+ done
+
+ if [ -z $cpu ]; then
+ arm_spe_report "SPE discard mode not present" 2
+ return
+ fi
+
+ # Test can use wildcard SPE instance and Perf will only open the event
+ # on instances that have that format flag. But make sure the target
+ # runs on an instance with discard mode otherwise we're not testing
+ # anything.
+ perf record -o ${perfdata} -e arm_spe/discard/ -N -B --no-bpf-event \
+ -- taskset --cpu-list $cpu true
+
+ if perf report -i ${perfdata} --stats | grep 'AUX events\|AUXTRACE events'; then
+ arm_spe_report "SPE discard mode found unexpected data" 1
+ else
+ arm_spe_report "SPE discard mode" 0
+ fi
+}
+
arm_spe_snapshot_test
arm_spe_system_wide_test
+arm_spe_discard_test
exit $glb_err
--
2.34.1
Powered by blists - more mailing lists