File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,37 @@ arm_spe_system_wide_test() {
107
107
arm_spe_report " SPE system-wide testing" $err
108
108
}
109
109
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
+
110
139
arm_spe_snapshot_test
111
140
arm_spe_system_wide_test
141
+ arm_spe_discard_test
112
142
113
143
exit $glb_err
You can’t perform that action at this time.
0 commit comments