From patchwork Thu May 7 15:58:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 1285466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Hyps6xtSz9sVG; Fri, 8 May 2020 02:00:20 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jWiwa-00082w-66; Thu, 07 May 2020 16:00:16 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jWiwY-00082g-Uf for kernel-team@lists.ubuntu.com; Thu, 07 May 2020 16:00:15 +0000 Received: from 3.general.kamal.us.vpn ([10.172.68.53] helo=ascalon) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jWiuq-0005kM-EE; Thu, 07 May 2020 15:58:28 +0000 Received: from kamal by ascalon with local (Exim 4.90_1) (envelope-from ) id 1jWiuo-0002P9-6l; Thu, 07 May 2020 08:58:26 -0700 From: Kamal Mostafa To: kernel-team@lists.ubuntu.com Subject: [PATCH][Unstable/oem-5.6] UBUNTU: SAUCE: skip building selftest 'runqslower' if kernel not built Date: Thu, 7 May 2020 08:58:24 -0700 Message-Id: <20200507155824.9160-1-kamal@canonical.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kamal Mostafa MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" 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 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)