Thread (20 messages) 20 messages, 5 authors, 2024-11-29
STALE562d

[PATCH bpf-next 1/4] bpf: export necessary sympols for modules

From: "D. Wythe" <alibuda@linux.alibaba.com>
Date: 2024-10-24 02:43:03
Also in: bpf, linux-rdma, linux-s390
Subsystem: bpf [btf], bpf [general] (safe dynamic programs and tools), the rest · Maintainers: Martin KaFai Lau, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Linus Torvalds

From: "D. Wythe" <alibuda@linux.alibaba.com>

This patch exports two necessary symbols for registering struct_ops
or kfunc with tristate subsystem.

Find the corresponding btf_id by name and type with
btf_find_by_name_kind().

And find the string in btf by offset with btf_str_by_offset(),
used to look up the names of structure members.

Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
---
 kernel/bpf/btf.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 75e4fe8..315e49b 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -567,6 +567,7 @@ s32 btf_find_by_name_kind(const struct btf *btf, const char *name, u8 kind)
 
 	return -ENOENT;
 }
+EXPORT_SYMBOL_GPL(btf_find_by_name_kind);
 
 s32 bpf_find_btf_id(const char *name, u32 kind, struct btf **btf_p)
 {
@@ -789,6 +790,7 @@ const char *btf_str_by_offset(const struct btf *btf, u32 offset)
 
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(btf_str_by_offset);
 
 static bool btf_name_valid_identifier(const struct btf *btf, u32 offset)
 {
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help