-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: trace: sdev->host_offset management changes #3516
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: SOF: trace: sdev->host_offset management changes #3516
Conversation
sound/soc/sof/trace.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.
isn't this super-verbose? I wonder if this is going to fill the console with 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.
If the debug is enabled we are printing the IPC messages (two per message). With this change it will look like this:
ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
trace: new host_offset: 0x7920
ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
Instead of an empty indication that the position is updated we will know the value as well.
Then we have another print when the host_offset is reset to 0 (either because of closing the trace file or restart), but it is still one additional message.
It is not going to fill the console, but I always wondered what is the content behind the dtrace position update.
I can drop this print if you think we should not have it.
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 will create a draft PR on top of this to print the trace file reads as well in hope that we can catch the empty trace with that and have some clue on what is going on.
07ccf0d to
6651821
Compare
6651821 to
508e431
Compare
|
Changes since v1:
|
508e431 to
75096db
Compare
|
Changes since v2:
|
drivers/acpi/acpi_processor.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.
can we remove this? I don't know what problem this tries to fix.
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.
certainly, this is needed for one of my DUTs, otherwise the dmesg is flooded with this message for some reason and I keep forgetting to drop this when I'm done testing before sending the PR.
I should have a hook to blow up when I try to push this patch to other branch than my wip...
sound/soc/sof/ipc3-dtrace.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.
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.
Yes, I'm aware of that, they are of different topic and I don't want to mix them. I'm fine with fixing up either when the time comes.
|
@ujfalusi rebase needed. |
75096db to
debd209
Compare
|
Changes since v3:
|
|
@ujfalusi conflict? |
Yes, I know, I'll update it tomorrow. |
…offset We are using the READ_ONCE() on the debugfs read path for accessing sdev->host_offset, but the set is not atomic or protected in any way. Add a small helper to do the host_offset update and be really paranoid about the a possible race in update Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…ta available If no new trace data is available then return immediately, there is no need to continue with the execution of the trace_read() function. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
debd209 to
9c037af
Compare
|
Changes since v4:
|
Hi,
The
READ_ONCE(sdev->host_offset)alone does nothing to prevent any race regarding to host_offset change race prevention.Introduce a new helper to do this in a correct way and while at it, print out the new offset for us to see where we are.
Additional debug prints can be added to track what is copied to user space with a simple change: