aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Richter <[email protected]>2024-09-17 10:57:06 +0200
committerNamhyung Kim <[email protected]>2024-09-26 23:42:46 -0700
commitb38c49d8296b9eee1ffb6471853d542fd76de2fb (patch)
treefd2dc4aa7decb8498bbe6013f2ae17e7eab0c945
parent4f23fc34cc68812c68c3a3dec15e26e87565f430 (diff)
perf/test: Speed up test case perf annotate basic tests
perf test 70 takes a long time. One culprit is the output of command perf annotate. Per default enabled are - demangle symbol names - interleave source code with assembly code. Disable demangle of symbols and abort the annotation after the first 250 lines. This speeds up the test case considerable, for example on s390: Output before: # time perf test 70 70: perf annotate basic tests : Ok ..... real 2m7.467s user 1m26.869s sys 0m34.086s # Output after: # time perf test 70 70: perf annotate basic tests : Ok real 0m3.341s user 0m1.606s sys 0m0.362s # Signed-off-by: Thomas Richter <[email protected]> Reviewed-by: James Clark <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
-rwxr-xr-xtools/perf/tests/shell/annotate.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/tests/shell/annotate.sh b/tools/perf/tests/shell/annotate.sh
index 2ccf4f1d46b6..1590a37363de 100755
--- a/tools/perf/tests/shell/annotate.sh
+++ b/tools/perf/tests/shell/annotate.sh
@@ -44,7 +44,7 @@ test_basic() {
fi
# Generate the annotated output file
- perf annotate -i "${perfdata}" --stdio 2> /dev/null > "${perfout}"
+ perf annotate --no-demangle -i "${perfdata}" --stdio 2> /dev/null | head -250 > "${perfout}"
# check if it has the target symbol
if ! grep "${testsym}" "${perfout}"
@@ -63,8 +63,8 @@ test_basic() {
fi
# check again with a target symbol name
- if ! perf annotate -i "${perfdata}" "${testsym}" 2> /dev/null | \
- grep -m 3 "${disasm_regex}"
+ if ! perf annotate --no-demangle -i "${perfdata}" "${testsym}" 2> /dev/null | \
+ head -250 | grep -m 3 "${disasm_regex}"
then
echo "Basic annotate [Failed: missing disasm output when specifying the target symbol]"
err=1
@@ -72,8 +72,8 @@ test_basic() {
fi
# check one more with external objdump tool (forced by --objdump option)
- if ! perf annotate -i "${perfdata}" --objdump=objdump 2> /dev/null | \
- grep -m 3 "${disasm_regex}"
+ if ! perf annotate --no-demangle -i "${perfdata}" --objdump=objdump 2> /dev/null | \
+ head -250 | grep -m 3 "${disasm_regex}"
then
echo "Basic annotate [Failed: missing disasm output from non default disassembler (using --objdump)]"
err=1