bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test
@ 2019-10-07  3:30 Andrii Nakryiko
  2019-10-07  5:28 ` Alexei Starovoitov
  2019-10-07 17:01 ` Alan Maguire
  0 siblings, 2 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2019-10-07  3:30 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko

Current Makefile dependency chain is not strict enough and allows
test_attach_probe.o to be built before test_progs's
prog_test/attach_probe.o is built, which leads to assembler compainig
about missing included binary.

This patch is a minimal fix to fix this issue by enforcing that
test_attach_probe.o (BPF object file) is built before
prog_tests/attach_probe.c is attempted to be compiled.

Fixes: 928ca75e59d7 ("selftests/bpf: switch tests to new bpf_object__open_{file, mem}() APIs")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 tools/testing/selftests/bpf/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 294d7472dad7..f899ed20ef4d 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -160,7 +160,8 @@ $(OUTPUT)/test_queue_map.o: test_queue_stack_map.h
 $(OUTPUT)/test_stack_map.o: test_queue_stack_map.h
 
 $(OUTPUT)/flow_dissector_load.o: flow_dissector_load.h
-$(OUTPUT)/test_progs.o: flow_dissector_load.h $(OUTPUT)/test_attach_probe.o
+prog_tests/attach_probe.c: $(OUTPUT)/test_attach_probe.o
+$(OUTPUT)/test_progs.o: flow_dissector_load.h
 
 BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris)
 BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
-- 
2.17.1


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

* Re: [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test
  2019-10-07  3:30 [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test Andrii Nakryiko
@ 2019-10-07  5:28 ` Alexei Starovoitov
  2019-10-07 17:36   ` Andrii Nakryiko
  2019-10-07 17:01 ` Alan Maguire
  1 sibling, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2019-10-07  5:28 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: bpf, Network Development, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Kernel Team

On Sun, Oct 6, 2019 at 8:31 PM Andrii Nakryiko <andriin@fb.com> wrote:
>
> Current Makefile dependency chain is not strict enough and allows
> test_attach_probe.o to be built before test_progs's
> prog_test/attach_probe.o is built, which leads to assembler compainig
> about missing included binary.
>
> This patch is a minimal fix to fix this issue by enforcing that
> test_attach_probe.o (BPF object file) is built before
> prog_tests/attach_probe.c is attempted to be compiled.
>
> Fixes: 928ca75e59d7 ("selftests/bpf: switch tests to new bpf_object__open_{file, mem}() APIs")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

It doesn't help.
Before and after I still see:
$ cd selftests/bpf/
$ make
...
/tmp/cco8plDk.s: Assembler messages:
/tmp/cco8plDk.s:8: Error: file not found: test_attach_probe.o

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

* Re: [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test
  2019-10-07  3:30 [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test Andrii Nakryiko
  2019-10-07  5:28 ` Alexei Starovoitov
@ 2019-10-07 17:01 ` Alan Maguire
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Maguire @ 2019-10-07 17:01 UTC (permalink / raw)
  To: Andrii Nakryiko; +Cc: bpf, netdev, ast, daniel, andrii.nakryiko, kernel-team

On Sun, 6 Oct 2019, Andrii Nakryiko wrote:

> Current Makefile dependency chain is not strict enough and allows
> test_attach_probe.o to be built before test_progs's
> prog_test/attach_probe.o is built, which leads to assembler compainig
> about missing included binary.
> 
> This patch is a minimal fix to fix this issue by enforcing that
> test_attach_probe.o (BPF object file) is built before
> prog_tests/attach_probe.c is attempted to be compiled.
> 
> Fixes: 928ca75e59d7 ("selftests/bpf: switch tests to new bpf_object__open_{file, mem}() APIs")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Reviewed-by: Alan Maguire <alan.maguire@oracle.com>

> ---
>  tools/testing/selftests/bpf/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 294d7472dad7..f899ed20ef4d 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -160,7 +160,8 @@ $(OUTPUT)/test_queue_map.o: test_queue_stack_map.h
>  $(OUTPUT)/test_stack_map.o: test_queue_stack_map.h
>  
>  $(OUTPUT)/flow_dissector_load.o: flow_dissector_load.h
> -$(OUTPUT)/test_progs.o: flow_dissector_load.h $(OUTPUT)/test_attach_probe.o
> +prog_tests/attach_probe.c: $(OUTPUT)/test_attach_probe.o
> +$(OUTPUT)/test_progs.o: flow_dissector_load.h
>  
>  BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris)
>  BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
> -- 
> 2.17.1
> 
> 

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

* Re: [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test
  2019-10-07  5:28 ` Alexei Starovoitov
@ 2019-10-07 17:36   ` Andrii Nakryiko
  0 siblings, 0 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2019-10-07 17:36 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Andrii Nakryiko, bpf, Network Development, Alexei Starovoitov,
	Daniel Borkmann, Kernel Team

On Sun, Oct 6, 2019 at 10:29 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Sun, Oct 6, 2019 at 8:31 PM Andrii Nakryiko <andriin@fb.com> wrote:
> >
> > Current Makefile dependency chain is not strict enough and allows
> > test_attach_probe.o to be built before test_progs's
> > prog_test/attach_probe.o is built, which leads to assembler compainig
> > about missing included binary.
> >
> > This patch is a minimal fix to fix this issue by enforcing that
> > test_attach_probe.o (BPF object file) is built before
> > prog_tests/attach_probe.c is attempted to be compiled.
> >
> > Fixes: 928ca75e59d7 ("selftests/bpf: switch tests to new bpf_object__open_{file, mem}() APIs")
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
>
> It doesn't help.
> Before and after I still see:
> $ cd selftests/bpf/
> $ make
> ...
> /tmp/cco8plDk.s: Assembler messages:
> /tmp/cco8plDk.s:8: Error: file not found: test_attach_probe.o

:( I'll try to come up with better fix then. Thanks for checking.

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

end of thread, other threads:[~2019-10-07 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07  3:30 [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test Andrii Nakryiko
2019-10-07  5:28 ` Alexei Starovoitov
2019-10-07 17:36   ` Andrii Nakryiko
2019-10-07 17:01 ` Alan Maguire

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).