mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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
This commit is contained in:
parent
387544bfa2
commit
3d78417b60
5 changed files with 79 additions and 0 deletions
|
@ -4748,6 +4748,12 @@ union bpf_attr {
|
|||
* Execute bpf syscall with given arguments.
|
||||
* Return
|
||||
* A syscall result.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
#define __BPF_FUNC_MAPPER(FN) \
|
||||
FN(unspec), \
|
||||
|
@ -4917,6 +4923,7 @@ union bpf_attr {
|
|||
FN(for_each_map_elem), \
|
||||
FN(snprintf), \
|
||||
FN(sys_bpf), \
|
||||
FN(btf_find_by_name_kind), \
|
||||
/* */
|
||||
|
||||
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue