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: fix missing boot logs on failure #1191

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions case-lib/hijack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
SUDO_CMD=$(command -v sudo)

# Overwrite other functions' exit to perform environment cleanup
#
# TODO: split this into smaller functions that "special" test cases can
# re-use separately instead of all this or nothing.
function func_exit_handler()
{
local exit_status=${1:-0}
Expand Down
14 changes: 10 additions & 4 deletions test-case/verify-kernel-boot-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ set -e
# shellcheck source=case-lib/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh

start_test
# TODO: replace start_test with this:
# trap 'print_test_result_exit $?' EXIT
# https://github.com/thesofproject/sof-test/issues/1112
trap 'boot_log_exit_handler $?' EXIT

boot_log_exit_handler()
{
local exit_code=$1

journalctl --boot > "$LOG_ROOT"/boot_log.txt
Copy link
Collaborator

@fredoh9 fredoh9 May 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I don't pay attention to user space log at boot. What can we expect more clues from user space log?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What can we expect more clues from user space log?

If you look at some examples, you'll see the added volume is low compared to SOF debug logs. One example on a fresh boot:

root@jf-lnlm-rvp-nocodec-3:~# journalctl -k | wc -l
1857
root@jf-lnlm-rvp-nocodec-3:~# journalctl -b | wc -l
2313

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more after looking at diff -u <(journalctl -k) <(journalctl -b) | less

  • Network initialization
  • NTP init
  • sensors stuff (thermal)
  • other systemd logs


print_test_result_exit "$exit_code"
}

main()
{
Expand Down
Loading