-
Notifications
You must be signed in to change notification settings - Fork 59
Use journalctl for log collection and remove dependency on /var/log/kern.log #639
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 |
|---|---|---|
|
|
@@ -40,10 +40,11 @@ if [ ! "$SOFCARD" ]; then | |
| awk '/sof-[a-z]/ && $1 ~ /^[0-9]+$/ { $1=$1; print $1; exit 0;}') | ||
| fi | ||
|
|
||
| func_lib_setup_kernel_checkpoint() | ||
| setup_kernel_check_point() | ||
| { | ||
| # shellcheck disable=SC2034 # external script will use it | ||
| KERNEL_CHECKPOINT=$(date +%s) | ||
| # There is a 5s delay between two cases by sof-framework, | ||
| # make the check point 5s earlier to avoid log loss. | ||
| export KERNEL_CHECKPOINT=$(($(date +%s) - 5)) | ||
|
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. This still belong to a different PR but OK, it's in a different commit and it's a small enough change. Small in number of lines, not in consequences... Can you please
|
||
| } | ||
|
|
||
| # This function adds a fake error to dmesg (which is always saved by | ||
|
|
@@ -326,13 +327,6 @@ die() | |
| exit 1 | ||
| } | ||
|
|
||
| # force ask buffer data write into file system | ||
| sudo sync -f || true | ||
| # 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;}') | ||
| fi | ||
|
|
||
| is_sof_used() | ||
|
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. In an ideal world every commit should be usable for bisecatability, cherry-picking, reverting, etc. reasons. I guess this implies the entire |
||
| { | ||
| grep -q "sof" /proc/asound/cards; | ||
|
|
@@ -342,5 +336,5 @@ is_sof_used() | |
| journalctl_cmd() | ||
| { | ||
| journalctl -k -q --no-pager --utc --output=short-monotonic \ | ||
| --no-hostname "$@" | ||
| --no-hostname --boot "$@" | ||
|
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.
Feel free to expand |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,7 +150,8 @@ $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;}') | ||
| setup_kernel_check_point | ||
| export KERNEL_CHECKPOINT | ||
|
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. Can you add a comment explaining why this one needs the export when the others don't? Wouldn't it be simpler to export KERNEL_CHECKPOINT always? If not why not?
Author
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. Sorry, this is a mistake from previously version, the |
||
| bash -c '$full_cmd' | ||
|
|
||
| exit 0 | ||
|
|
||
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.
Much faster
git grepwhen this happens.Uh oh!
There was an error while loading. Please reload this page.
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.
normally, this should not happen, I just want to use this to tell the case owner that he/she should setup up check point.
could you please explain more on
git grep?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.
When someone sees the message with
KERNEL_CHECKPOINTthen they can immediatelygit grepthat and find all relevant locations in sof-test.