-
Notifications
You must be signed in to change notification settings - Fork 59
lib: hijack: use journalctl command to dump kernel information #263
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
Conversation
use journalctl instead of catch information from /var/log/kern.log file 1. DMESG_LOG_START_LINE => CASE_KERNEL_START_TIME 2. with this change, sof-get-kernel-line is not useful, remove it Signed-off-by: Wu, BinX <binx.wu@intel.com>
marc-hb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is CASE_KERNEL_START_TIME simply just a BOOT_TIME="$(uptime -s)"? If yes is it still really needed? --dmesgimplies--boot` so I'm not sure why this is still needed.
What does "hijack" mean or meant here?
| # May 15 21:28:38 MachineName kernel: [ 6.469268] sof-audio-pci 0000:00:0e.0: ipc rx done: 0x90020000: GLB_TRACE_MSG | ||
| if [[ -n "$DMESG_LOG_START_LINE" && "$DMESG_LOG_START_LINE" -ne 0 ]]; then | ||
| tail -n +"$DMESG_LOG_START_LINE" /var/log/kern.log |cut -f5- -d ' ' > "$LOG_ROOT/dmesg.txt" | ||
| if [[ -n "$CASE_KERNEL_START_TIME" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single [ ] are enough for this.
| # catch kern.log last line as current case start line | ||
| if [ ! "$DMESG_LOG_START_LINE" ]; then | ||
| DMESG_LOG_START_LINE=$(wc -l /var/log/kern.log|awk '{print $1;}') | ||
| if [ ! "$CASE_KERNEL_START_TIME" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of the empty expression [ ], do you mind the more explicit [ -n "$CASE_KERNEL_START_TIME" ]? Consistent with hijack.sh above
| $boot_once_flag | ||
| export LOG_ROOT='$(realpath $LOG_ROOT)' | ||
| export DMESG_LOG_START_LINE=$(wc -l /var/log/kern.log|awk '{print $1;}') | ||
| export CASE_KERNEL_START_TIME='$(journalctl --dmesg --no-pager -n 1 |head -n 1|awk '{print $(NF-3)" "$(NF-2);}')' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem to be the kernel start time, did you test this?
Anything wrong with uptime -s?
|
I will close this one as @Bin-QA no longer work on this. |
|
Close with new attempt #468 |
use journalctl instead of catch information from /var/log/kern.log file
Signed-off-by: Wu, BinX binx.wu@intel.com