[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5069094.31r3eYUQgx@7940hx>
Date: Wed, 17 Dec 2025 19:42:06 +0800
From: Menglong Dong <menglong.dong@...ux.dev>
To: menglong8.dong@...il.com, ast@...nel.org, andrii@...nel.org,
bot+bpf-ci@...nel.org
Cc: davem@...emloft.net, dsahern@...nel.org, daniel@...earbox.net,
martin.lau@...ux.dev, eddyz87@...il.com, song@...nel.org,
yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org,
sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, ast@...nel.org, andrii@...nel.org,
daniel@...earbox.net, martin.lau@...nel.org, eddyz87@...il.com,
yonghong.song@...ux.dev, clm@...a.com, ihor.solodrai@...ux.dev
Subject:
Re: [PATCH bpf-next v4 8/9] selftests/bpf: add testcases for tracing session
On 2025/12/17 18:24 bot+bpf-ci@...nel.org write:
> > 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?
It seems that it is generated into vmlinux.h, and that's why it works
well during compilation and runtime.
Thanks!
Menglong Dong
>
>
> ---
> 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
>
Powered by blists - more mailing lists