APPLIED U: Re: [PATCH][Unstable/oem-5.6] UBUNTU: SAUCE: skip building selftest 'runqslower' if kernel not built

Paolo Pisati paolo.pisati at canonical.com
Tue May 12 14:28:47 UTC 2020


On Thu, May 07, 2020 at 08:58:24AM -0700, Kamal Mostafa wrote:
> Compiling the bpf selftest 'runqslower' requires access to the current
> built vmlinux -- see the VMLINUX_BTF machinery in
>   tools/bpf/runqslower/Makefile
>   tools/testing/selftests/bpf/Makefile
> 
> This means that the kernel must be compiled before the selftests can be
> compiled, which may be an annoyance.  In order to allow compiling the
> selftests without the kernel, skip building 'runqslower' with just a
> warning if it would otherwise fail this way.
> 
> Signed-off-by: Kamal Mostafa <kamal at canonical.com>
> Fixes: 9c01546d26d2 ("tools/bpf: Add runqslower tool to tools/bpf")
> Fixes: a835d38d41ca ("tools/bpf/runqslower: Fix override option for VMLINUX_BTF")
> ---
>  tools/testing/selftests/bpf/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 257a1aaaa37d..44023e1387c9 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -133,9 +133,15 @@ VMLINUX_BTF_PATHS := $(abspath ../../../../vmlinux)			\
>  			       /boot/vmlinux-$(shell uname -r)
>  VMLINUX_BTF:= $(firstword $(wildcard $(VMLINUX_BTF_PATHS)))
>  $(OUTPUT)/runqslower: $(BPFOBJ)
> -	$(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower	\
> +	$(Q)if [ ! -e "$(VMLINUX_BTF)" ] ; then \
> +		echo "WARNING: Skipping build of runqslower, because\n" \
> +		    "   Couldn't find kernel BTF (vmlinux not yet built?);\n" \
> +		    "   Set VMLINUX_BTF to specify its location." >&2; \
> +	    else
> +		$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower	\
>  		    OUTPUT=$(SCRATCH_DIR)/ VMLINUX_BTF=$(VMLINUX_BTF)   \
>  		    BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR)
> +	    fi
>  
>  $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): $(OUTPUT)/test_stub.o $(BPFOBJ)
>  
> -- 
> 2.17.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

-- 
bye,
p.



More information about the kernel-team mailing list