-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC/SoundWire: improve dmesg logs #3631
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
ASoC/SoundWire: improve dmesg logs #3631
Conversation
The same debug message is replicated multiple time, add __func__ to figure out what link is ignored. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
60c46a9 to
d250e1d
Compare
ujfalusi
left a comment
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.
@plbossart, it is good to have meaningful debug prints, but I'm not sure about the core dtrace and tx print changes
sound/soc/sof/ipc3.c
Outdated
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.
Better to use the flag itself here so we don't need to look back what it is?
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 kind of liked this noise as we can see that new data is coming in via dtrace from firmware. If the sof-logger came back with empty log we can see in the dmesg if we have aver received the position update.
I still have the two dtrace PRs open to print the new positions... (#3516)
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.
you still have this capability, it's just not there by default. I think we have to separate out debugging the trace and debugging firmware, if we have all logs all the time it just makes it harder for everyone, and we have already too many logs.
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.
Better to use the flag itself here so we don't need to look back what it is?
I used this to avoid a 100+ line. I can move the definition down but it'll look ugly. I don't have a good solution.
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.
direct use would put it to 92, but surely it looks a bit out of place, but not too much.
switch (glb) {
case SOF_IPC_GLB_TRACE_MSG:
str = "GLB_TRACE_MSG";
switch (type) {
case SOF_IPC_TRACE_DMA_PARAMS:
str2 = "DMA_PARAMS"; break;
case SOF_IPC_TRACE_DMA_POSITION:
if (sof_debug_check_flag(SOF_DBG_SQUELCH_DMA_POSITION_UPDATE_LOGS))
return;
str2 = "DMA_POSITION"; break;
case SOF_IPC_TRACE_DMA_PARAMS_EXT:
str2 = "DMA_PARAMS_EXT"; break;
case SOF_IPC_TRACE_FILTER_UPDATE:
str2 = "FILTER_UPDATE"; break;
case SOF_IPC_TRACE_DMA_FREE:
str2 = "DMA_FREE"; break;
default:
str2 = "unknown type"; break;
}
break;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.
Opt-in version of the flag would be 93
sound/soc/sof/ipc3.c
Outdated
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 think we had this debate in past: which one is more important, the start of the TX or the end of the TX. Back then I proposed to drop the start and print either the success or the error when it is done to remove the duplication.
But in some cases it is interesting to know how long a tx took and if we had an RX between the start and the completion of the TX.
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.
We can't continue with all logs enabled @ujfalusi, it's not sustainable for production CI.
We would still see if an RX IPC happened between the start of the TX IPC and the RX IPC error.
We could add a flag to make the success printed optionally if that helps.
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.
Sure, but this is also the case when the verbose printing is enabled in kernel config.
Dropping the success message is fine I think. No message == all is good.
The same message was added twice for dai and link_dma, remove the latter one and add dai name and direction to better understand problematic sequences. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add the same debug message for IPC4 and IPC3 for consistency. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
d250e1d to
ea853bb
Compare
|
@ujfalusi I kept the logs as is but disabled them by default. You can still debug the IPC and trace the same way, just with the added step of changing the sof_debug kernel parameter. If we want more logs, we have to switch to tracepoints. |
|
Jenkins failed to run the sofkernel_prs job, I'm fixing it now @plbossart and then I'll run the test again. |
|
SOFCI TEST |
|
https://sof-ci.01.org/linuxpr/PR3631/build100/devicetest/?model=WHL_UPEXT_HDA_ZEPHYR&testcase=check-suspend-resume-with-playback-5 is all PASS except for the recent and unfortunately frequent suspend/resume issue on WHL |
sound/soc/sof/ipc3.c
Outdated
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.
direct use would put it to 92, but surely it looks a bit out of place, but not too much.
switch (glb) {
case SOF_IPC_GLB_TRACE_MSG:
str = "GLB_TRACE_MSG";
switch (type) {
case SOF_IPC_TRACE_DMA_PARAMS:
str2 = "DMA_PARAMS"; break;
case SOF_IPC_TRACE_DMA_POSITION:
if (sof_debug_check_flag(SOF_DBG_SQUELCH_DMA_POSITION_UPDATE_LOGS))
return;
str2 = "DMA_POSITION"; break;
case SOF_IPC_TRACE_DMA_PARAMS_EXT:
str2 = "DMA_PARAMS_EXT"; break;
case SOF_IPC_TRACE_FILTER_UPDATE:
str2 = "FILTER_UPDATE"; break;
case SOF_IPC_TRACE_DMA_FREE:
str2 = "DMA_FREE"; break;
default:
str2 = "unknown type"; break;
}
break;
sound/soc/sof/ipc3.c
Outdated
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.
Opt-in version of the flag would be 93
sound/soc/sof/ipc3.c
Outdated
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.
Sure, but this is also the case when the verbose printing is enabled in kernel config.
Dropping the success message is fine I think. No message == all is good.
We currently log the initiation of an IPC as well at its success. [ 3906.106987] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG [ 3906.107189] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG This is overkill in most cases, we already have a message thrown in case of errors and have tracepoints enabled to check for IPC duration. The only case where this might be useful is to check if there is an interleaved IPC RX. Add a flag and only print those logs if enabled. In addition, the DMA_POSITION_UPDATE for traces brings limited information in most cases and pollutes the logs for no good reason. [ 3906.322256] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.322308] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.822261] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.822319] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3907.822261] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3907.822319] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3908.822251] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3908.822309] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION This information is only helpful when debugging the trace support, not when using the trace. Add a flag to only print DMA position update logs if enabled. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
ea853bb to
c162e51
Compare
ujfalusi
left a comment
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.
Only one request to hide the ipc rx done along with the tx success.
| } else { | ||
| ipc3_log_header(sdev->dev, "ipc tx succeeded", hdr->cmd); | ||
| if (sof_debug_check_flag(SOF_DBG_PRINT_IPC_SUCCESS_LOGS)) | ||
| ipc3_log_header(sdev->dev, "ipc tx succeeded", hdr->cmd); |
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.
@plbossart, can we do the same for rx at the end of sof_ipc3_rx_msg():
if (sof_debug_check_flag(SOF_DBG_PRINT_IPC_SUCCESS_LOGS))
ipc3_log_header(sdev->dev, "ipc rx done", hdr.cmd);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.
we can, it's just that I don't see a parallel between rx and tx.
for tx, we start the IPC and will get an error.
What happens for RX if someone the IPC handling goes south?
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.
@ujfalusi can you comment on this one? I am not sure what you are asking for.
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.
@plbossart, I would expect it to report an error when handling the received message, but OK, let's leave that one out for now.
make messages unique, remove useless logs and add more information for useful messages