@@ -83,6 +83,9 @@ minvalue() { printf '%d' $(( "$1" < "$2" ? "$1" : "$2" )); }
8383#
8484start_test ()
8585{
86+ setup_kernel_check_point
87+ func_kmsg_collect
88+
8689 if [ " $SOF_TEST_PIPEWIRE " == true ]; then
8790 func_lib_enable_pipewire
8891 fi
@@ -125,7 +128,6 @@ start_test()
125128 die " FW is not loaded for $MAX_WAIT_FW_LOADING "
126129 fi
127130 }
128- func_kmsg_collect
129131
130132 export SOF_TEST_TOP_PID=" $$ "
131133 local prefix; prefix=" ktime=$( ktime) sof-test PID=${SOF_TEST_TOP_PID} "
@@ -158,7 +160,6 @@ start_test()
158160 local start_msg=" $prefix : starting"
159161 dlogi " $start_msg "
160162 logger -p user.info " $start_msg "
161-
162163}
163164
164165# See high-level description in start_test header above
@@ -201,11 +202,8 @@ stop_test()
201202
202203finish_kmsg_collection ()
203204{
204- if [[ -n " $DMESG_PID " ]]; then
205- kill " $DMESG_PID " 2> /dev/null
206- wait " $DMESG_PID " 2> /dev/null
207- unset KERNEL_CHECKPOINT
208- fi
205+ dlogi " Finishing dmesg collection"
206+ sudo pkill -9 journalctl
209207
210208 local journalctl_logs=" $LOG_ROOT /dmesg.txt"
211209 if test -s " ${journalctl_logs} " ; then
@@ -297,7 +295,9 @@ setup_kernel_check_point()
297295 # appear in the next one, see comments in config.sh. Add 3 extra
298296 # second to account for our own, sof-test delays after PASS/FAIL
299297 # decision: time spent collecting logs etc.
300- if [ -z " $KERNEL_CHECKPOINT " ]; then
298+ if [[ " $KERNEL_CHECKPOINT " == " disabled" ]]; then
299+ dlogi " KERNEL_CHECKPOINT already set as DISABLED"
300+ elif [ -z " $KERNEL_CHECKPOINT " ]; then
301301 KERNEL_CHECKPOINT=$(( $(date +% s) - SOF_TEST_INTERVAL - 3 ))
302302 else
303303 # Not the first time we are called so this is a test
@@ -436,15 +436,12 @@ func_kmsg_collect() {
436436 dlogi " Saving kernel messages since ${KERNEL_CHECKPOINT} to ${journalctl_logs} "
437437 journalctl_cmd --since=@" $KERNEL_CHECKPOINT " -f >> " ${journalctl_logs} " &
438438 elif [[ " $KERNEL_CHECKPOINT " == " disabled" ]]; then
439- dlogi " Saving all kernel messages"
439+ dlogi " KERNEL_CHECKPOINT set as DISABLED, saving all kernel messages"
440440 journalctl_cmd -f >> " ${journalctl_logs} " &
441441 else
442- dloge ' Kernel check point "KERNEL_CHECKPOINT" is not properly set'
443- dloge " KERNEL_CHECKPOINT=$KERNEL_CHECKPOINT "
444- test " $exit_status " -ne 0 || exit_status=1
445- return
442+ dlogi " KERNEL_CHECKPOINT is not properly set, saving all kernel messages"
443+ journalctl_cmd -f >> " ${journalctl_logs} " &
446444 fi
447- DMESG_PID=$!
448445}
449446
450447func_lib_log_post_process ()
0 commit comments