From patchwork Tue Jan 12 13:59:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12013617 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD719C433E9 for ; Tue, 12 Jan 2021 14:02:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D49D23110 for ; Tue, 12 Jan 2021 14:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730124AbhALOCJ (ORCPT ); Tue, 12 Jan 2021 09:02:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731388AbhALOCI (ORCPT ); Tue, 12 Jan 2021 09:02:08 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48A15C061795 for ; Tue, 12 Jan 2021 06:01:28 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id by27so2185500edb.10 for ; Tue, 12 Jan 2021 06:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x/yfuTkYujlI5zpMD6cZk7TUtmg/ofIBluQ9SYa0d4k=; b=Ob8lD9BwLkwk1Fwhio5z/w8szq2k9AeOJA2jTM9y549QSdSjGAMYhOREIggKoFq5H5 WnSptKhIuj+B/8236Wla9mZ55kuHovqGFJoxvZ69F6EYq54plqSQUC1u5ylM2tFmb6LQ sKtuCFRD7H8YABeo6aVuF43lYj5IU9S3bkiLwFw/Js0hupTDnF7edWIq3Ro5les+MXpo h6/IbfIIyP4Y5g9qeiNTVFUxgSfXMl5BHmQ8PYRh3zxOYAYtGnpebofb2PlYprQmTLI1 xJV31xaUjZbgw41U52eCpWFHXKpoxoDhOYWKorZ54q8R2+Qgq9m9qOqQ34aM5fHQXukE 6CAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x/yfuTkYujlI5zpMD6cZk7TUtmg/ofIBluQ9SYa0d4k=; b=Akls2HmFnjVaDBE5icZxcRHuSbTi+mB9NCtpfytjtcRuDmFT6zVnUSiAmyeYxjdEli DaWkcQcYvt2UDCc3BQ6hP+kPfMEOCsNF1Ja0XimTitWm9p9zdmjPyIxDwq9a1viNvfA0 O7s6Hqazzd38ySDkvw3mJYGcqElMNcvnUcFNYUDRwDDscLte0mmFWRLkcy7xuu0c/KNT HBcRqnLnknGUnLLJ02GuPH1jqNQut80EcOBdSpFIi5FhwsfxTbTI82oKCSZNpw7P1EmI JYnjkUcKaoUG58qDwcGvy2+uQSCJR2j6e78NiIeYi2MNqCwIbDSUE7zOTLJ3qxUVm95s PN8g== X-Gm-Message-State: AOAM532nkA0mhhavFnFjkcQN63bztOHivyery0D/4RKw6fWASeVrVVJ8 511ldBssOyixuJ1cM42QPctYH9HV1q2gBw== X-Google-Smtp-Source: ABdhPJwPwtnGSOqLzsGdYtrg6f/4OqrAfpVR5Xbc2Cj5OBeNB3lRApynbR27BLAxq4ivUhoJfAgexA== X-Received: by 2002:aa7:c5d6:: with SMTP id h22mr3466670eds.82.1610460086628; Tue, 12 Jan 2021 06:01:26 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id t19sm1227846ejc.62.2021.01.12.06.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 06:01:26 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next 1/5] selftests/bpf: Enable cross-building Date: Tue, 12 Jan 2021 14:59:56 +0100 Message-Id: <20210112135959.649075-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210112135959.649075-1-jean-philippe@linaro.org> References: <20210112135959.649075-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Build bpftool and resolve_btfids using the host toolchain when cross-compiling, since they are executed during build to generate the selftests. Add a host build directory in order to build both host and target version of libbpf. Build host tools using $(HOSTCC) defined in Makefile.include. Signed-off-by: Jean-Philippe Brucker Acked-by: Andrii Nakryiko --- tools/testing/selftests/bpf/Makefile | 43 ++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index c51df6b91bef..1d85565883ea 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 include ../../../../scripts/Kbuild.include include ../../../scripts/Makefile.arch +include ../../../scripts/Makefile.include CXX ?= $(CROSS_COMPILE)g++ @@ -113,7 +114,20 @@ SCRATCH_DIR := $(OUTPUT)/tools BUILD_DIR := $(SCRATCH_DIR)/build INCLUDE_DIR := $(SCRATCH_DIR)/include BPFOBJ := $(BUILD_DIR)/libbpf/libbpf.a -RESOLVE_BTFIDS := $(BUILD_DIR)/resolve_btfids/resolve_btfids +ifneq ($(CROSS_COMPILE),) +HOST_BUILD_DIR := $(BUILD_DIR)/host +HOST_SCRATCH_DIR := $(OUTPUT)/host-tools +else +HOST_BUILD_DIR := $(BUILD_DIR) +HOST_SCRATCH_DIR := $(SCRATCH_DIR) +endif +HOST_BPFOBJ := $(HOST_BUILD_DIR)/libbpf/libbpf.a +RESOLVE_BTFIDS := $(HOST_BUILD_DIR)/resolve_btfids/resolve_btfids + +# sort removes libbpf duplicates when not cross-building +MAKE_DIRS := $(sort $(BUILD_DIR)/libbpf $(HOST_BUILD_DIR)/libbpf \ + $(HOST_BUILD_DIR)/bpftool $(HOST_BUILD_DIR)/resolve_btfids \ + $(INCLUDE_DIR)) VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \ $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \ @@ -157,7 +171,7 @@ $(OUTPUT)/test_stub.o: test_stub.c $(BPFOBJ) $(call msg,CC,,$@) $(Q)$(CC) -c $(CFLAGS) -o $@ $< -DEFAULT_BPFTOOL := $(SCRATCH_DIR)/sbin/bpftool +DEFAULT_BPFTOOL := $(HOST_SCRATCH_DIR)/sbin/bpftool $(OUTPUT)/runqslower: $(BPFOBJ) | $(DEFAULT_BPFTOOL) $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ @@ -182,10 +196,11 @@ $(OUTPUT)/test_sysctl: cgroup_helpers.c BPFTOOL ?= $(DEFAULT_BPFTOOL) $(DEFAULT_BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) \ - $(BPFOBJ) | $(BUILD_DIR)/bpftool + $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/bpftool $(Q)$(MAKE) $(submake_extras) -C $(BPFTOOLDIR) \ - OUTPUT=$(BUILD_DIR)/bpftool/ \ - prefix= DESTDIR=$(SCRATCH_DIR)/ install + CC=$(HOSTCC) LD=$(HOSTLD) \ + OUTPUT=$(HOST_BUILD_DIR)/bpftool/ \ + prefix= DESTDIR=$(HOST_SCRATCH_DIR)/ install $(Q)mkdir -p $(BUILD_DIR)/bpftool/Documentation $(Q)RST2MAN_OPTS="--exit-status=1" $(MAKE) $(submake_extras) \ -C $(BPFTOOLDIR)/Documentation \ @@ -198,7 +213,16 @@ $(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \ DESTDIR=$(SCRATCH_DIR) prefix= all install_headers -$(BUILD_DIR)/libbpf $(BUILD_DIR)/bpftool $(BUILD_DIR)/resolve_btfids $(INCLUDE_DIR): +ifneq ($(BPFOBJ),$(HOST_BPFOBJ)) +$(HOST_BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ + ../../../include/uapi/linux/bpf.h \ + | $(INCLUDE_DIR) $(HOST_BUILD_DIR)/libbpf + $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) \ + OUTPUT=$(HOST_BUILD_DIR)/libbpf/ CC=$(HOSTCC) LD=$(HOSTLD) \ + DESTDIR=$(HOST_SCRATCH_DIR)/ prefix= all install_headers +endif + +$(MAKE_DIRS): $(call msg,MKDIR,,$@) $(Q)mkdir -p $@ @@ -211,7 +235,7 @@ else $(Q)cp "$(VMLINUX_H)" $@ endif -$(RESOLVE_BTFIDS): $(BPFOBJ) | $(BUILD_DIR)/resolve_btfids \ +$(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ $(TOOLSDIR)/bpf/resolve_btfids/main.c \ $(TOOLSDIR)/lib/rbtree.c \ $(TOOLSDIR)/lib/zalloc.c \ @@ -219,7 +243,8 @@ $(RESOLVE_BTFIDS): $(BPFOBJ) | $(BUILD_DIR)/resolve_btfids \ $(TOOLSDIR)/lib/ctype.c \ $(TOOLSDIR)/lib/str_error_r.c $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/resolve_btfids \ - OUTPUT=$(BUILD_DIR)/resolve_btfids/ BPFOBJ=$(BPFOBJ) + CC=$(HOSTCC) LD=$(HOSTLD) AR=$(HOSTAR) \ + OUTPUT=$(HOST_BUILD_DIR)/resolve_btfids/ BPFOBJ=$(HOST_BPFOBJ) # Get Clang's default includes on this system, as opposed to those seen by # '-target bpf'. This fixes "missing" files on some architectures/distros, @@ -450,7 +475,7 @@ $(OUTPUT)/bench: $(OUTPUT)/bench.o $(OUTPUT)/testing_helpers.o \ $(call msg,BINARY,,$@) $(Q)$(CC) $(LDFLAGS) -o $@ $(filter %.a %.o,$^) $(LDLIBS) -EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) \ +EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \ prog_tests/tests.h map_tests/tests.h verifier/tests.h \ feature \ $(addprefix $(OUTPUT)/,*.o *.skel.h no_alu32 bpf_gcc bpf_testmod.ko) From patchwork Tue Jan 12 13:59:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12013629 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AC61C433DB for ; Tue, 12 Jan 2021 14:02:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47A1323122 for ; Tue, 12 Jan 2021 14:02:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727779AbhALOCr (ORCPT ); Tue, 12 Jan 2021 09:02:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727331AbhALOCr (ORCPT ); Tue, 12 Jan 2021 09:02:47 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 450BEC0617A2 for ; Tue, 12 Jan 2021 06:01:29 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id ga15so3677271ejb.4 for ; Tue, 12 Jan 2021 06:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hpCVH5a6hvC4+S6dhiP+hhLVa4IrOyo2QyAihLIZoi8=; b=ZmOPNrpiH+mVTmTRz5FUC9VHUzKtgI31M0T9yLPHWEPJdDbLm9SvxRbXYVtn6t5zII jpxQU/YaeO2kNXl/wOGTxhTQraBdVFBl4boy+F+TtKZ/pcFzY0Ku4u9b3fCbL4NAcLzQ WKI0zb4eq0QH4+6LfXcx3ohR73VyEWu/cZnyOO1GMIU9d7IM1wm1vTcbCiQrHKSL44zE BGiov228ESMdD93HKT1Gwt+Pm2YOHK4luUDyDNxgie4VwCxz3IqxyZLIZLRR85RsWNll SzdDiYVDZz0F8TUQfUEFA/npi/OMY3EK8hM1mCnBmvfMwJCQDAVc+oA/UKWS1uj5SAeM M0WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hpCVH5a6hvC4+S6dhiP+hhLVa4IrOyo2QyAihLIZoi8=; b=aDw7ZcmyOwYYu+lXAHcIESP4uwVdWB06nu08hZPe5TCxcfx7deZ5V9dYs7GIU43+DH EKavbvXRlX4Pm5Qw1qO4p67oTf3W5asQthA80N0uAhdpEzQOsbgd4ZEI8c/cAJU57gGl S8iKBqVx4uhQp4n0MnQqvOtw2o6UnvNYN2wER1We5frNMk/eg/Mnm4DVHUodMK4jkXQV Kf11Tmv92IGF+NH05T1agA1YaRhQLDpeUxFjlJTz/g+EvmTxg+WixxwkRw8EZZ3Xwxhs 8vCDRdG2CbK8dNYNd767m6euLhJ4OruE1+12EMQTMtCZ+S5jzjG5vYlnUon4YAu1FEG3 ysSg== X-Gm-Message-State: AOAM533btYG8FZbXc3yYE+IHK+RfzmX6oxIxSuRCDAOyIqMI6tXmnmv8 FVkI0qRFCEmQ7FCiAO5HyKIgSNptXn4ZKg== X-Google-Smtp-Source: ABdhPJxW01iw/VTh34sniz3jK20lfnTtc5wn7b/DerGex1x+RtQO/4s8z0Sly2bg7lsvfKIC0m/RMA== X-Received: by 2002:a17:906:440e:: with SMTP id x14mr3310201ejo.77.1610460087614; Tue, 12 Jan 2021 06:01:27 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id t19sm1227846ejc.62.2021.01.12.06.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 06:01:27 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next 2/5] selftests/bpf: Fix out-of-tree build Date: Tue, 12 Jan 2021 14:59:57 +0100 Message-Id: <20210112135959.649075-3-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210112135959.649075-1-jean-philippe@linaro.org> References: <20210112135959.649075-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net When building out-of-tree, the .skel.h files are generated into the $(OUTPUT) directory, rather than $(CURDIR). Add $(OUTPUT) to the include paths. Signed-off-by: Jean-Philippe Brucker Acked-by: Andrii Nakryiko --- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 1d85565883ea..3ff7e79cc497 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -25,7 +25,7 @@ BPF_GCC ?= $(shell command -v bpf-gcc;) SAN_CFLAGS ?= CFLAGS += -g -rdynamic -Wall -O2 $(GENFLAGS) $(SAN_CFLAGS) \ -I$(CURDIR) -I$(INCLUDE_DIR) -I$(GENDIR) -I$(LIBDIR) \ - -I$(TOOLSINCDIR) -I$(APIDIR) \ + -I$(TOOLSINCDIR) -I$(APIDIR) -I$(OUTPUT) \ -Dbpf_prog_load=bpf_prog_test_load \ -Dbpf_load_program=bpf_test_load_program LDLIBS += -lcap -lelf -lz -lrt -lpthread From patchwork Tue Jan 12 13:59:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12013635 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 991C2C433E0 for ; Tue, 12 Jan 2021 14:03:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6606B23110 for ; Tue, 12 Jan 2021 14:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728327AbhALOCy (ORCPT ); Tue, 12 Jan 2021 09:02:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727836AbhALOCx (ORCPT ); Tue, 12 Jan 2021 09:02:53 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEBC8C0617A4 for ; Tue, 12 Jan 2021 06:01:30 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id n26so3654830eju.6 for ; Tue, 12 Jan 2021 06:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dVnHIa5MKIrkM7yQ7+elQ2gqys62rHElWs015noXyHE=; b=DF5ZMmdb3jZoY4pEbqX1uelmAk7NcR3nJR6yDml7uEpzoztdllkzC7j+8pUkL8yjSz JyTOXA0W80PauKvsFCV6KfkGAhFccPQ5eQbjAUo9oA1R3Er0VQNTYq8Av2fQBNxdts8G Y1GB7O6jsiM8fOk3T1RegNNQ+lfEhqbe5XZLKjPGW6+goc4C0TzOyjDJEQT+4GHji/fv kM0QaAvJO6mi70+zYycP+Xe42QZeYHUXNJQbcIxBVoILMYdAMLkYFJz34yCpjAGAbnM0 JOz0Z7rHwQuvCN7hHlYx8xarA3QnEGzVrKdVmFC0myaz0cCVFL4wKxCKqwLxtV+GdNRn 8ftQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dVnHIa5MKIrkM7yQ7+elQ2gqys62rHElWs015noXyHE=; b=uGaAapr0iAjiemxotS0BaVDCjQe0AVbM2wf9kmgPxXlxhQRnclte1CAyio2rENAPVa nha8MLN35IT06RfxH6+NS+RMziMxPnwZx649TRBDr0+UdKf0PbzwcqL/0TTgIorA4E7N znHMZYrAUR1JAHFUopugEFHXzUICwv42ZDYrHBWiC18s9TVf+Ep5vSFW+mXs3hdSAAQz izlQ9Wv3Vp9+zK3fyP8RrmuNB/Svy59tZxLh91893jzYMfCvl+oLAVOsO7e2k/ZDbWpB 7uyqXWLVyNXr3Ls5jdJvrHoGN4bYc1KJaqGJ5R8lU/dU8okFkIPKIjLn7fCPPJlKmuaG fuAg== X-Gm-Message-State: AOAM533jCJXlouF4UssAFn33bEsmdGPYXKpK8H7K2nN5ERyulIt80YSW HNhXOvhpwrVkcrm95non+v+uP9iHtysU/w== X-Google-Smtp-Source: ABdhPJzFoQB6KPlQ6aSDFWMIEiNXeeFs+7Yv+hnopfnZsq+8P31aROYWtLreexou2fixGiC+q1K3UA== X-Received: by 2002:a17:906:f85:: with SMTP id q5mr3358548ejj.105.1610460089144; Tue, 12 Jan 2021 06:01:29 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id t19sm1227846ejc.62.2021.01.12.06.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 06:01:28 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next 3/5] selftests/bpf: Move generated test files to $(TEST_GEN_FILES) Date: Tue, 12 Jan 2021 14:59:58 +0100 Message-Id: <20210112135959.649075-4-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210112135959.649075-1-jean-philippe@linaro.org> References: <20210112135959.649075-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net During an out-of-tree build, attempting to install the $(TEST_FILES) into the $(OUTPUT) directory fails, because the objects were already generated into $(OUTPUT): rsync: [sender] link_stat "tools/testing/selftests/bpf/test_lwt_ip_encap.o" failed: No such file or directory (2) rsync: [sender] link_stat "tools/testing/selftests/bpf/test_tc_edt.o" failed: No such file or directory (2) Use $(TEST_GEN_FILES) instead. Signed-off-by: Jean-Philippe Brucker --- tools/testing/selftests/bpf/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 3ff7e79cc497..046848c508d1 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -44,10 +44,9 @@ ifneq ($(BPF_GCC),) TEST_GEN_PROGS += test_progs-bpf_gcc endif -TEST_GEN_FILES = -TEST_FILES = test_lwt_ip_encap.o \ - test_tc_edt.o \ - xsk_prereqs.sh +TEST_GEN_FILES = test_lwt_ip_encap.o \ + test_tc_edt.o +TEST_FILES = xsk_prereqs.sh # Order correspond to 'make run_tests' order TEST_PROGS := test_kmod.sh \ From patchwork Tue Jan 12 13:59:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12013633 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D69F8C433E6 for ; Tue, 12 Jan 2021 14:02:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9724B2310E for ; Tue, 12 Jan 2021 14:02:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728482AbhALOCt (ORCPT ); Tue, 12 Jan 2021 09:02:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727836AbhALOCs (ORCPT ); Tue, 12 Jan 2021 09:02:48 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC3CEC0617A6 for ; Tue, 12 Jan 2021 06:01:31 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id r5so2383120eda.12 for ; Tue, 12 Jan 2021 06:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x0YUj1+zjl+/xGU2slFlAP8CkLypp1CdWTvlwp1GroY=; b=I/9wyV1A3JsKrGZjPBsUfMhP4rl+e+p0AXnUvthIkVW5rIGUCd3nER7MS38cM9xtEa oJ7N098+ITPAOTtOn/9A6l05RZVXGMmFdt3QLjvfCDxiOXLIvZaa/0gPBtP1tV84W3Bz sce1BPEb2sYrwMR83wNMRX4wZLZ9GdB8ztujvwg6PL83v9t8sV/XNHlC5F84IssFds7o XNL7uFWPVjnGo8fJhTy/yk+qscito/aEXYyJGTMUo3q+WScfg35YJ0ZiBmKhd9+J81mp emob1lSxntMDSRHQ7c8Ec96ZIMv0H9GCV1AeULAdTaBG/rao6r6bpEEhCVub3+Z2sgGM 076Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x0YUj1+zjl+/xGU2slFlAP8CkLypp1CdWTvlwp1GroY=; b=qeD62aHfKnQ3Rj/n6aenT2iCFPF4e/jPb/EPrMndISc8cQWi5nzGEQEFW/bR21PaOX P653UVPrHw6hoji0hA616aZwc9UWmOFnUVfSydlV8sDrvOasEQWLycFyNWbF4lg/KmiN 2F9XDX0EC/mtZrQAvael+yCM+Efk5yM9d5CMYbFtS/T8f/2TTXdytfdCZjBs+TtZ7MqY OOYnkHhedLuR1tcWS3xa4sqAEM6LcjgS8iQiGcEqoDQZ+w+YHxL2n2OUwIxEGm33DTfb QDyUTf0rzXH8KCl+lIHuHVA1wCed2EQ52QAyVeV+9hcZ8QxZWC1FkirxWZGWSTGOevRx z7eQ== X-Gm-Message-State: AOAM533JQyJ6abbxWarGEhBpgcf+nGOgsYSGtMW8l0S+ehVQT/g91Ez8 F7dkk/yhsdIlnNkMcbwqQ7ar1+1oLbjpDQ== X-Google-Smtp-Source: ABdhPJyXw0Kj8q+RBw0xlDBiAfkrYa6nduRBvyDUPnzluIebbL9pnbrvbwlHWfGZmGNnlUN42X1p4w== X-Received: by 2002:aa7:c253:: with SMTP id y19mr3471449edo.179.1610460090237; Tue, 12 Jan 2021 06:01:30 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id t19sm1227846ejc.62.2021.01.12.06.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 06:01:29 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next 4/5] selftests/bpf: Fix installation of urandom_read Date: Tue, 12 Jan 2021 14:59:59 +0100 Message-Id: <20210112135959.649075-5-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210112135959.649075-1-jean-philippe@linaro.org> References: <20210112135959.649075-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net For out-of-tree builds, $(TEST_CUSTOM_PROGS) require the $(OUTPUT) prefix, otherwise the kselftest lib doesn't know how to install them: rsync: [sender] link_stat "tools/testing/selftests/bpf/urandom_read" failed: No such file or directory (2) Signed-off-by: Jean-Philippe Brucker Acked-by: Andrii Nakryiko --- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 046848c508d1..bffb4ad59a3d 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -82,7 +82,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \ test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \ xdpxceiver -TEST_CUSTOM_PROGS = urandom_read +TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read # Emit succinct information message describing current building step # $1 - generic step name (e.g., CC, LINK, etc); From patchwork Tue Jan 12 14:00:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12013631 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33184C43381 for ; Tue, 12 Jan 2021 14:02:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D879B2311B for ; Tue, 12 Jan 2021 14:02:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbhALOCt (ORCPT ); Tue, 12 Jan 2021 09:02:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728327AbhALOCt (ORCPT ); Tue, 12 Jan 2021 09:02:49 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D255DC0617A9 for ; Tue, 12 Jan 2021 06:01:32 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id d17so3638686ejy.9 for ; Tue, 12 Jan 2021 06:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zvv6LYFe9mpH/hRqRunavAEnNPwum4yHEeubUaepqPU=; b=fn2ddKJCzrB+l+1z5m6+nd4SmL9wKXkYV+xVkkUqLTNa4Gz0Bd7PZagGEkM0+Q7TeY t5XSjayvP+lEzr3klD/WCkA+RDf0RXTd+/MLvozm/DsrzqOZeWQVz870uCBMwCTeM8kQ S3RoufZj7egVsb1Bhu8vN25HMOJ4GFFb0IvssDiwCQ/1siQs5bg265M8zhwwRzszMvZ1 ysS6R3KpZeaq8yrZROExzfBJKUToRGL+Ylm7U+s53fIfLwspoTw0NmrSQv4o4ddH2eaC JjGRAxMGu/MZNHleKPa+mP/bvCrKRXtFbw6PxiqVp72wgpHE7LFnyCsf6pmmL9Vb1vXW hvNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zvv6LYFe9mpH/hRqRunavAEnNPwum4yHEeubUaepqPU=; b=iX84cyEdQxOW+A6Kl53tf+HfREnp8nuWNbBHAXLq4EuOhG/SE+21Nxfh9oTZFoXFeu BFwOS+BcZWBpfRLNoNFNFbZ8L8G10OFLI4i3GWjXVzZQIPIVK87aftfQ8LeiGd1zNsV5 qd2wXexCF/zOP9lwYTdpce+du4qAx/VvQv616jOWC9OfaQFtyVvdy/HqIc7DoMN9U9mi 61j92B9ziy869zo4vhjCMxBNxLzL6/H8iU2NHJvqUYV69JfAXuGdRGX5uIuA9BvKKLQk dMFU3S+NqRm+roGXnc0JvHJu/lyvjTEA2b+clJ9efx9kp4pEo0L4/gbaIctYybundBBk +Hwg== X-Gm-Message-State: AOAM531adPOY88QGIGLQ6HozjNZHGPL38BBjZY/Pc2z3eZUO23ibrokg wNniN0/K/Z1b0qa6ttKJ8B8dj33rZotjbw== X-Google-Smtp-Source: ABdhPJwHhtArJNQO66nuPMhZ8rDohJ7fWuQZz4+N1PD7Jl5K4O463zt25M/pYaw97ww/zijrHaDCvQ== X-Received: by 2002:a17:906:d209:: with SMTP id w9mr3259794ejz.211.1610460091282; Tue, 12 Jan 2021 06:01:31 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id t19sm1227846ejc.62.2021.01.12.06.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 06:01:30 -0800 (PST) From: Jean-Philippe Brucker To: bpf@vger.kernel.org Cc: shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kselftest@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH bpf-next 5/5] selftests/bpf: Install btf_dump test cases Date: Tue, 12 Jan 2021 15:00:00 +0100 Message-Id: <20210112135959.649075-6-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210112135959.649075-1-jean-philippe@linaro.org> References: <20210112135959.649075-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The btf_dump test cannot access the original source files for comparison when running the selftests out of tree, causing several failures: awk: btf_dump_test_case_syntax.c: No such file or directory ... Add those files to $(TEST_FILES) to have "make install" pick them up. Signed-off-by: Jean-Philippe Brucker --- tools/testing/selftests/bpf/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index bffb4ad59a3d..fb8cddc410c0 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -46,7 +46,14 @@ endif TEST_GEN_FILES = test_lwt_ip_encap.o \ test_tc_edt.o -TEST_FILES = xsk_prereqs.sh +TEST_FILES = xsk_prereqs.sh \ + progs/btf_dump_test_case_syntax.c \ + progs/btf_dump_test_case_ordering.c \ + progs/btf_dump_test_case_padding.c \ + progs/btf_dump_test_case_packing.c \ + progs/btf_dump_test_case_bitfields.c \ + progs/btf_dump_test_case_multidim.c \ + progs/btf_dump_test_case_namespacing.c # Order correspond to 'make run_tests' order TEST_PROGS := test_kmod.sh \