diff mbox series

[v2,bpf-next,7/8] selftests/bpf: make bpf_testmod's traceable function global

Message ID 20201201035545.3013177-8-andrii@kernel.org
State Superseded
Headers show
Series Support BTF-powered BPF tracing programs for kernel modules | expand

Commit Message

Andrii Nakryiko Dec. 1, 2020, 3:55 a.m. UTC
Pahole currently isn't able to generate BTF for static functions in kernel
modules, so make sure traced sidecar function is global.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
index 4ff0cf23607d..2df19d73ca49 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
@@ -10,7 +10,7 @@ 
 #define CREATE_TRACE_POINTS
 #include "bpf_testmod-events.h"
 
-static noinline ssize_t
+noinline ssize_t
 bpf_testmod_test_read(struct file *file, struct kobject *kobj,
 		      struct bin_attribute *bin_attr,
 		      char *buf, loff_t off, size_t len)
@@ -25,6 +25,7 @@  bpf_testmod_test_read(struct file *file, struct kobject *kobj,
 
 	return -EIO; /* always fail */
 }
+EXPORT_SYMBOL(bpf_testmod_test_read);
 ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO);
 
 static struct bin_attribute bin_attr_bpf_testmod_file __ro_after_init = {