@@ -118,14 +118,12 @@ start_test()
118118 # Only start the polling for firmware boot complete when SOF soundcard is not available
119119 # setup_kernel_check_point has already -1 second to avoid TOCTOU race condition
120120 [ -n " $NO_POLL_FW_LOADING " ] || is_sof_used || {
121- setup_kernel_check_point
122121 if poll_wait_for 1 " $MAX_WAIT_FW_LOADING " sof_firmware_boot_complete --since=@" $KERNEL_CHECKPOINT " ; then
123122 dlogi " Good to start the test, FW is loaded!"
124123 else
125124 die " FW is not loaded for $MAX_WAIT_FW_LOADING "
126125 fi
127126 }
128- func_kmsg_collect
129127
130128 export SOF_TEST_TOP_PID=" $$ "
131129 local prefix; prefix=" ktime=$( ktime) sof-test PID=${SOF_TEST_TOP_PID} "
@@ -159,6 +157,8 @@ start_test()
159157 dlogi " $start_msg "
160158 logger -p user.info " $start_msg "
161159
160+ setup_kernel_check_point
161+ func_kmsg_collect
162162}
163163
164164# See high-level description in start_test header above
@@ -201,11 +201,8 @@ stop_test()
201201
202202finish_kmsg_collection ()
203203{
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
204+ dlogi " Finishing dmesg collection"
205+ sudo pkill -9 journalctl
209206
210207 local journalctl_logs=" $LOG_ROOT /dmesg.txt"
211208 if test -s " ${journalctl_logs} " ; then
@@ -435,14 +432,9 @@ func_kmsg_collect() {
435432 if [[ " $KERNEL_CHECKPOINT " =~ ^[0-9]{10} ]]; then
436433 dlogi " Saving kernel messages since ${KERNEL_CHECKPOINT} to ${journalctl_logs} "
437434 journalctl_cmd --since=@" $KERNEL_CHECKPOINT " -f >> " ${journalctl_logs} " &
438- elif [[ " $KERNEL_CHECKPOINT " == " disabled" ]]; then
439- dlogi " Saving all kernel messages"
440- journalctl_cmd -f >> " ${journalctl_logs} " &
441435 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
436+ dlogi " KERNEL_CHECKPOINT is not properly set, saving all kernel messages"
437+ journalctl_cmd -f >> " ${journalctl_logs} " &
446438 fi
447439 DMESG_PID=$!
448440}
0 commit comments