netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] samples: bpf: don't run probes at the local make stage
@ 2019-06-07 17:11 Jakub Kicinski
  2019-06-11  6:38 ` Alexei Starovoitov
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2019-06-07 17:11 UTC (permalink / raw)
  To: alexei.starovoitov, daniel
  Cc: oss-drivers, netdev, bpf, Jakub Kicinski, Quentin Monnet

Quentin reports that commit 07c3bbdb1a9b ("samples: bpf: print
a warning about headers_install") is producing the false
positive when make is invoked locally, from the samples/bpf/
directory.

When make is run locally it hits the "all" target, which
will recursively invoke make through the full build system.

Speed up the "local" run which doesn't actually build anything,
and avoid false positives by skipping all the probes if not in
kbuild environment (cover both the new warning and the BTF
probes).

Reported-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
---
 samples/bpf/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4074a66a70ca..9eb5d733f575 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -206,6 +206,8 @@ HOSTCC = $(CROSS_COMPILE)gcc
 CLANG_ARCH_ARGS = -target $(ARCH)
 endif
 
+# Don't evaluate probes and warnings if we need to run make recursively
+ifneq ($(src),)
 HDR_PROBE := $(shell echo "\#include <linux/types.h>\n struct list_head { int a; }; int main() { return 0; }" | \
 	$(HOSTCC) $(KBUILD_HOSTCFLAGS) -x c - -o /dev/null 2>/dev/null && \
 	echo okay)
@@ -232,6 +234,7 @@ ifneq ($(and $(BTF_LLC_PROBE),$(BTF_PAHOLE_PROBE),$(BTF_OBJCOPY_PROBE)),)
 	DWARF2BTF = y
 endif
 endif
+endif
 
 # Trick to allow make to be run from this directory
 all:
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bpf-next] samples: bpf: don't run probes at the local make stage
  2019-06-07 17:11 [PATCH bpf-next] samples: bpf: don't run probes at the local make stage Jakub Kicinski
@ 2019-06-11  6:38 ` Alexei Starovoitov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2019-06-11  6:38 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Daniel Borkmann, oss-drivers, Network Development, bpf, Quentin Monnet

On Fri, Jun 7, 2019 at 10:11 AM Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
>
> Quentin reports that commit 07c3bbdb1a9b ("samples: bpf: print
> a warning about headers_install") is producing the false
> positive when make is invoked locally, from the samples/bpf/
> directory.
>
> When make is run locally it hits the "all" target, which
> will recursively invoke make through the full build system.
>
> Speed up the "local" run which doesn't actually build anything,
> and avoid false positives by skipping all the probes if not in
> kbuild environment (cover both the new warning and the BTF
> probes).
>
> Reported-by: Quentin Monnet <quentin.monnet@netronome.com>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>

Applied. Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-11  6:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 17:11 [PATCH bpf-next] samples: bpf: don't run probes at the local make stage Jakub Kicinski
2019-06-11  6:38 ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).