Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions test-case/check-sof-logger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,21 @@ func_lib_check_sudo

run_loggers()
{
local loggerPID etrace_exit
local etrace_exit

# This test is not really supposed to run while the DSP is busy at
# the same time, so $data_file will hopefully not be long.
local dma_collect_secs=2

dlogi "Trying to get the DMA trace log with background sof-logger ..."
dlogc \
"sudo $loggerBin -t -f 3 -l $ldcFile -o $data_file 2> $error_file &"
sudo "$loggerBin" -t -f 3 -l "$ldcFile" -o "$data_file" 2> "$error_file" & loggerPID=$!
sudo timeout -k 3 --preserve-status "$dma_collect_secs" \
"$loggerBin" -t -f 3 -l "$ldcFile" \
-o "$data_file" 2> "$error_file" & dmaPID=$!

# This test is not really supposed to run while the DSP is busy at
# the same time, so $data_file should be short enough.
sleep 2
sleep "$dma_collect_secs"
wait "$dmaPID"

dlogi "Trying to get the etrace mailbox ..."
dlogc \
Expand All @@ -90,9 +95,6 @@ run_loggers()

printf '\n'

dlogc "kill $loggerPID # DMA trace"
kill "$loggerPID"

return $etrace_exit
}

Expand All @@ -111,9 +113,9 @@ print_logs_exit()
for ftype in data etrace error etrace_stderr; do
printf '\n\n'
bname="logger.$ftype.txt"
dlogi "Log $ftype BEG::"
dlogi "Log file $bname BEG::"
cat "$LOG_ROOT/$bname" || true # we already checked these
dlogi "::END $ftype"
dlogi "::END log file $bname"
done
test -z "$errmsg" || dloge "$errmsg"
exit "$exit_code"
Expand All @@ -132,6 +134,8 @@ main()
if test -s "$stderr_file"; then
print_logs_exit 1 "stderr $stderr_file is not empty"
fi
printf 'GOOD: %s was empty, no stderr output from that sof-logger instance\n' \
logger."$f".txt > "$stderr_file"
done

# Search for the log header, should be something like this:
Expand Down