Comments (7)
Oh, BTF tags only work for clang built linux. Lemme think on it more
from bpftool.
So I think this approach is probably still doable, except we cannot use BTF type tags from kernel side. Instead we'd probably want to teach pahole to parse the .BTF_ids
section in vmlinux and generate type tags from that. But unfortunately not the quick win I was looking for :p w.r.t. how much time I can allocate to this.
from bpftool.
Could be worth opening a thread on bpf@, I wouldn't be surprised if other people are interested in listing the kfuncs, too. Some may even have more suggestions, or cycles to take a look?
from bpftool.
Interesting, I thought kfuncs were encoded into BTF. I see a reference to that here: https://github.com/torvalds/linux/blob/0e389834672c723435a44818ed2cabc4dad24429/kernel/bpf/btf.c#L7669
Mind double checking me on that? If kfuncs availability can be pulled from BTF feel free to give this one to me -- it's been bugging me for a while
from bpftool.
Hey, thanks Daniel for looking into this!
As far as I'm aware, kfuncs and their prototypes are indeed available in the raw BTF, but I can't see them in the vmlinux.h
generated by bpftool. In the raw BTF ouput, I don't know if there's a way to distinguish them from other non-kfuncs kernel functions.
What do you have in mind, exactly?
from bpftool.
Hey, thanks Daniel for looking into this!
As far as I'm aware, kfuncs and their prototypes are indeed available in the raw BTF, but I can't see them in the
vmlinux.h
generated by bpftool. In the raw BTF ouput, I don't know if there's a way to distinguish them from other non-kfuncs kernel functions.
Ah makes sense. In that case, I was thinking of adding a BTF tag to all kfunc via __bpf_kfunc
macro. Then bpftool could just walk all the tags and find kfunc tagged functions.
What do you have in mind, exactly?
I'm interested in two things:
- Have bpftool support a "feature dump" of all supported kfuncs on running kernel
- Have bpftool generate vmlinux.h with kfunc prototypes
from bpftool.
Would be great to have these tags, indeed. Thanks!
from bpftool.
Related Issues (20)
- Print error and exit instead of diplaying an empty map for unsupported map types
- Fix weird indent in documentation HOT 1
- streamline bpftool net dump HOT 1
- "make install" for man pages stops. HOT 1
- Wrong callq address displayed HOT 5
- Error: No JIT disassembly support HOT 2
- "libbpf: map 'xxx': unsupported map linkage static" in Android HOT 7
- Have bpftool return ID of created objects
- Attach programs to tcx HOT 6
- The proper usage of `bpftool prog attach` HOT 2
- BPFTool Prog Loadall command Deletes /sys/fs/cgroup virtual file system directory HOT 3
- bpftool: error while loading shared libraries: libLLVM-17.so: cannot open shared object file: No such file or directory HOT 14
- use bpftool dump this bpf_prog_982904fb4a4dfbdb_tracepoint_sche at 0x8a0/0x1000 how to do it? HOT 1
- Typo: `cgroup/sendmsg°unix` HOT 2
- Check that the list of supported programs, map types, attach types, ... are up-to-date HOT 1
- Dump libbpf's output for `build_obj_refs_table()` when user asks for debug info HOT 2
- When loading eBPF binary with bpftool, the 'bpf_trace_printk' seems no output to '/sys/kernel/debug/tracing/trace_pipe' HOT 8
- bpftool 7.4.0 prog load Segmentation fault (core dumped) HOT 2
- Missing bpffs mount when pinning maps for prog load (`pinmaps`) HOT 6
- Cannot list programs attached to cgroup HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bpftool.