Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify-kernel-boot-log.sh: cap boot logs to 6000 max_lines #1195

Merged
merged 1 commit into from
May 16, 2024
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
16 changes: 14 additions & 2 deletions test-case/verify-kernel-boot-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ boot_log_exit_handler()
{
local exit_code=$1

# This script is normally run first and immediately after boot. 'max_lines' protects
# storage in case it's not (and debug logs are on!). Long logs also make the user
# interface unresponsive, see example in (unrelated)
# https://github.com/thesofproject/sof/issues/8761.
#
# A typical boot log with SOF debug is 3000 lines, see more numbers in
# detect_log_flood() comments below. Double that to be on the safe side.
local max_lines=6000

# For issues with sound daemons, display, USB, network, NTP, systemd, etc.
journalctl --boot > "$LOG_ROOT"/boot_log.txt
journalctl --boot | head -n "$max_lines" > "$LOG_ROOT"/boot_log.txt
# More focused
journalctl --dmesg > "$LOG_ROOT"/dmesg.txt
journalctl --dmesg | head -n "$max_lines" > "$LOG_ROOT"/dmesg.txt

print_test_result_exit "$exit_code"
}
Expand Down Expand Up @@ -174,6 +183,9 @@ detect_log_flood()
# `systemctl --user status [email protected]`
# as "FAILED" after a couple minutes trying so there's no risk of
# missing the problem.

# If this has to change in the future then 'max_lines' above should
# probably be updated too.
if [ "$recent_lines" -lt 6000 ]; then
return 0
fi
Expand Down
Loading