Allocate ID for vmlinux BTF. This makes it visible when iterating over all BTF objects in the system. To allow distinguishing vmlinux BTF (and later kernel module BTF) from user-provided BTFs, expose extra kernel_btf flag, as well as BTF name ("vmlinux" for vmlinux BTF, will equal to module's name for module BTF). We might want to later allow specifying BTF name for user-provided BTFs as well, if that makes sense. But currently this is reserved only for in-kernel BTFs. Having in-kernel BTFs exposed IDs will allow to extend BPF APIs that require in-kernel BTF type with ability to specify BTF types from kernel modules, not just vmlinux BTF. This will be implemented in a follow up patch set for fentry/fexit/fmod_ret/lsm/etc.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -4466,6 +4466,9 @@ struct bpf_btf_info { · 4465 unmodified lines | |||
| 4466 | __aligned_u64 btf; | 4466 | __aligned_u64 btf; |
| 4467 | __u32 btf_size; | 4467 | __u32 btf_size; |
| 4468 | __u32 id; | 4468 | __u32 id; |
| 4469 | __aligned_u64 name; | ||
| 4470 | __u32 name_len; | ||
| 4471 | __u32 kernel_btf; | ||
| 4469 | } __attribute__((aligned(8))); | 4472 | } __attribute__((aligned(8))); |
| 4470 | 4473 | ||
| 4471 | struct bpf_link_info { | 4474 | struct bpf_link_info { |