test.sh (861B)
1 #!/bin/bash 2 # 3 # test.sh - Check flame graph software vs test result files. 4 # 5 # This is used to detect regressions in the flame graph software. 6 # See record-test.sh, which refreshes these files after intended software 7 # changes. 8 # 9 # Currently only tests stackcollapse-perf.pl. 10 11 set -euo pipefail 12 set -x 13 set -v 14 15 # ToDo: add some form of --inline, and --inline --context tests. These are 16 # tricky since they use addr2line, whose output will vary based on the test 17 # system's binaries and symbol tables. 18 for opt in pid tid kernel jit all addrs; do 19 for testfile in test/*.txt ; do 20 echo testing $testfile : $opt 21 outfile=${testfile#*/} 22 outfile=test/results/${outfile%.txt}"-collapsed-${opt}.txt" 23 perl ./stackcollapse-perf.pl --"${opt}" "${testfile}" 2> /dev/null | diff -u - "${outfile}" 24 perl ./flamegraph.pl "${outfile}" > /dev/null 25 done 26 done