Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test stat: Update test expectations and events

test_stat_record_report and test_stat_record_script used default
output which triggers a bug when sending metrics. As this isn't
relevant to the test switch to using named software events.

Update the match in test_hybrid as the cycles event is now cpu-cycles
to workaround potential ARM issues.

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
a48cd551 6b76f067

+3 -3
+3 -3
tools/perf/tests/shell/stat.sh
··· 18 18 19 19 test_stat_record_report() { 20 20 echo "stat record and report test" 21 - if ! perf stat record -o - true | perf stat report -i - 2>&1 | \ 21 + if ! perf stat record -e task-clock -o - true | perf stat report -i - 2>&1 | \ 22 22 grep -E -q "Performance counter stats for 'pipe':" 23 23 then 24 24 echo "stat record and report test [Failed]" ··· 30 30 31 31 test_stat_record_script() { 32 32 echo "stat record and script test" 33 - if ! perf stat record -o - true | perf script -i - 2>&1 | \ 33 + if ! perf stat record -e task-clock -o - true | perf script -i - 2>&1 | \ 34 34 grep -E -q "CPU[[:space:]]+THREAD[[:space:]]+VAL[[:space:]]+ENA[[:space:]]+RUN[[:space:]]+TIME[[:space:]]+EVENT" 35 35 then 36 36 echo "stat record and script test [Failed]" ··· 196 196 fi 197 197 198 198 # Run default Perf stat 199 - cycles_events=$(perf stat -- true 2>&1 | grep -E "/cycles/[uH]*| cycles[:uH]* " -c) 199 + cycles_events=$(perf stat -a -- sleep 0.1 2>&1 | grep -E "/cpu-cycles/[uH]*| cpu-cycles[:uH]* " -c) 200 200 201 201 # The expectation is that default output will have a cycles events on each 202 202 # hybrid PMU. In situations with no cycles PMU events, like virtualized, this