@@ -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
@@ -118,14 +121,12 @@ start_test()
118121 # Only start the polling for firmware boot complete when SOF soundcard is not available
119122 # setup_kernel_check_point has already -1 second to avoid TOCTOU race condition
120123 [ -n " $NO_POLL_FW_LOADING " ] || is_sof_used || {
121- setup_kernel_check_point
122124 if poll_wait_for 1 " $MAX_WAIT_FW_LOADING " sof_firmware_boot_complete --since=@" $KERNEL_CHECKPOINT " ; then
123125 dlogi " Good to start the test, FW is loaded!"
124126 else
125127 die " FW is not loaded for $MAX_WAIT_FW_LOADING "
126128 fi
127129 }
128- func_kmsg_collect
129130
130131 export SOF_TEST_TOP_PID=" $$ "
131132 local prefix; prefix=" ktime=$( ktime) sof-test PID=${SOF_TEST_TOP_PID} "
@@ -158,7 +159,6 @@ start_test()
158159 local start_msg=" $prefix : starting"
159160 dlogi " $start_msg "
160161 logger -p user.info " $start_msg "
161-
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