autotest: Add source and line number to PS4 prompt

Trace details are written out only when test fails, but sometimes
it's hard to determine from which script and what particular line
given command is being executed during the actual runtime of the
test. This should make it a bit easier. The log lines would look
like this:

-- common/autotest_common.sh@1217 -- # uname -s

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iac6973f986e6c553f39e5a9c909ccabf607251f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8756
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Michal Berger 2021-07-13 12:12:39 +02:00 committed by Tomasz Zawadzki
parent 8dace9e26c
commit 8b19bc2383

View File

@ -1404,7 +1404,7 @@ set -o errtrace
shopt -s extdebug
trap "trap - ERR; print_backtrace >&2" ERR
PS4=' \t \$ '
PS4=' \t -- ${BASH_SOURCE#*test/}@${LINENO} -- \$ '
if $SPDK_AUTOTEST_X; then
# explicitly enable xtraces, overriding any tracking information.
unset XTRACE_DISABLED