From: Serhei Makarov Date: Mon, 22 Jun 2026 18:45:08 +0000 (-0400) Subject: tests/*stackprof*: elim flakiness, fix stackprof-subr.sh returns, no debuginfod X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4f46974f880e3da65b4b11fa5bb69df5cfa9735;p=thirdparty%2Felfutils.git tests/*stackprof*: elim flakiness, fix stackprof-subr.sh returns, no debuginfod --- diff --git a/tests/run-stackprof-system-gprof.sh b/tests/run-stackprof-system-gprof.sh index 19e46d16..3c19499d 100755 --- a/tests/run-stackprof-system-gprof.sh +++ b/tests/run-stackprof-system-gprof.sh @@ -26,17 +26,17 @@ type timeout 2>/dev/null || (echo "no timeout installed"; exit 77) check_perf_event_open || (echo "perf_event_open fails (check kernel.perf_event_paranoid + kernel config)"; exit 77) expr `whoami` = "root" || (echo "not running as root"; exit 77) -tempfiles test.out -tempfiles gmon.* +tempfiles test.out gmon.* # run systemwide scan, no gprof output -testrun timeout -p -sINT 10 ${abs_top_builddir}/src/stackprof -v 2>&1 | tee test.out +testrun timeout -p --kill-after=5 10 ${abs_top_builddir}/src/stackprof -v 2>&1 | tee test.out grep "^perf_event_attr configuration" test.out grep "Starting stack profile collection systemwide" test.out grep -E "^[0-9]+ " test.out # -- pid / sample counts entries # run systemwide scan again, with gprof output -testrun timeout -p -sINT 10 ${abs_top_builddir}/src/stackprof -v -g 2>&1 | tee test.out +# reduce verbosity, bump post-processing timeout compared to the first run +testrun timeout -p --kill-after=10 10 ${abs_top_builddir}/src/stackprof -g 2>&1 | tee test.out grep "^perf_event_attr configuration" test.out grep "Starting stack profile collection systemwide" test.out grep -E "^buildid [0-9a-f]+" test.out @@ -45,6 +45,7 @@ stackprof_debuginfod_setup for f in gmon.*.out do + tempfiles "$exe" gprof_output.txt exe="`basename "$f" .out`.exe" if [ ! -f "$exe" ]; then buildid=`echo "$f" | cut -f2 -d.` @@ -55,8 +56,6 @@ do ln -s "`${abs_top_builddir}/debuginfod/debuginfod-find executable $buildid`" "$exe" fi exe_info="$exe (`readlink $exe`)" - tempfiles "$exe" - tempfiles gprof_output.txt # try a plain gprof run on the executable if gprof "$exe" "$f" > gprof_output.txt 2>&1; then echo "$exe_info" diff --git a/tests/stackprof-subr.sh b/tests/stackprof-subr.sh index a75a55d9..7d3bca97 100644 --- a/tests/stackprof-subr.sh +++ b/tests/stackprof-subr.sh @@ -23,12 +23,14 @@ check_perf_event_open() { tempfiles perf-test.out if ! testrun timeout 2 ${abs_top_builddir}/src/stackprof -v -- /bin/true > perf-test.out 2>&1; then if grep -q "perf_event_open.*failed\|Operation note permitted\|Permission denied"; then - exit 77 + return 77 fi fi + return 0 } stackprof_debuginfod_setup() { # TODO non networked version - export DEBUGINFOD_URLS=https://debuginfod.elfutils.org/ + #export DEBUGINFOD_URLS=https://debuginfod.elfutils.org/ + return 0 }