-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -191,9 +191,8 @@ func_lib_get_tplg_path() | |
| return 0 | ||
| } | ||
|
|
||
| # force ask buffer data write into file system | ||
| sudo sync -f | ||
| # 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a fan of the empty expression |
||
| # format time stamp output for journalctl command | ||
| func_lib_setup_kernel_last_time | ||
| CASE_KERNEL_START_TIME="$KERNEL_LAST_TIME" | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,14 +144,14 @@ sudo chown $UID $boot_file | |
| old_content="$(cat $boot_file|grep -v '^exit')" | ||
| # write the information to /etc/rc.local | ||
| # LOG_ROOT to make sure all tests, including sub-cases, write log to the same target folder | ||
| # DMESG_LOG_START_LINE to just keep last kernel bootup log | ||
| # CASE_KERNEL_START_TIME to just keep last kernel bootup log | ||
| boot_once_flag=$(realpath $(which sof-boot-once.sh)) | ||
| cat << END > $boot_file | ||
| $old_content | ||
|
|
||
| $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);}')' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| bash -c '$full_cmd' | ||
|
|
||
| exit 0 | ||
|
|
||
This file was deleted.
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.