Re: [PATCHv3 bpf-next 4/5] selftests/bpf: Add test for checking correct nop of optimized usdt

From: Jiri Olsa

Date: Thu Feb 12 2026 - 09:11:55 EST


On Wed, Feb 11, 2026 at 01:45:24PM -0800, Andrii Nakryiko wrote:

SNIP

> > diff --git a/tools/testing/selftests/bpf/progs/test_usdt.c b/tools/testing/selftests/bpf/progs/test_usdt.c
> > index a78c87537b07..6911868cdf67 100644
> > --- a/tools/testing/selftests/bpf/progs/test_usdt.c
> > +++ b/tools/testing/selftests/bpf/progs/test_usdt.c
> > @@ -138,4 +138,13 @@ int usdt_sib(struct pt_regs *ctx)
> > return 0;
> > }
> >
> > +int executed;
> > +
> > +SEC("usdt")
> > +int usdt_executed(struct pt_regs *ctx)
> > +{
> > + executed++;
>
> did you try capturing pt_reg's ip value and validating it?

ok, it's easy to add that check

jirka