Skip to content

Commit 0c361c6

Browse files
captain5050acmel
authored andcommitted
perf test: Stat test for repeat with a weak group
Breaking a weak group requires multiple passes of an evlist, with multiple runs this can introduce bugs ultimately leading to segfaults. Add a test to cover this. Signed-off-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent bf515f0 commit 0c361c6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tools/perf/tests/shell/stat.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ test_stat_record_report() {
2828
echo "stat record and report test [Success]"
2929
}
3030

31+
test_stat_repeat_weak_groups() {
32+
echo "stat repeat weak groups test"
33+
if ! perf stat -e '{cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles}' \
34+
true 2>&1 | grep -q 'seconds time elapsed'
35+
then
36+
echo "stat repeat weak groups test [Skipped event parsing failed]"
37+
return
38+
fi
39+
if ! perf stat -r2 -e '{cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles,cycles}:W' \
40+
true > /dev/null 2>&1
41+
then
42+
echo "stat repeat weak groups test [Failed]"
43+
err=1
44+
return
45+
fi
46+
echo "stat repeat weak groups test [Success]"
47+
}
48+
3149
test_topdown_groups() {
3250
# Topdown events must be grouped with the slots event first. Test that
3351
# parse-events reorders this.
@@ -75,6 +93,7 @@ test_topdown_weak_groups() {
7593

7694
test_default_stat
7795
test_stat_record_report
96+
test_stat_repeat_weak_groups
7897
test_topdown_groups
7998
test_topdown_weak_groups
8099
exit $err

0 commit comments

Comments
 (0)