[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP4=nvSJq1kOUvBRwy_5Fh_FX=Qx-=xiRfngSyky1eVdZsGrrg@mail.gmail.com>
Date: Mon, 3 Nov 2025 16:17:08 +0100
From: Tomas Glozar <tglozar@...hat.com>
To: Wander Lairson Costa <wander@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, LKML <linux-kernel@...r.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@...r.kernel.org>, John Kacur <jkacur@...hat.com>,
Luis Goncalves <lgoncalv@...hat.com>, Costa Shulyupin <costa.shul@...hat.com>,
Crystal Wood <crwood@...hat.com>, Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: [PATCH v3 4/7] rtla/tests: Test BPF action program
po 3. 11. 2025 v 16:10 odesÃlatel Wander Lairson Costa
<wander@...hat.com> napsal:
> > diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile
> > index 5f1529ce3693..aef814b639b7 100644
> > --- a/tools/tracing/rtla/Makefile
> > +++ b/tools/tracing/rtla/Makefile
> > @@ -76,12 +76,18 @@ src/timerlat.skel.h: src/timerlat.bpf.o
> >
> > example/timerlat_bpf_action.o: example/timerlat_bpf_action.c
> > $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@
>
> I didn't understand why the filter function is needed. $< or $^ seems
> enough.
>
Ah, good catch. The filter is copied from the Makefile of stalld,
which includes a "vmlinux.h" in the targets. That makes the filter
needed, to prevent passing of the header file to the C compiler. It is
not needed here.
> > +
> > +tests/bpf/bpf_action_map.o: tests/bpf/bpf_action_map.c
> > + $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@
> > else
> > src/timerlat.skel.h:
> > $(Q)echo '/* BPF skeleton is disabled */' > src/timerlat.skel.h
> >
> > example/timerlat_bpf_action.o: example/timerlat_bpf_action.c
> > $(Q)echo "BPF skeleton support is disabled, skipping example/timerlat_bpf_action.o"
> > +
> > +tests/bpf/bpf_action_map.o: tests/bpf/bpf_action_map.c
> > + $(Q)echo "BPF skeleton support is disabled, skipping tests/bpf/bpf_action_map.o"
>
> Why not just not creating the targets if BPF is not enabled?
>
I could do that, but then, I would have to duplicate the check target.
> > endif
> >
> > $(RTLA): $(RTLA_IN)
> > @@ -103,7 +109,7 @@ clean: doc_clean fixdep-clean
> > $(Q)rm -f rtla rtla-static fixdep FEATURE-DUMP rtla-*
> > $(Q)rm -rf feature
> > $(Q)rm -f src/timerlat.bpf.o src/timerlat.skel.h example/timerlat_bpf_action.o
> > -check: $(RTLA)
> > - RTLA=$(RTLA) prove -o -f tests/
> > +check: $(RTLA) tests/bpf/bpf_action_map.o
>
> Will this work if BPF is disabled?
>
Yes, the bpf_action_map.o target will simply print the warning. You
can try it with:
$ make BUILD_BPF_SKEL=0 check
Thank you for the review.
Tomas
Powered by blists - more mailing lists