-
Notifications
You must be signed in to change notification settings - Fork 59
tools: sof-kernel-log-check: use journalctl command to query kernel log #262
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 command instead of query the begin line from /var/log/kern.log file Signed-off-by: Wu, BinX <binx.wu@intel.com>
| { | ||
| # shellcheck disable=SC2034 # external script will use it | ||
| KERNEL_LAST_LINE=$(wc -l /var/log/kern.log|awk '{print $1;}') | ||
| KERNEL_LAST_LINE=$(journalctl --dmesg --no-pager -n 1 -o short-iso-precise|awk '/kernel/ {print $1;}') |
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.
On my system this prints the boot time (uptime -s) which doesn't seem to match what was before.
Should this simply be KERNEL_LAST_LINE=$(date)?
I like that you're trying to save a lot of changed lines by keeping the KERNEL_LAST_LINE name the same, however there should be a big fat warning comment saying "This is not a line anymore"
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 rename the whole thing as KERNEL_LAST_TIMESTAMP in PR #354
|
|
||
| if [ "$ignore_str" ]; then | ||
| err=$(eval $cmd|grep 'Call Trace' -A5 -B3)$(eval $cmd | grep $project_key | grep -E "$err_str"|grep -vE "$ignore_str") | ||
| err=$("$cmd" |grep 'Call Trace' -A5 -B3)$("$cmd" | grep $project_key | grep -E "$err_str"|grep -vE "$ignore_str") |
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.
Please submit these cleanups first and separately so they don't noise the functional changes later.
| KERNEL_LAST_LINE=$(wc -l /var/log/kern.log|awk '{print $1;}') | ||
| KERNEL_LAST_LINE=$(journalctl --dmesg --no-pager -n 1 -o short-iso-precise|awk '/kernel/ {print $1;}') | ||
| KERNEL_LAST_LINE=${KERNEL_LAST_LINE:0:-5} | ||
| KERNEL_LAST_LINE=${KERNEL_LAST_LINE/T/ } |
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.
There should be a comment explaining what this removes and why. It's surprising to drop such a critical piece of information.
|
I will close this one as @Bin-QA no longer work on this. |
|
@plbossart is undeterred in #354 |
|
This PR would not work anyways because there are still tons of 'sudo dmesg -C' everywhere. |
use journalctl command instead of query the begin line from /var/log/kern.log file
Signed-off-by: Wu, BinX binx.wu@intel.com