RFC Integrate kernel module BTF support
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | bpf: add in-kernel split BTF supportkernel/ | +130 | 0 replies | |
| 2/5 | bpf: assign ID to vmlinux BTF and return extra info for BTF in GET_OBJ_INFOinclude/ kernel/ tools/ | +42 | 2 replies | |
| 3/5 | kbuild: Add CONFIG_DEBUG_INFO_BTF_MODULES option or module BTFslib/ scripts/ | +28 | 3 replies | |
| 4/5 | bpf: load and verify kernel module BTFsinclude/ include/ kernel/ +2 more | +232 | 4 replies | |
| 5/5 | tools/bpftool: add support for in-kernel and named BTF in `btf show`tools/ | +29 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH bpf-next 0/5] Integrate kernel module BTF support
This patch set adds BTF generation for kernel modules using a compact split BTF approach. Respective patches have all the details.
New Kconfig CONFIG_DEBUG_INTO_BTF_MODULES is added, which is defaulted to y, but is conditional on pahole v1.19 version, which is going to have a support for --btf_base flag, providing ability to generate deduplicated split BTF.
This patch set implements in-kernel support for split BTF loading and validation. It also extends GET_OBJ_INFO API for BTFs to return BTF's module name and a flag whether BTF itself is in-kernel or user-provided. vmlinux BTF is also exposed to user-space through the same BTF object iteration APIs.
Follow up patch set will utilize the fact that vmlinux and module BTFs now have ID associated with them to provide ability to attach BPF fentry/fexit/etc programs to functions defined in kernel modules.
bpftool is also extended to show module/vmlinux BTF's name.
This patch set is posted as an RFC because it depends on two not yet landed set of patches:
- libbpf split BTF support ([0]);
- pahole's support for split BTF generation and deduplication ([1]).
[0] https://patchwork.kernel.org/project/netdevbpf/list/?series=377859&state=*
[1] https://lore.kernel.org/dwarves/[email protected]/T/#u
Andrii Nakryiko (5):
bpf: add in-kernel split BTF support
bpf: assign ID to vmlinux BTF and return extra info for BTF in
GET_OBJ_INFO
kbuild: Add CONFIG_DEBUG_INFO_BTF_MODULES option or module BTFs
bpf: load and verify kernel module BTFs
tools/bpftool: add support for in-kernel and named BTF in btf show
include/linux/bpf.h | 2 + include/linux/module.h | 4 + include/uapi/linux/bpf.h | 3 + kernel/bpf/btf.c | 411 ++++++++++++++++++++++++++++----- kernel/bpf/sysfs_btf.c | 2 +- kernel/module.c | 32 +++ lib/Kconfig.debug | 10 + scripts/Makefile.modfinal | 20 +- tools/bpf/bpftool/btf.c | 30 ++- tools/include/uapi/linux/bpf.h | 3 + 10 files changed, 460 insertions(+), 57 deletions(-)
Signature · 1 line
2.24.1