po 3. 11. 2025 v 16:10 odesílatel Wander Lairson Costa
<[email protected]> 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


Reply via email to