-
Notifications
You must be signed in to change notification settings - Fork 75
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
debugability: logger: add note on DMA trace limitations #381
debugability: logger: add note on DMA trace limitations #381
Conversation
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.
One typo in the text.
I'm not sure if it can be put into words, but over time the trace messages (as they flow in) will start to straightened up. Iow, the first batch of trace information might not be of an relevance of the past. Or something.
@@ -136,6 +136,11 @@ Examples | |||
distribution kernels ``sof_debug=1`` module option for ``snd_sof`` might be | |||
needed if the /sys/kernel/debug/sof/trace file is not present) | |||
|
|||
.. note:: | |||
The DMA trace sysfs interface is a streaming interface. If sof-logger is | |||
started (or restarted) while DSP is active, it is possible the initial traces |
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.
typo: s/traces/trace
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.
Would the following work?
The DMA trace sysfs interface is a streaming interface. If sof-logger is started (or restarted) while DSP is active, the initial trace messages might appear in the wrong order or incomplete.
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 sof-logger is started (or restarted) while DSP is active, ...
That does not really make sense because the logger can never run unless the driver and firmware have been loaded. When you try:
sudo sof-logger -t -f 3 -l /lib/firmware/intel/sof/sof-apl.ldc
error: Unable to open version file /sys/kernel/debug/sof/fw_version: No such file or directory
The description also does not match the following behavior: after disabling D3 with echo on > sys/devices/pci0000:00/"${pci_id}"/power/control
, the sof-logger can be stopped and restarted any number of times and it displays the exact same DMA traces every single time. That could not possibly happen if it were really implemented as a streaming interface.
Even worse: multiple instances of the sof-logger show the same DMA traces even when run concurrently.
So this description does not seem to match reality.
@marc-hb, do we really need to document that if you want to collect dtrace from SOFirmware you need to have the drivers loaded?
Yes, I think that is the behavior atm or something similar. This is only one - and obvious - bug, but if you look closer there are other cases where things get out of control. I think we should fix the dtrace for good and then update the documentation or even better have a description what we want. |
No, I was merely describing one of the mismatches between this PR and reality. That's all.
I doubt that. I think the sof-logger expectations are pretty low so I am optimistic that the only "complaints" will be from sof-test - I mean test failures. I will align sof-test to all "correct" and well defined behaviors that match (future) reality. So if you know what to fix then please go for it. |
Right. One thing which bugs me is around the
I kind of know what to fix, I'm debating the how ;) |
Not losing logs: that's the least I would expect from a "streaming" interface like what this PR describes (ignoring ringbuffer overruns of course). |
It depends if it supports time shifting ;) "streaming" is real time, not on-demand, but I also prefer to have a bit of context from the past (from the point the previous sof-logger was stopped - if it run). |
@marc-hb I'll remove "streaming", you are reading too much into it. |
c3f2078
to
ff4ff8d
Compare
Updated. Thanks @anton-intel , @ujfalusi and @marc-hb for the comments. |
@marc-hb wrote:
I removed "streaming" now. Now behavior matches description. ""If sof-logger is started (or restarted) while DSP is active, the initial trace messages might appear in the wrong order or be incomplete."" Don't shoot the messenger here, that's just how it works. The fact that you get traces most of the time upon restart, just makes this all the more dangerous (and worthy of note) as IT IS NOT GUARANTEED! |
|
Sorry for shooting the messenger but when a NOT GUARANTEED behavior like this one works 99.9% of the time then something is very deeply flawed and the documentation should not look like everything is fine. |
Right, otherwise you can't debug... boot! |
As stated in various other github places, I think this is too short. It should give at least clues why using keywords like "ringbuffer", "offset" and "DSP suspend". Maybe also worth noting that we do this in sof-test for every test. |
If sof-logger is started (or restarted) while DSP is running, the initial traces may be incomplete. Document the limitation and give a brief explanation of the current ringbuffer design and how it affects the start-up behaviour. BugLink: thesofproject/sof-test#297 BugLink: thesofproject/linux#3275 Signed-off-by: Kai Vehmanen <[email protected]>
ff4ff8d
to
9cf4ded
Compare
@marc-hb wrote:
I don't really agree with the general statement. Many systems have timing uncertainty and a compromise needs to be made between 100%, 99.9% and 90% odds (with required work effort to reach a level of certainly varying accordingly). I expanded the explanation of current behaviour and repushed the PR. I also filed an enhancement ticket to the kernel interface: thesofproject/linux#3275 |
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.
Thanks @kv2019i, this is useful information whilst we all align on a fix.
thanks @kv2019i for the extended version, I find it extremely useful. |
If sof-logger is started (or restarted) while DSP is running,
the initial traces may come in incorrect order or are incomplete.
This is important to note when parsing the logger results.
BugLink: thesofproject/sof-test#297
Signed-off-by: Kai Vehmanen [email protected]