Skip to content

Commit b45bd54

Browse files
author
Fox Snowpatch
committed
1 parent 367b51a commit b45bd54

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tools/perf/tests/shell/stat_all_pmu.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ do
5353
continue
5454
fi
5555

56+
# check with system wide if it is supported.
57+
output=$(perf stat -a -e "$p" true 2>&1)
58+
stat_result=$?
59+
if echo "$output" | grep -q "not supported"
60+
then
61+
# Event not supported, so ignore.
62+
echo "not supported"
63+
continue
64+
fi
65+
66+
# checked through possible access limitations and permissions.
67+
# At this step, non-zero return code from "perf stat" needs to
68+
# reported as fail for the user to investigate
69+
if [ $stat_result -ne 0 ]
70+
then
71+
echo "perf stat failed with non-zero return code"
72+
err=1
73+
continue
74+
fi
75+
5676
# We failed to see the event and it is supported. Possibly the workload was
5777
# too small so retry with something longer.
5878
output=$(perf stat -e "$p" perf bench internals synthesize 2>&1)

0 commit comments

Comments
 (0)