test/common: Include list of running processes upon failure

This is done in order to have a bigger picture on the state of the
system (especially the phy nodes) when the autotest suite fails.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ib6e0b740b616284bda48ed82d92ac32236acaa3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14261
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Michal Berger 2022-08-30 11:40:12 +02:00 committed by Tomasz Zawadzki
parent 004ab98dac
commit 7d4f7b7f01

View File

@ -1325,6 +1325,25 @@ function autotest_cleanup() {
rm -rf "${storage_fallback_purge[@]}" rm -rf "${storage_fallback_purge[@]}"
fi fi
if ((autotest_es)); then
if [[ $(uname) == FreeBSD ]]; then
ps aux
elif [[ $(uname) == Linux ]]; then
# Get more detailed view
grep . /proc/[0-9]*/status
# Dump some extra info into kernel log
echo "######## Autotest Cleanup Dump ########" > /dev/kmsg
# Show cpus backtraces
echo l > /proc/sysrq-trigger
# Show mem usage
echo m > /proc/sysrq-trigger
# show task states
echo t > /proc/sysrq-trigger
# show blocked tasks
echo w > /proc/sysrq-trigger
fi > "$output_dir/proc_list.txt" 2>&1 || :
fi
xtrace_restore xtrace_restore
return $autotest_es return $autotest_es
} }