From 7d4f7b7f0154ea493971650fe9f81a813b3b38b4 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 30 Aug 2022 11:40:12 +0200 Subject: [PATCH] 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 Change-Id: Ib6e0b740b616284bda48ed82d92ac32236acaa3d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14261 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- test/common/autotest_common.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 530988490..545c8cde8 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -1325,6 +1325,25 @@ function autotest_cleanup() { rm -rf "${storage_fallback_purge[@]}" 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 return $autotest_es }