Re: [PATCH bpf-next 3/3] bpf/selftests: Enable fsession tests for LoongArch

Vincent Li
2026-02-27T01:59:55Z

On Wed, Feb 25, 2026 at 11:00 PM Hengqi Chen <hengqi.chen@gmail.com> wrote:
>
> Now that the LoongArch JIT supports BPF_TRACE_FSESSION, allow
> the fsession-related tests to run on LoongArch.
>
> $ ./test_progs -a fsession_test,get_func_args_test,get_func_ip_test
> #136/1 fsession_test/fsession_test:OK
> #136/2 fsession_test/fsession_reattach:OK
> #136/3 fsession_test/fsession_cookie:OK
> #136 fsession_test:OK
> #138 get_func_args_test:OK
> #139 get_func_ip_test:OK
> Summary: 3/3 PASSED, 0 SKIPPED, 0 FAILED
>

[root@fedora bpf]# ./test_progs -a
fsession_test,get_func_args_test,get_func_ip_test
#135/1 fsession_test/fsession_test:OK
#135/2 fsession_test/fsession_reattach:OK
#135/3 fsession_test/fsession_cookie:OK
#135 fsession_test:OK
#138 get_func_args_test:OK
#139 get_func_ip_test:OK
Summary: 3/3 PASSED, 0 SKIPPED, 0 FAILED

Tested-by: Vincent Li <vincent.mc.li@gmail.com>

> Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
> ---
> tools/testing/selftests/bpf/progs/get_func_args_test.c | 3 ++-
> tools/testing/selftests/bpf/progs/get_func_ip_test.c | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/progs/get_func_args_test.c b/tools/testing/selftests/bpf/progs/get_func_args_test.c
> index 075a1180ec26..afb185fdf60c 100644
> --- a/tools/testing/selftests/bpf/progs/get_func_args_test.c
> +++ b/tools/testing/selftests/bpf/progs/get_func_args_test.c
> @@ -167,7 +167,8 @@ int BPF_PROG(tp_test2)
> }
>
> __u64 test7_result = 0;
> -#if defined(bpf_target_x86) || defined(bpf_target_arm64) || defined(bpf_target_riscv)
> +#if defined(bpf_target_x86) || defined(bpf_target_arm64) || \
> + defined(bpf_target_riscv) || defined(bpf_target_loongarch)
> SEC("fsession/bpf_fentry_test1")
> int BPF_PROG(test7)
> {
> diff --git a/tools/testing/selftests/bpf/progs/get_func_ip_test.c b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> index 45eaa54d1ac7..3816a3616fbe 100644
> --- a/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> +++ b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> @@ -106,7 +106,8 @@ int BPF_URETPROBE(test8, int ret)
>
> __u64 test9_entry_result = 0;
> __u64 test9_exit_result = 0;
> -#if defined(bpf_target_x86) || defined(bpf_target_arm64) || defined(bpf_target_riscv)
> +#if defined(bpf_target_x86) || defined(bpf_target_arm64) || \
> + defined(bpf_target_riscv) || defined(bpf_target_loongarch)
> SEC("fsession/bpf_fentry_test1")
> int BPF_PROG(test9, int a)
> {
> --
> 2.43.5
>