Commit af32aa1b authored by Karol Latecki's avatar Karol Latecki Committed by Ben Walker
Browse files

test/nvmf: enable tracepoints for nvmf_tgt



Enable tracepoints and move shm file to
the output directory in case of crash.
Cleanup all shm files after successful run.

Change-Id: Ie46c86ddda71015038624f9b2b5fd4a3e1d7f61f
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/425078


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent f0a2cc82
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -264,6 +264,30 @@ function process_core() {
	return $ret
}

function process_shm() {
	type=$1
	id=$2
	if [ "$type" = "--pid" ]; then
		id="pid${id}"
	elif [ "$type" = "--id" ]; then
		id="${id}"
	else
		echo "Please specify to search for pid or shared memory id."
		return 1
	fi

	shm_files=$(find /dev/shm -name "*.${id}" -printf "%f\n")

	if [[ -z $shm_files ]]; then
		echo "SHM File for specified PID or shared memory id: ${id} not found!"
		return 1
	fi
	for n in $shm_files; do
		tar -C /dev/shm/ -cvzf $output_dir/${n}_shm.tar.gz ${n}
	done
	return 0
}

function waitforlisten() {
	# $1 = process pid
	if [ -z "$1" ]; then
@@ -652,6 +676,7 @@ function get_bdev_size()
function autotest_cleanup()
{
	$rootdir/scripts/setup.sh reset
	$rootdir/scripts/setup.sh cleanup
}

function freebsd_update_contigmem_mod()
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!

trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT

waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!

trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT

waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ for incapsule in 0 4096; do
	$NVMF_APP -m 0xF --wait-for-rpc &
	nvmfpid=$!

	trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
	trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT

	waitforlisten $nvmfpid
	$rpc_py set_nvmf_target_options -u 8192 -p 4 -c $incapsule
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!

trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT

waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4
Loading