Thread (52 messages) 52 messages, 4 authors, 2021-04-28

RE: [PATCH v2 bpf-next 10/16] bpf: Add bpf_btf_find_by_name_kind() helper.

From: John Fastabend <john.fastabend@gmail.com>
Date: 2021-04-27 21:00:56
Also in: bpf

Alexei Starovoitov wrote:
From: Alexei Starovoitov <ast@kernel.org>

Add new helper:

long bpf_btf_find_by_name_kind(u32 btf_fd, char *name, u32 kind, int flags)
	Description
		Find given name with given type in BTF pointed to by btf_fd.
		If btf_fd is zero look for the name in vmlinux BTF and in module's BTFs.
	Return
		Returns btf_id and btf_obj_fd in lower and upper 32 bits.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
I'm missing some high-level concept on how this would be used? Where does btf_fd come
from and how is it used so that it doesn't break sig-check?

A use-case I'm trying to fit into this series is how to pass down a BTF fd/object
with the program. I know its not doing CO-RE yet but we would want it to use the
BTF object being passed down for CO-RE eventually. Will there be someway to do
that here? That looks like the btf_fd here.

Thanks,
John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help