Skip to content

Commit 379bd1d

Browse files
committed
hijack.sh: kill the mtrace after test
Need to kill the mtrace-reader.py process after the test to prevent the conflicts between each case. Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com>
1 parent 035a92f commit 379bd1d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

case-lib/hijack.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ trap 'func_exit_handler $?' EXIT
77
function func_exit_handler()
88
{
99
local exit_status=${1:-0}
10+
local loggerBin wcLog; loggerBin=sof-logger
11+
local mtraceBin; mtraceBin=mtrace-reader.py
1012

1113
# call trace
1214
if [ "$exit_status" -ne 0 ] ; then
@@ -24,7 +26,7 @@ function func_exit_handler()
2426
fi
2527

2628
# when sof logger collect is open
27-
if [ "X$SOF_LOG_COLLECT" == "X1" ]; then
29+
if [ "X$SOF_LOG_COLLECT" == "X1" ] && ! is_ipc4_zephyr; then
2830
# when error occurs, exit and catch etrace log
2931
[[ $exit_status -eq 1 ]] && {
3032
func_lib_start_log_collect 1
@@ -54,7 +56,6 @@ function func_exit_handler()
5456
# shellcheck disable=SC2154
5557
logfile="$logfile"
5658

57-
local loggerBin wcLog; loggerBin=$(basename "$SOFLOGGER")
5859
# We need this to avoid the confusion of a "Terminated" message
5960
# without context.
6061
dlogi "pkill -TERM $loggerBin"
@@ -100,6 +101,14 @@ function func_exit_handler()
100101

101102
fi
102103

104+
if is_ipc4_zephyr; then
105+
dlogi "pkill -TERM -f $mtraceBin"
106+
sudo pkill -TERM -f "$mtraceBin" || {
107+
dloge "mtrace-reader.py was already dead"
108+
exit_status=1
109+
}
110+
fi
111+
103112
stop_test || exit_status=1
104113

105114
if [ "$ENABLE_STORAGE_CHECKS" = '1' ]; then

0 commit comments

Comments
 (0)