b.support_raw_tracepoint is broken on 5.0 kernels
The code relies on bpf_find_raw_tracepoint ksyms to be present but it was renamed in 5.0
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/kernel/trace/bpf_trace.c?h=v5.0-rc8&id=a38d1107f937ca95dcf820161ef44ea683d6a0b1
I guess we can check for both bpf_{find,get}_raw_tracepoint now - but the mechanism is fragile. Not sure if we can do better though :-/
@qais-yousef Thanks for reporting the issue. Just submitted a pull request https://github.com/iovisor/bcc/pull/2241 to fix the issue, exactly as you stated in the above comments. In the long run, we need something in systemd or any other init process (this can be configurable), during system startup, a series of bpf probing to find out the bpf features and stored somewhere and bcc can use them. This can avoid repeated probing from bcc tools.
Having init / systemd do feature checking would be a great idea. We have so many trial-and-error gating for new features in BCC and a lot of fragile gating on Kernel versions as well.
But I guess everyone (systemd, Kernel, BCC, other tools...) would need to agree on some sort of a protocol. Has that conversation started somewhere already?
Not yet, currently, bpftool can probe the system and emit a bunch of macros/defines etc.
https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next/+/2d3ea5e85dd867712ba8747cb01c2d88376ead5c
It is possible later bpftool is used in systemd to do the probing and store the result somewhere. Currently, some folks from different companies, including Facebook, are trying to experiment what is the best way to move forward.
Would grepping /proc/kallsyms for raw_tracepoint be more reliable and future proof? I guess we can push a patch in the kernel to expose bpf features that are compiled in in sysfs or debugfs.
Thanks for the fix. I'll pull and test tomorrow.
Would grepping /proc/kallsyms for raw_tracepoint be more reliable and future proof I thought about this and finally decided to be more specific. Hopefully this won't change often. If it does change, maybe we should check the offending kernel patch to see what changed and whether bcc needs to do anything or not.
I guess we can push a patch in the kernel to expose bpf features that are compiled in in sysfs or debugfs. Please do go ahead to explore this idea in kernel space. The current approach is to use bpftool to do probe and may store the result somewhere accessible to all bpf programs. The advantage of user space probing is flexible. The user space can have a little more complex programs to really make sure feature works in that particular kernel for the use case the user cares.
I'd be happy to explore the feature route if you think it'd be useful for this project. If not then we can always revisit it in the future when the need arises. I have no use for it myself.
Maybe tagging specific bcc versions aligned to kernel releases may be easier. I’m not sure that a systemd unit would be palatable for a lot of users who are using the tooling adhoc or building from source.
On 28 Feb 2019, at 22:36, Qais Yousef [email protected] wrote:
I'd be happy to explore the feature route if you think it'd be useful for this project. If not then we can always revisit it in the future when the need arises. I have no use for it myself.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@qais-yousef the feature route helps bcc, but it helps broader bpf communities even more. It is not urgent. I will tag you if I see a discussion/patch set involved in this subject in netdev mailing list, so you can get involved.
@mcaleavya Yes, we do try to tag each bcc release roughly a couple of weeks later after each kernel release (to make sure we fixed all bugs, etc.). Agreed that depending on systemd definitely not enough as there are other distos not using systemd and distro's may config systemd in a different way where bpf probing not done. Anyway, currently, I am aware that some people are experimenting with bpftool feature and we probably can gain some experience from it in order to improve.
Cool thanks. I'll look at copying the sched_feat approach and see how it goes. Will CC you to any RFC patch I might come up with