Skip to content

Commit d00eab5

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 25c298d commit d00eab5

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
@@ -24,7 +24,8 @@ function func_exit_handler()
2424
fi
2525

2626
# when sof logger collect is open
27-
if [ "X$SOF_LOG_COLLECT" == "X1" ]; then
27+
if [ ! is_ipc4 ] && [ "X$SOF_LOG_COLLECT" == "X1" ]; then
28+
local loggerBin wcLog; loggerBin=sof-logger
2829
# when error occurs, exit and catch etrace log
2930
[[ $exit_status -eq 1 ]] && {
3031
func_lib_start_log_collect 1
@@ -54,7 +55,6 @@ function func_exit_handler()
5455
# shellcheck disable=SC2154
5556
logfile="$logfile"
5657

57-
local loggerBin wcLog; loggerBin=$(basename "$SOFLOGGER")
5858
# We need this to avoid the confusion of a "Terminated" message
5959
# without context.
6060
dlogi "pkill -TERM $loggerBin"
@@ -100,6 +100,15 @@ function func_exit_handler()
100100

101101
fi
102102

103+
if [ is_ipc4 ] && [ is_firmware_file_zephyr ]; then
104+
local mtraceBin; mtraceBin=mtrace-reader.py
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)