Commit 7d4f7b7f authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

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: default avatarMichal Berger <michal.berger@intel.com>
Change-Id: Ib6e0b740b616284bda48ed82d92ac32236acaa3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14261


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 004ab98d
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -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
}