From 29d065e1db9baded6e97b2556b4e36e72522167d Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 22 Apr 2021 22:14:57 -0700 Subject: [PATCH] hijack.sh: make late logger config changes to nudge stuck DMA traces There are bugs that cause DMA drops and the last few lines to get stuck somewhere. Changing the logger configuration and waiting for 1 second seems to be enough to nudge the system and force it to DMA a bit more logs: hopefully all the logs relevant to the current test. Running this logger configuration command twice makes it very easy to observe the stuck lines bug: the "ipc" logs corresponding to this -F command will appear _only once_ at the end of the slogger.txt DMA trace! Signed-off-by: Marc Herbert --- case-lib/hijack.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/case-lib/hijack.sh b/case-lib/hijack.sh index f38fa9a1..06d6fa6b 100644 --- a/case-lib/hijack.sh +++ b/case-lib/hijack.sh @@ -31,6 +31,23 @@ function func_exit_handler() sleep 1s } + # There are bugs that cause DMA drops and the last few lines to + # get stuck somewhere. This hack seems to be enough to nudge the + # system and force it to DMA a bit more logs: hopefully all the + # logs relevant to the current test. + # We must use a component that is available everywhere: pga + for i in 1 2; do + # Running this twice makes it very easy to observe the stuck + # lines bug: the "ipc" logs corresponding to this -F command + # will appear _only once_ at the end of the slogger.txt DMA + # trace! + sudo "$SOFLOGGER" -l "$(find_ldc_file)" -F info=pga > /dev/null || + test "$exit_status" -ne 0 || exit_status=1 + done + # We _also_ need to wait for the trace_work() thread to run; + # BOTH are needed. The bug is not just a delay. + sleep 1 + local loggerBin wcLog; loggerBin=$(basename "$SOFLOGGER") # We need this to avoid the confusion of a "Terminated" message # without context.