-
Notifications
You must be signed in to change notification settings - Fork 141
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
BPF kfuncs and vmlinux.h #380
Comments
Not really, other than yeah, tedious :)
Tooling to dynamically generate the stripped-down header would be pretty
neat (by recursively expanding dependent types from a list of kfunc
names, say). Don't think any such tooling exists, though.
I believe there was also a plan at some point to have the kfunc
signatures themselves included in the generated vmlinux.h? In which case
you could just use the full file and then just call the functions
without having to make any further definitions...
|
I did something like this for libbpf-rs originally (although much of it has changed since then): https://github.com/libbpf/libbpf-rs/blob/7f3ba404486f7a9b2d02ed5717c81e92e8a3425b/libbpf-cargo/src/gen/btf.rs#L249-L252 . I think it should be fairly straightfoward for bpftool to do this as well. Although I wonder what bpftool folks think about this vs generating entire vmlinux.h. cc @anakryiko @qmonnet
Yeah that's something that's been bugging me for a while as well. I found libbpf/bpftool#98 which is kinda related. |
Hi,
I noticed in 3f3751c that the "traditional"
vmlinux.h
was stripped down. I think in the regular BPF helper world that was probably fine, but I think having a stripped vmlinux.h has implications for the new kfunc world.For example, kfuncs will now expose internal kernel data structures -- I'm mostly thinking of
struct xfrm_state
and https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=403f3e8fda60f1a3e54741742d46aea98ecf671e. Those structs depend on a lot of internal kernel types. Maintaining all the dependencies by hand could get tricky.I was wondering if y'all had any thoughts on the path forward for calling kfuncs.
The text was updated successfully, but these errors were encountered: