Skip to content

Commit 00a3dbd

Browse files
committed
fix dmesg collecting
Signed-off-by: Emilia Kurdybelska <emiliax.kurdybelska@intel.com>
1 parent 8faa3b8 commit 00a3dbd

40 files changed

+8
-62
lines changed

case-lib/lib.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ minvalue() { printf '%d' $(( "$1" < "$2" ? "$1" : "$2" )); }
8383
#
8484
start_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

202203
finish_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
@@ -435,14 +433,9 @@ func_kmsg_collect() {
435433
if [[ "$KERNEL_CHECKPOINT" =~ ^[0-9]{10} ]]; then
436434
dlogi "Saving kernel messages since ${KERNEL_CHECKPOINT} to ${journalctl_logs}"
437435
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}" &
441436
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
437+
dlogi "KERNEL_CHECKPOINT is not properly set, saving all kernel messages"
438+
journalctl_cmd -f >> "${journalctl_logs}" &
446439
fi
447440
DMESG_PID=$!
448441
}

test-case/check-8bit-play-rec.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ main()
116116

117117
logger_disabled || func_lib_start_log_collect
118118

119-
setup_kernel_check_point
120119
func_lib_check_sudo
121120
func_pipeline_export "$tplg" "type:any"
122121

test-case/check-alsa-conformance.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,6 @@ main()
325325
{
326326
init_globals
327327

328-
setup_kernel_check_point
329-
330328
start_test
331329

332330
check_alsa_conformance_suite

test-case/check-alsabat.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ OPT_NAME['s']='sof-logger' OPT_DESC['s']="Open sof-logger trace the data wi
6161
OPT_HAS_ARG['s']=0 OPT_VAL['s']=1
6262

6363
func_opt_parse_option "$@"
64-
setup_kernel_check_point
6564

6665
pcm_p=${OPT_VAL['p']}
6766
pcm_c=${OPT_VAL['c']}

test-case/check-audio-equalizer.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func_pipeline_export "$tplg" "eq:any"
4444
sofcard=${SOFCARD:-0}
4545

4646
start_test
47-
setup_kernel_check_point
4847

4948
# Test equalizer
5049
func_test_eq()

test-case/check-capture.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ if [[ -n "$new_tplg_filename" && "$TPLG" != *nocodec* ]]; then
7575
fi
7676
logger_disabled || func_lib_start_log_collect
7777

78-
setup_kernel_check_point
7978
func_lib_check_sudo
8079
func_pipeline_export "$tplg" "type:capture & ${OPT_VAL['S']}"
8180

test-case/check-float-play-rec.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ main()
9191

9292
logger_disabled || func_lib_start_log_collect
9393

94-
setup_kernel_check_point
9594
func_lib_check_sudo
9695
func_pipeline_export "$tplg" "type:any"
9796

test-case/check-fw-echo-reference.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ start_test
4444
logger_disabled || func_lib_start_log_collect
4545

4646
func_pipeline_export "$tplg" "echo:any"
47-
setup_kernel_check_point
4847

4948
if [ "$PIPELINE_COUNT" != "2" ]; then
5049
die "Only detect $PIPELINE_COUNT pipeline(s) from topology, but two are needed"

test-case/check-ipc-flood.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ OPT_NAME['l']='loop' OPT_DESC['l']='loop count'
2828
OPT_HAS_ARG['l']=1 OPT_VAL['l']=1
2929

3030
func_opt_parse_option "$@"
31-
setup_kernel_check_point
3231

3332
lpc_loop_cnt=${OPT_VAL['c']}
3433
ipc_flood_dfs=${OPT_VAL['f']}

test-case/check-keyword-detection.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ OPT_NAME['d']='duration' OPT_DESC['d']='interrupt kwd pipeline in # sec
4444
OPT_HAS_ARG['d']=1 OPT_VAL['d']=10
4545

4646
func_opt_parse_option "$@"
47-
setup_kernel_check_point
4847

4948
tplg=${OPT_VAL['t']}
5049
loop_cnt=${OPT_VAL['l']}

0 commit comments

Comments
 (0)