Skip to content

Commit 90d9767

Browse files
Thomas Richternamhyung
Thomas Richter
authored andcommitted
perf test: Use cycles event in perf record test for leader_sampling
On s390 the event instructions can not be used for recording. This event is only supported by perf stat. Change the event from instructions to cycles in subtest test_leader_sampling. Signed-off-by: Thomas Richter <[email protected]> Suggested-by: James Clark <[email protected]> Reviewed-by: James Clark <[email protected]> Reviewed-by: Kan Liang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent 8591994 commit 90d9767

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/perf/tests/shell/record.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ test_cgroup() {
231231

232232
test_leader_sampling() {
233233
echo "Basic leader sampling test"
234-
if ! perf record -o "${perfdata}" -e "{instructions,instructions}:Su" -- \
234+
if ! perf record -o "${perfdata}" -e "{cycles,cycles}:Su" -- \
235235
perf test -w brstack 2> /dev/null
236236
then
237237
echo "Leader sampling [Failed record]"
@@ -243,15 +243,15 @@ test_leader_sampling() {
243243
while IFS= read -r line
244244
do
245245
# Check if the two instruction counts are equal in each record
246-
instructions=$(echo $line | awk '{for(i=1;i<=NF;i++) if($i=="instructions:") print $(i-1)}')
247-
if [ $(($index%2)) -ne 0 ] && [ ${instructions}x != ${prev_instructions}x ]
246+
cycles=$(echo $line | awk '{for(i=1;i<=NF;i++) if($i=="cycles:") print $(i-1)}')
247+
if [ $(($index%2)) -ne 0 ] && [ ${cycles}x != ${prev_cycles}x ]
248248
then
249-
echo "Leader sampling [Failed inconsistent instructions count]"
249+
echo "Leader sampling [Failed inconsistent cycles count]"
250250
err=1
251251
return
252252
fi
253253
index=$(($index+1))
254-
prev_instructions=$instructions
254+
prev_cycles=$cycles
255255
done < $script_output
256256
echo "Basic leader sampling test [Success]"
257257
}

0 commit comments

Comments
 (0)