Re: [PATCH bpf-next v11 10/12] selftests/bpf: add testcases for fsession
From: bot+bpf-ci@kernel.org
Date: 2026-01-23 07:57:52
Also in:
bpf, lkml
quoted hunk ↗ jump to hunk
diff --git a/tools/testing/selftests/bpf/progs/fsession_test.c b/tools/testing/selftests/bpf/progs/fsession_test.c new file mode 100644 index 000000000000..f504984d42f2 --- /dev/null +++ b/tools/testing/selftests/bpf/progs/fsession_test.c@@ -0,0 +1,110 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2025 ChinaTelecom */ +#include <vmlinux.h> +#include <bpf/bpf_helpers.h> +#include <bpf/bpf_tracing.h> + +char _license[] SEC("license") = "GPL";
[ ... ]
+__u64 test6_entry_result = 0;
+__u64 test6_exit_result = 0;
+SEC("fsession/bpf_fentry_test1")
+int BPF_PROG(test6, int a)
+{
+ __u64 addr = bpf_get_func_ip(ctx);
+
+ if (bpf_session_is_return(ctx))
+ test6_exit_result = (const void *) addr == &bpf_fentry_test1;
+ else
+ test6_entry_result = (const void *) addr == &bpf_fentry_test1; ^^^^^^^^^^^^^^^^^^
Is the bpf_fentry_test1 symbol declared somewhere? The code references
&bpf_fentry_test1 but there is no extern declaration with __ksym in this
file.
Other BPF selftests that take addresses of kernel symbols declare them
explicitly, for example get_func_ip_test.c has:
extern int bpf_fentry_test1(int a) __ksym;
And kprobe_multi_session.c has:
extern const void bpf_fentry_test1 __ksym;
Without a similar declaration, will this BPF program compile and load
correctly?
+ return 0; +}
--- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21278745581