Skip to content

Commit 649d828

Browse files
committed
check-sof-logger: fail when there's only the header
Found by chance while testing Zephyr. Signed-off-by: Marc Herbert <[email protected]>
1 parent e525e4e commit 649d828

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test-case/check-sof-logger.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ fi
7474
# '\.c\:[1-9]' to filter like '.c:6' this type keyword like:
7575
# [3017136.770833] (11.302083) c0 SA src/lib/agent.c:65 ERROR validate(), ll drift detected, delta = 25549
7676
fw_log_err=$(grep -i 'error' "$data_file" | grep -v '\.c\:[1-9]')
77+
data_len=$(wc -l < "${data_file}")
7778

7879
# '[[:blank:]]TIMESTAMP.*CONTENT$' to filter the log header:
7980
# TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT
8081
if [[ ! $(sed -n '/[[:blank:]]TIMESTAMP.*CONTENT$/p' "${data_file}") ]]; then
8182
dloge "Log header not found in ${data_file}"
8283
func_logger_exit 1
84+
elif [[ "${data_len}" -lt 2 ]]; then
85+
dloge "Nothing but the header in ${data_file}"
86+
func_logger_exit 1
8387
# we catch error from fw log
8488
elif [[ $fw_log_err ]]; then
8589
dloge "Error(s) found in firmware log ${data_file}"

0 commit comments

Comments
 (0)