On Mon, Nov 03, 2025 at 11:47:36PM +0000, [email protected] wrote:
> > diff --git a/tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c
> > b/tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c
> > index 6fca459ba..282a068d2 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c
> > @@ -84,12 +84,58 @@ static void test_stacktrace_ips_kprobe_multi(bool
> > retprobe)
> > stacktrace_ips__destroy(skel);
> > }
> >
> > +static void test_stacktrace_ips_raw_tp(void)
> > +{
>
> [ ... ]
>
> > + /* get bpf program address */
> > + info.jited_ksyms = ptr_to_u64(&bpf_prog_ksym);
> > + info.nr_jited_ksyms = 1;
> > + err = bpf_prog_get_info_by_fd(bpf_program__fd(skel->progs.rawtp_test),
> > + &info, &info_len);
> > + if (ASSERT_OK(err, "bpf_prog_get_info_by_fd"))
> > + goto cleanup;
> ^^^^^^^^^^^^^^
>
> Is the error check inverted in test_stacktrace_ips_raw_tp()?
ugh, it is.. will fix it in next version
thanks,
jirka
>
> The ASSERT_OK macro returns true when err == 0 (success), so the code
> jumps to cleanup on success and continues on failure. Comparing with
> test_stacktrace_ips_kprobe_multi() at line 70, the pattern should be:
>
> if (!ASSERT_OK_PTR(...))
> goto cleanup;
>
> With the current code, bpf_prog_get_info_by_fd() success skips the test
> (trigger_module_test_read and check_stacktrace_ips), while failure
> continues with invalid bpf_prog_ksym data.
>
> > +
> > + trigger_module_test_read(1);
> > +
> > + load_kallsyms();
> > +
> > + check_stacktrace_ips(bpf_map__fd(skel->maps.stackmap),
> > skel->bss->stack_key, 2,
> > + bpf_prog_ksym,
> > + ksym_get_addr("bpf_trace_run2"));
> > +
> > +cleanup:
> > + stacktrace_ips__destroy(skel);
> > +}
> > +
>
> [ ... ]
>
>
> ---
> 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/19051288274