aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/tests/shell/annotate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/shell/annotate.sh')
-rwxr-xr-xtools/perf/tests/shell/annotate.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/tests/shell/annotate.sh b/tools/perf/tests/shell/annotate.sh
index 1db1e8113d99..b072d9b97387 100755
--- a/tools/perf/tests/shell/annotate.sh
+++ b/tools/perf/tests/shell/annotate.sh
@@ -15,12 +15,13 @@ skip_test_missing_symbol ${testsym}
err=0
perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
+perfout=$(mktemp /tmp/__perf_test.perf.out.XXXXX)
testprog="perf test -w noploop"
# disassembly format: "percent : offset: instruction (operands ...)"
disasm_regex="[0-9]*\.[0-9]* *: *\w*: *\w*"
cleanup() {
- rm -rf "${perfdata}"
+ rm -rf "${perfdata}" "${perfout}"
rm -rf "${perfdata}".old
trap - EXIT TERM INT
@@ -41,8 +42,11 @@ test_basic() {
return
fi
+ # Generate the annotated output file
+ perf annotate -i "${perfdata}" --stdio 2> /dev/null > "${perfout}"
+
# check if it has the target symbol
- if ! perf annotate -i "${perfdata}" 2> /dev/null | grep "${testsym}"
+ if ! grep "${testsym}" "${perfout}"
then
echo "Basic annotate [Failed: missing target symbol]"
err=1
@@ -50,7 +54,7 @@ test_basic() {
fi
# check if it has the disassembly lines
- if ! perf annotate -i "${perfdata}" 2> /dev/null | grep "${disasm_regex}"
+ if ! grep "${disasm_regex}" "${perfout}"
then
echo "Basic annotate [Failed: missing disasm output from default disassembler]"
err=1