Re: [PATCH bpf-next v11 10/12] selftests/bpf: add testcases for fsession
From: Menglong Dong <hidden>
Date: 2026-01-23 08:06:11
Also in:
bpf, lkml
On 2026/1/23 15:57 bot+bpf-ci@kernel.org write:
quoted
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";[ ... ]quoted
+__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.
The symbol "bpf_fentry_test1" will be declared in vmlinux.h, which is generated automatically.
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?As I said above, it won't cause compile problem. Thanks! Menglong Dong
quoted
+ 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