Skip to content

logger: new relative timestamps option, relative to first entry seen - #3954

Closed
marc-hb wants to merge 2 commits into
thesofproject:masterfrom
marc-hb:relative-logger-ts
Closed

logger: new relative timestamps option, relative to first entry seen#3954
marc-hb wants to merge 2 commits into
thesofproject:masterfrom
marc-hb:relative-logger-ts

Conversation

@marc-hb

Copy link
Copy Markdown
Collaborator

2 commits. The only big and main one:

Add a new sof-logger -e 0/1 relative timestamps option where the
TIMESTAMP column is relative to the first entry seen.

Removes many digits and makes the TIMESTAMP column much more readable in
short logs.

Also stop showing "NaN" as the first DELTA like something went
wrong. Show zero instead.

The new option is off by default when using -r(aw) and on otherwise.

The first entry is kept always absolute.

Before:

 TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT
[6653843012.343750] ( NaN) c0 dma-trace src/trace/dma-trace.c:339 ERROR FW ...
[6653843111.510417] ( 99.166664) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[6653843309.010417] ( 197.500000) c0 ll-schedule ./schedule/ll_schedule.c:399 task add
[6653843314.166667] ( 5.156250) c0 ll-schedule ./schedule/ll_schedule.c:403 task params
[6653843322.031250] ( 7.864583) c0 ll-schedule ./schedule/ll_schedule.c:309 new added
[6653843327.031250] ( 5.000000) c0 ll-schedule ./schedule/ll_schedule.c:312 num_tasks 2
[6653844109.531250] ( 782.500000) c0 sa src/lib/agent.c:65 perf sys_load
[6653844155.156250] ( 45.625000) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[6653844384.218750] ( 229.062500) c0 component src/audio/component.c:130 comp new host

After:

 TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT
[686125142.395834] ( 0.000000) c0 dma-trace src/trace/dma-trace.c:339 ERROR FW ...
[ 94.270833] ( 94.270836) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[ 296.770833] ( 202.500000) c0 ll-schedule ./schedule/ll_schedule.c:399 task add
[ 301.979167] ( 5.208333) c0 ll-schedule ./schedule/ll_schedule.c:403 task params
[ 309.843750] ( 7.864583) c0 ll-schedule ./schedule/ll_schedule.c:309 new added
[ 314.843750] ( 5.000000) c0 ll-schedule ./schedule/ll_schedule.c:312 num_tasks 2
[ 1092.395833] ( 777.552063) c0 sa src/lib/agent.c:65 perf sys_load
[ 1137.968750] ( 45.572918) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[ 1850.208333] ( 712.239563) c0 component src/audio/component.c:130 comp new host

This is useful clue when forgetting to use "sudo" or to change
permissions in udev.
The messages changed are:
- the first one printed when using -n, and
- the first one printed when not using -n
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add a new sof-logger -e 0/1 relative timestamps option where the
TIMESTAMP column is relative to the first entry seen.
Removes many digits and makes the TIMESTAMP column much more readable in
short logs.
Also stop showing "NaN" as the first DELTA like something went
wrong. Show zero instead.
The new option is off by default when using -r(aw) and on otherwise.
The first entry is kept always absolute.
Before:
TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT
[6653843012.343750] ( NaN) c0 dma-trace src/trace/dma-trace.c:339 ERROR FW ...
[6653843111.510417] ( 99.166664) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[6653843309.010417] ( 197.500000) c0 ll-schedule ./schedule/ll_schedule.c:399 task add
[6653843314.166667] ( 5.156250) c0 ll-schedule ./schedule/ll_schedule.c:403 task params
[6653843322.031250] ( 7.864583) c0 ll-schedule ./schedule/ll_schedule.c:309 new added
[6653843327.031250] ( 5.000000) c0 ll-schedule ./schedule/ll_schedule.c:312 num_tasks 2
[6653844109.531250] ( 782.500000) c0 sa src/lib/agent.c:65 perf sys_load
[6653844155.156250] ( 45.625000) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[6653844384.218750] ( 229.062500) c0 component src/audio/component.c:130 comp new host
After:
TIMESTAMP DELTA C# COMPONENT LOCATION CONTENT
[686125142.395834] ( 0.000000) c0 dma-trace src/trace/dma-trace.c:339 ERROR FW ...
[ 94.270833] ( 94.270836) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[ 296.770833] ( 202.500000) c0 ll-schedule ./schedule/ll_schedule.c:399 task add
[ 301.979167] ( 5.208333) c0 ll-schedule ./schedule/ll_schedule.c:403 task params
[ 309.843750] ( 7.864583) c0 ll-schedule ./schedule/ll_schedule.c:309 new added
[ 314.843750] ( 5.000000) c0 ll-schedule ./schedule/ll_schedule.c:312 num_tasks 2
[ 1092.395833] ( 777.552063) c0 sa src/lib/agent.c:65 perf sys_load
[ 1137.968750] ( 45.572918) c0 ll-schedule ./schedule/ll_schedule.c:229 perf ll_work
[ 1850.208333] ( 712.239563) c0 component src/audio/component.c:130 comp new host
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Comment threadtools/logger/logger.c
fprintf(stderr, "error: Unable to open version file %s\n",
fprintf(stderr,
"error: Unable to open version file %s, check permissions\n",
config.version_file);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to add strreror(errno). In my case most common problem is that I forget to add sof debugging support in linux so the debugfs file isn't even there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, IIUC the strerror() also has language translations.

@lgirdwood
lgirdwood deleted the branch thesofproject:masterMarch 28, 2021 13:44
@paulstelian97

Copy link
Copy Markdown
Collaborator

Please resubmit with "main" as PR base branch.

@marc-hb

Copy link
Copy Markdown
CollaboratorAuthor

As the strerror() patch grew much bigger I split this into two different PRs re-submitted to the main branch:

logger: new relative timestamps option, relative to first entry seen #3985
logger: use strerror() #3984

Sign up for freeto 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.

4 participants

@marc-hb@paulstelian97@dbaluta@lgirdwood