diff options
author | Andrii Nakryiko | 2020-12-03 12:46:30 -0800 |
---|---|---|
committer | Alexei Starovoitov | 2020-12-03 17:38:21 -0800 |
commit | 290248a5b7d829871b3ea3c62578613a580a1744 (patch) | |
tree | 0aa6d260cddaf939128e4645fdc695fcfa4ce0e0 /include/linux/btf.h | |
parent | 22dc4a0f5ed11b6dc8fd73a0892fa0ea1a4c3cdf (diff) |
bpf: Allow to specify kernel module BTFs when attaching BPF programs
Add ability for user-space programs to specify non-vmlinux BTF when attaching
BTF-powered BPF programs: raw_tp, fentry/fexit/fmod_ret, LSM, etc. For this,
attach_prog_fd (now with the alias name attach_btf_obj_fd) should specify FD
of a module or vmlinux BTF object. For backwards compatibility reasons,
0 denotes vmlinux BTF. Only kernel BTF (vmlinux or module) can be specified.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201203204634.1325171-11-andrii@kernel.org
Diffstat (limited to 'include/linux/btf.h')
-rw-r--r-- | include/linux/btf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/btf.h b/include/linux/btf.h index fb608e4de076..4c200f5d242b 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -90,6 +90,7 @@ int btf_type_snprintf_show(const struct btf *btf, u32 type_id, void *obj, int btf_get_fd_by_id(u32 id); u32 btf_obj_id(const struct btf *btf); +bool btf_is_kernel(const struct btf *btf); bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s, const struct btf_member *m, u32 expected_offset, u32 expected_size); |