Re: [PATCH bpf-next v4 8/9] selftests/bpf: add testcases for tracing session
From: bot+bpf-ci@kernel.org
Date: 2025-12-17 10:24:46
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..f7c96ef1c7a9 --- /dev/null +++ b/tools/testing/selftests/bpf/progs/fsession_test.c@@ -0,0 +1,192 @@ +// 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 test8_entry_result = 0;
+__u64 test8_exit_result = 0;
+SEC("fsession/bpf_fentry_test1")
+int BPF_PROG(test8, int a)
+{
+ __u64 addr = bpf_get_func_ip(ctx);
+
+ if (bpf_fsession_is_return(ctx))
+ test8_exit_result = (const void *) addr == &bpf_fentry_test1;
+ else
+ test8_entry_result = (const void *) addr == &bpf_fentry_test1;
+ return 0;
+}
In test8, the code uses &bpf_fentry_test1 without declaring it. Looking at
similar tests like kprobe_multi.c and kprobe_multi_session.c, they include:
extern const void bpf_fentry_test1 __ksym;
at the top of the file before taking the address of kernel symbols.
Without the __ksym declaration, does the comparison work correctly, or
would this cause the test to fail during compilation or at runtime?
---
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/20299185010