This is an automated email from the git hooks/post-receive script.
bernie.ogden pushed a commit to branch remove_hackingisms in repository toolchain/semiautobench.
commit 6624e561f4965999b09849e3b3f8387a3e8023de Author: Bernard Ogden bernie.ogden@linaro.org Date: Mon Jul 27 09:22:21 2015 +0200
Create debug mode
Wrap script in tmux, so that we can attach on failure. Disable status bar so that console output isn't full of escape codes.
Trap exits so that, if BENCH_DEBUG is set, we do not exit.
The two together let us log in, attach to tmux session and suspend. We can then debug in the environment where the error occurred.
Change-Id: I0d508e8f77b6ece882913a876f2ebd5054301cb4 --- bench-session-debian.yaml | 3 ++- invoke_session_debian | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/bench-session-debian.yaml b/bench-session-debian.yaml index fcd9dd4..0aa22bf 100644 --- a/bench-session-debian.yaml +++ b/bench-session-debian.yaml @@ -12,6 +12,7 @@ params: TOOLCHAIN: https://releases.linaro.org/14.11/components/toolchain/binaries/arm [...] RUN_FLAGS: None COMPILER_FLAGS: None + BENCH_DEBUG: None
install: deps: @@ -36,4 +37,4 @@ install: run: steps: - ./setup_session_debian "$PUB_KEY" - - ./invoke_session_debian "$GATEWAY" "$ABE_BRANCH" "$BENCHMARK" "$TOOLCHAI [...] + - env BENCH_DEBUG="$BENCH_DEBUG" tmux start-server; set -g status off; n [...] diff --git a/invoke_session_debian b/invoke_session_debian index fe835e0..90ce64f 100755 --- a/invoke_session_debian +++ b/invoke_session_debian @@ -5,15 +5,25 @@ set -o pipefail
error=1
-trap "rm -rf ~/*; exit ${error}" EXIT +function exitfunc { + if test ${error} -ne 0; then + if test x"${BENCH_DEBUG}" != x && test x"${BENCH_DEBUG}" != xNone; then + sleep infinity + fi + fi + rm -rf ~/* + exit ${error} +} + +trap exitfunc EXIT
# Hack for now until lava-test-shell is smart enough to know it's dispatcher ip gateway=$1 abe_branch="$2"
#these parameters used by Benchmark.job -export benchmark="$3" -export toolchain="$4" +export benchmark="${3:?Must set a benchmark}" +export toolchain="${4:?Must set a toolchain}" if test x"$5" = xNone; then export run_flags= else