bpf: btf: Add struct bpf_btf_info
authorMartin KaFai Lau <kafai@fb.com>
Fri, 4 May 2018 21:49:52 +0000 (14:49 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 9 May 2018 15:25:13 +0000 (17:25 +0200)
commit62dab84c81a487d946a5fc37c6df541dd95cca38
treebcfa804c58e189bf89226ed0c7afa1e23dfeb24c
parent78958fca7ead2f81b60a6827881c4866d1ed0c52
bpf: btf: Add struct bpf_btf_info

During BPF_OBJ_GET_INFO_BY_FD on a btf_fd, the current bpf_attr's
info.info is directly filled with the BTF binary data.  It is
not extensible.  In this case, we want to add BTF ID.

This patch adds "struct bpf_btf_info" which has the BTF ID as
one of its member.  The BTF binary data itself is exposed through
the "btf" and "btf_size" members.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/uapi/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/syscall.c