-
Notifications
You must be signed in to change notification settings - Fork 46
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
[FEATURE] Switch implementation of IPC payload dump to Linux BPF #1201
Comments
for the record, the bpf script to capture the tx IPC messages with payload (the rx trace position update message is ignored):
the log:
|
Today a question was raised: should this BPF script be hosted in sof-test.git or sof.git? The most important point to consider for any test code is: how tightly coupled with production code is it? If tightly coupled (e.g.: unit tests), then the test code should live in the same repo, otherwise there will be mismatches and breakages all the time. If very loose then it should live in the separate sof-test.git for flexibility. The best litmus test is: imagine you're bisecting sof.git. Would you rather this BPF script to downgrade and upgrade at the same time you're bisecting sof? Or not? Which is the more likely? Same idea with branching, rebasing, cherry-picking etc. As IPC4 is a very stable API, I'm guessing this BPF script should live in sof-test? |
My take is that BPF can provide access to lots of Linux kernel functions, and as such isn't guaranteed to be stable over time. Bisecting with BPF may or may not be possible between different Linux versions. https://lwn.net/Articles/921088/ That means that if/when there are changes to the kernel, the scripts shall be updated. |
@plbossart, I agree that there is a risk of kernel change breaking the BPF script, I'm proposing to tap on the |
Then the ideal git repo for the BPF script would be the kernel repo; that's the one it's most tightly coupled with. But that's not possible because https://thesofproject.github.io/latest/contribute/linux/development_tree.html#development-summary
So is there a "second best" between sof-test.git and sof.git? Maybe not. Maybe they are both equally inferior. |
BPF scripts are not part of the kernel tree. Ideally we should have 'trampolines' (iow, stable BPF entries) for proper support then the scripts could be part of sof-bin package. We can also just see how things work with the dmesg dumping... |
I don't think there's a better proposal than using sof-test for those BPF scripts, so unless there's a sustained objection let's go with that direction. |
The initial script: #1205 |
Even if the current script above is just a "works4me" and does not end up being used, it is still better placed in sof-test.git than in a discussion comment. It's not like sof-test.git has "coverage" requirement for everything in it, pretty far from that. The bar is of course higher for code that is used every day but it is low for demos and prototypes. How about |
Follow-up discussion at thesofproject/sof#9123 (comment)
To reduce the overhead of IPC payload dump, BPF should be used to enable the feature universally.
BFP script already drafted in comment thesofproject/sof#9123 (comment)
The text was updated successfully, but these errors were encountered: