Skip to content

Commit a794795

Browse files
committed
verify-kernel-boot-log.sh: cap boot logs to 6000 max_lines
Protect storage in case this is not run first and immediately after boot as it should. Also makes the logs more relevant and usable: long files can make the user interface unusable, see example in thesofproject/sof#8761 This also gives us --no-pager "for free" in case it was ever needed. Fixes recent commits c8565e8 and 914c5c0. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent f47c38e commit a794795

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

test-case/verify-kernel-boot-log.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,19 @@ boot_log_exit_handler()
2424
{
2525
local exit_code=$1
2626

27+
# This script is normally run first and immediately after boot. 'max_lines' protects
28+
# storage in case it's not (and debug logs are on!). Long logs also make the user
29+
# interface unresponsive, see example in (unrelated)
30+
# https://github.com/thesofproject/sof/issues/8761.
31+
#
32+
# A typical boot log with SOF debug is 3000 lines, see more numbers in
33+
# detect_log_flood() comments below. Double that to be on the safe side.
34+
local max_lines=6000
35+
2736
# For issues with sound daemons, display, USB, network, NTP, systemd, etc.
28-
journalctl --boot > "$LOG_ROOT"/boot_log.txt
37+
journalctl --boot | head -n "$max_lines" > "$LOG_ROOT"/boot_log.txt
2938
# More focused
30-
journalctl --dmesg > "$LOG_ROOT"/dmesg.txt
39+
journalctl --dmesg | head -n "$max_lines" > "$LOG_ROOT"/dmesg.txt
3140

3241
print_test_result_exit "$exit_code"
3342
}
@@ -174,6 +183,9 @@ detect_log_flood()
174183
# `systemctl --user status org.gnome.Shell@wayland.service`
175184
# as "FAILED" after a couple minutes trying so there's no risk of
176185
# missing the problem.
186+
187+
# If this has to change in the future then 'max_lines' above should
188+
# probably be updated too.
177189
if [ "$recent_lines" -lt 6000 ]; then
178190
return 0
179191
fi

0 commit comments

Comments
 (0)