-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for listing struct/union/enum definitions using BTF #1340
Conversation
@danobi
Please let me know if this has a problem. |
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.
Can you add a "Changed" entry to the changelog for the usdt+uprobe change?
Seems like a reasonable change |
Split a long function and call functions only when necessary
BTF::c_def() now accepts enum name, such as "enum bpf_prog_type"
'-l' option now can take struct/union/enum name and dump its definition using BTF. For example: ``` % sudo ./src/bpftrace -l "enum bpf*" enum bpf_access_type enum bpf_adj_room_mode enum bpf_arg_type enum bpf_attach_type enum bpf_cgroup_storage_type [...] ``` and ``` % sudo ./src/bpftrace -lv "struct path" BTF: using data from /sys/kernel/btf/vmlinux struct path { struct vfsmount *mnt; struct dentry *dentry; }; ```
Now `bpftrace -l -p 11234` only lists uprobe and usdt probes. `bpftrace -l "k:*" -p 11234` lists kprobe, which is the same as before.
|
'-l' option now can take struct/union/enum name and dump its definition
using BTF. For example:
and
Checklist
docs/reference_guide.md
CHANGELOG.md