]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add bpf_btf_find_by_name_kind() helper.
authorAlexei Starovoitov <ast@kernel.org>
Fri, 14 May 2021 00:36:11 +0000 (17:36 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 18 May 2021 22:33:40 +0000 (00:33 +0200)
commita8d62885c58da94bfb4904dc23adb994d8193f16
treec61b6a262c43b125b25c3601be7285f51df5a91f
parent7843bccdba5f69e8e209cec0f4bc80307eff5469
bpf: Add bpf_btf_find_by_name_kind() helper.

Add new helper:
long bpf_btf_find_by_name_kind(char *name, int name_sz, u32 kind, int flags)
Description
Find BTF type with given name and kind in vmlinux BTF or in module's BTFs.
Return
Returns btf_id and btf_obj_fd in lower and upper 32 bits.

It will be used by loader program to find btf_id to attach the program to
and to find btf_ids of ksyms.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210514003623.28033-10-alexei.starovoitov@gmail.com
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/syscall.c
tools/include/uapi/linux/bpf.h