numam-spdk/test/nvme/spdk_nvme_cli.sh
Pawel Wodkowski 848daf274b log: add backtrace option
Add '--enable-log-bt=lvl' option to show simple backtrace in following
form:

thread.c: 346:spdk_io_device_register: *ERROR*: io_device 0xf2ef80
already registered
*ERROR*: === BACKTRACE START ===
*ERROR*:   1: spdk_io_device_register() at 0x6d64df
*ERROR*:   2:  spdk_copy_engine_initialize() at 0x71059c
*ERROR*:   3:   spdk_copy_engine_subsystem_initialize() at 0x572ed0
*ERROR*:   4:    spdk_subsystem_init_next() at 0x6ca756
*ERROR*:   5:     spdk_subsystem_verify() at 0x6caba7
*ERROR*:   6:      _spdk_event_queue_run_batch() at 0x6c1ffa
*ERROR*:   7:       _spdk_reactor_run() at 0x6c5349
*ERROR*:   8:        spdk_reactors_start() at 0x6c784f
*ERROR*:   9:         spdk_app_start() at 0x6bf18e
*ERROR*: === BACKTRACE END ===

This adds additional libunwind dependency so don't enable by default.

Change-Id: Ice93d7571a000d8a57d2fedda7670c9a0b6ff7b7
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/419726
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-25 15:48:25 +00:00

63 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -ex
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/scripts/common.sh
source $rootdir/test/common/autotest_common.sh
if [ -z "${DEPENDENCY_DIR}" ]; then
echo DEPENDENCY_DIR not defined!
exit 1
fi
spdk_nvme_cli="${DEPENDENCY_DIR}/nvme-cli"
if [ ! -d $spdk_nvme_cli ]; then
echo "nvme-cli repository not found at $spdk_nvme_cli; skipping tests."
exit 0
fi
timing_enter nvme_cli
if [ `uname` = Linux ]; then
start_stub "-s 2048 -i 0 -m 0xF"
trap "kill_stub; exit 1" SIGINT SIGTERM EXIT
fi
# Build against the version of SPDK under test
rm -f "$spdk_nvme_cli/spdk"
ln -sf "$rootdir" "$spdk_nvme_cli/spdk"
bdfs=$(iter_pci_class_code 01 08 02)
bdf=$(echo $bdfs|awk '{ print $1 }')
if [[ -s $rootdir/CONFIG.local ]] && grep CONFIG_LOG_BACKTRACE $rootdir/CONFIG.local -q; then
nvme_cli_ldflags='LDFLAGS=-lunwind'
fi
cd $spdk_nvme_cli
make clean && make -j$(nproc) $nvme_cli_ldflags
sed -i 's/spdk=0/spdk=1/g' spdk.conf
sed -i 's/shm_id=1/shm_id=0/g' spdk.conf
./nvme list
./nvme id-ctrl $bdf
./nvme list-ctrl $bdf
./nvme get-ns-id $bdf
./nvme id-ns $bdf
./nvme fw-log $bdf
./nvme smart-log $bdf
./nvme error-log $bdf
./nvme list-ns $bdf -n 1
./nvme get-feature $bdf -n 1 -f 1 -s 1 -l 100
./nvme get-log $bdf -n 1 -i 1 -l 100
./nvme reset $bdf
if [ `uname` = Linux ]; then
trap - SIGINT SIGTERM EXIT
kill_stub
fi
report_test_completion spdk_nvme_cli
timing_exit nvme_cli