History

bpf: Assign ID to vmlinux BTF and return extra info for BTF in GET_OBJ_INFO

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.

Andrii Nakryiko committed 6 years ago

Commit 53297221 parent 951bb643 files · +46 −3Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/bpf.h+3−0
@@ -4466,6 +4466,9 @@ struct bpf_btf_info { · 4465 unmodified lines
44664466 __aligned_u64 btf;
44674467 __u32 btf_size;
44684468 __u32 id;
4469+ __aligned_u64 name;
4470+ __u32 name_len;
4471+ __u32 kernel_btf;
44694472 } __attribute__((aligned(8)));
44704473
44714474 struct bpf_link_info {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t