Skip to content

Conversation

@Bin-QA
Copy link
Contributor

@Bin-QA Bin-QA commented Jun 28, 2020

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

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>
Copy link
Collaborator

@marc-hb marc-hb left a 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
Copy link
Collaborator

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
Copy link
Collaborator

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);}')'
Copy link
Collaborator

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?

@xiulipan
Copy link
Contributor

xiulipan commented Sep 2, 2020

I will close this one as @Bin-QA no longer work on this.
@aiChaoSONG @marc-hb do we still need some similar issues? I will leave all journalctl related issue to you @marc-hb

@xiulipan
Copy link
Contributor

Close with new attempt #468

@xiulipan xiulipan closed this Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants