diff mbox series

[v2] selftests/bpf: Copy runqslower to OUTPUT directory

Message ID 20200428173742.2988395-1-vkabatov@redhat.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [v2] selftests/bpf: Copy runqslower to OUTPUT directory | expand

Commit Message

Veronika Kabatova April 28, 2020, 5:37 p.m. UTC
$(OUTPUT)/runqslower makefile target doesn't actually create runqslower
binary in the $(OUTPUT) directory. As lib.mk expects all
TEST_GEN_PROGS_EXTENDED (which runqslower is a part of) to be present in
the OUTPUT directory, this results in an error when running e.g. `make
install`:

rsync: link_stat "tools/testing/selftests/bpf/runqslower" failed: No
       such file or directory (2)

Copy the binary into the OUTPUT directory after building it to fix the
error.

Fixes: 3a0d3092a4ed ("selftests/bpf: Build runqslower from selftests")
Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
---
 tools/testing/selftests/bpf/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andrii Nakryiko April 28, 2020, 6:57 p.m. UTC | #1
On Tue, Apr 28, 2020 at 10:38 AM Veronika Kabatova <vkabatov@redhat.com> wrote:
>
> $(OUTPUT)/runqslower makefile target doesn't actually create runqslower
> binary in the $(OUTPUT) directory. As lib.mk expects all
> TEST_GEN_PROGS_EXTENDED (which runqslower is a part of) to be present in
> the OUTPUT directory, this results in an error when running e.g. `make
> install`:
>
> rsync: link_stat "tools/testing/selftests/bpf/runqslower" failed: No
>        such file or directory (2)
>
> Copy the binary into the OUTPUT directory after building it to fix the
> error.
>
> Fixes: 3a0d3092a4ed ("selftests/bpf: Build runqslower from selftests")
> Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
> ---

Looks good, thanks.

Acked-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 7729892e0b04..4e654d41c7af 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -141,7 +141,8 @@ VMLINUX_BTF := $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
>  $(OUTPUT)/runqslower: $(BPFOBJ)
>         $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower     \
>                     OUTPUT=$(SCRATCH_DIR)/ VMLINUX_BTF=$(VMLINUX_BTF)   \
> -                   BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR)
> +                   BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR) &&      \
> +                   cp $(SCRATCH_DIR)/runqslower $@
>
>  $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): $(OUTPUT)/test_stub.o $(BPFOBJ)
>
> --
> 2.25.1
>
Daniel Borkmann April 28, 2020, 7:40 p.m. UTC | #2
On 4/28/20 8:57 PM, Andrii Nakryiko wrote:
> On Tue, Apr 28, 2020 at 10:38 AM Veronika Kabatova <vkabatov@redhat.com> wrote:
>>
>> $(OUTPUT)/runqslower makefile target doesn't actually create runqslower
>> binary in the $(OUTPUT) directory. As lib.mk expects all
>> TEST_GEN_PROGS_EXTENDED (which runqslower is a part of) to be present in
>> the OUTPUT directory, this results in an error when running e.g. `make
>> install`:
>>
>> rsync: link_stat "tools/testing/selftests/bpf/runqslower" failed: No
>>         such file or directory (2)
>>
>> Copy the binary into the OUTPUT directory after building it to fix the
>> error.
>>
>> Fixes: 3a0d3092a4ed ("selftests/bpf: Build runqslower from selftests")
>> Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
>> ---
> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>

Applied, thanks!
Andrii Nakryiko April 29, 2020, 12:15 a.m. UTC | #3
On Tue, Apr 28, 2020 at 12:40 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> On 4/28/20 8:57 PM, Andrii Nakryiko wrote:
> > On Tue, Apr 28, 2020 at 10:38 AM Veronika Kabatova <vkabatov@redhat.com> wrote:
> >>
> >> $(OUTPUT)/runqslower makefile target doesn't actually create runqslower
> >> binary in the $(OUTPUT) directory. As lib.mk expects all
> >> TEST_GEN_PROGS_EXTENDED (which runqslower is a part of) to be present in
> >> the OUTPUT directory, this results in an error when running e.g. `make
> >> install`:
> >>
> >> rsync: link_stat "tools/testing/selftests/bpf/runqslower" failed: No
> >>         such file or directory (2)
> >>
> >> Copy the binary into the OUTPUT directory after building it to fix the
> >> error.
> >>
> >> Fixes: 3a0d3092a4ed ("selftests/bpf: Build runqslower from selftests")
> >> Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
> >> ---
> >
> > Acked-by: Andrii Nakryiko <andriin@fb.com>
>
> Applied, thanks!

Veronika,

This change leaves runqslower laying around in selftests/bpf directory
and available to be committed into git. Can you please follow up with
adding runqslower to .gitignore? Thanks!
Andrii Nakryiko April 29, 2020, 1:25 a.m. UTC | #4
On Tue, Apr 28, 2020 at 5:15 PM Andrii Nakryiko
<andrii.nakryiko@gmail.com> wrote:
>
> On Tue, Apr 28, 2020 at 12:40 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
> >
> > On 4/28/20 8:57 PM, Andrii Nakryiko wrote:
> > > On Tue, Apr 28, 2020 at 10:38 AM Veronika Kabatova <vkabatov@redhat.com> wrote:
> > >>
> > >> $(OUTPUT)/runqslower makefile target doesn't actually create runqslower
> > >> binary in the $(OUTPUT) directory. As lib.mk expects all
> > >> TEST_GEN_PROGS_EXTENDED (which runqslower is a part of) to be present in
> > >> the OUTPUT directory, this results in an error when running e.g. `make
> > >> install`:
> > >>
> > >> rsync: link_stat "tools/testing/selftests/bpf/runqslower" failed: No
> > >>         such file or directory (2)
> > >>
> > >> Copy the binary into the OUTPUT directory after building it to fix the
> > >> error.
> > >>
> > >> Fixes: 3a0d3092a4ed ("selftests/bpf: Build runqslower from selftests")
> > >> Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
> > >> ---
> > >
> > > Acked-by: Andrii Nakryiko <andriin@fb.com>
> >
> > Applied, thanks!
>
> Veronika,
>
> This change leaves runqslower laying around in selftests/bpf directory
> and available to be committed into git. Can you please follow up with
> adding runqslower to .gitignore? Thanks!

Never mind anymore, sent fix as part of ASAN fixes patch set.
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 7729892e0b04..4e654d41c7af 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -141,7 +141,8 @@  VMLINUX_BTF := $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
 $(OUTPUT)/runqslower: $(BPFOBJ)
 	$(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower	\
 		    OUTPUT=$(SCRATCH_DIR)/ VMLINUX_BTF=$(VMLINUX_BTF)   \
-		    BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR)
+		    BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR) &&	\
+		    cp $(SCRATCH_DIR)/runqslower $@
 
 $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): $(OUTPUT)/test_stub.o $(BPFOBJ)