Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6535118ybl; Wed, 15 Jan 2020 06:17:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwsNFaiZzFyqhg1oemkrFPMzmWXhwK1lGQPIEfznH2fj8wlCDx4WWW+Zn7yC8791veaDjIP X-Received: by 2002:a9d:7f16:: with SMTP id j22mr2831218otq.256.1579097852915; Wed, 15 Jan 2020 06:17:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579097852; cv=none; d=google.com; s=arc-20160816; b=tbq57mdYTXIKrEBvxxyxi2TtedCdC8ymXdgCYNXIh30hzdODbd2ZHliH+Vea0AMnE9 C5VT3GF1ySdMlalDffyFMeScnCSCGqJxf85btYR41lyb+nuATb2M1HUr9dKKUMYe7No0 lj7tOPTwZr00MzTlF5AZLgL997IcLUcPXCCcUPQ3e2DNFgXQOF8jbMceRoMJUYbNh3WW TyqcAnoFKJJLTt2tXic53St9XrYJQkeqJHrJdlhUCWkVdxgFzmpSGEdhCCCO1pwVqJqG pPh1ZMTfPd/ePQoL4U19/cq1I7Y/GP9km342p2lYwfiLg31ips4pxXszKa1/2k5HKKL8 Vcmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=DpxFK0rlkhyTfyqA9bHWu7DLL4byHWgLPixehsmQCkc=; b=PZAQiwcvRL66dh1hjrVu5wbM3y7lHYw9gkEv7S0NGzSA37CzDSukKHmvke4vG8RRX8 DAgFC0iCsLLBoqPYVhwCSBeKTNkwIfjzZVHPU/rQVEpWfROiKtH10Hc0FJ3j/yFMaapf Ah5yuVazsKJK7JAlWUamZ3GOHq+1ah9q8cIWGb1A15A0IMzW6zuxVKE9YTZ8/TiqbUm5 en6xFn+71tjIQ/rG4RrzXl33yjMaSh/nHk68Vg/bA9+D/vYjr9CkkVkGFiPV0ongMxAy OcqWgDagbGFrQtWMRZwkFqQcBbFoDdCgFZWBoriwCHVsfy+CUdQDD39dsnbu7faMngA6 AHnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NRQ7SK3L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si8645336oii.37.2020.01.15.06.17.20; Wed, 15 Jan 2020 06:17:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NRQ7SK3L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729663AbgAOONJ (ORCPT + 99 others); Wed, 15 Jan 2020 09:13:09 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20664 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729489AbgAOONF (ORCPT ); Wed, 15 Jan 2020 09:13:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579097584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DpxFK0rlkhyTfyqA9bHWu7DLL4byHWgLPixehsmQCkc=; b=NRQ7SK3LdxdVi1rEO+DydgmdUrhKRJmDOJSvtRGrtS50JBywTXB2KrCdfsNNBBbtzKstkV TW5XnxW9rHxaIQVy/2PLj+wtROJZflQ80hsf8bOiOT4IgR70pDvt05SIxyqhJYXfd+xqkV hE9mUTrmCnAnJNdqgjbucgmdOil9C/0= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-Tz1GyTXrMymyM6zD5xxnfA-1; Wed, 15 Jan 2020 09:13:03 -0500 X-MC-Unique: Tz1GyTXrMymyM6zD5xxnfA-1 Received: by mail-lf1-f70.google.com with SMTP id 6so3265296lfj.17 for ; Wed, 15 Jan 2020 06:13:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DpxFK0rlkhyTfyqA9bHWu7DLL4byHWgLPixehsmQCkc=; b=WfnnsdGwcw2pyCIV2CUNA9RicQ55XY75Oim0NQP/Q8MukBSQZ7H5cvWjX/gySBVQik +hwUsUZxhR9qnvUBS2KqN7kSXzygNrX6HCIRplVsqcl2J4+2vP2RU14S9MrNIvrcpUfH Oe2VhDjBXeTWLU1aZIfZvfFOnP4HbHCUBY3OP6C57ddsgbnJVFGXALsIBkDtF51sdBjK E10lVChz4XiD3apRKKAgksDeikKFEGVxaQfngHtsuoJR0+GYNcbUV62P6cPY9KCicfky rG9cmCQJuYSbizwU84jtPI6ikZsuWQ4CpC4HumjFTs4PjsUMXuDgNkO5gjwI1nt03set Qy/g== X-Gm-Message-State: APjAAAUTsrsB0JDCtMitgjXjF1f2bHCb73bDp9OSOPNIUB42I2U8cVBG oBVr/vuRkmkYpWQYytXwIgrV7dOv0lzKhBWmr/uv9nQepIJ2kXBi1WX8mhE5wNGFaLv2Wb9amCD Co4r2RBsmxzocJSmlk1l0fM8E X-Received: by 2002:a19:5e16:: with SMTP id s22mr4861206lfb.33.1579097581944; Wed, 15 Jan 2020 06:13:01 -0800 (PST) X-Received: by 2002:a19:5e16:: with SMTP id s22mr4861193lfb.33.1579097581717; Wed, 15 Jan 2020 06:13:01 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id i17sm9293135ljd.34.2020.01.15.06.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 06:13:01 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id AA90D1804D8; Wed, 15 Jan 2020 15:12:58 +0100 (CET) Subject: [PATCH bpf-next v2 09/10] selftests: Remove tools/lib/bpf from include path From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Alexei Starovoitov Cc: Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Doug Ledford , Jason Gunthorpe , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com Date: Wed, 15 Jan 2020 15:12:58 +0100 Message-ID: <157909757860.1192265.1725940708658939712.stgit@toke.dk> In-Reply-To: <157909756858.1192265.6657542187065456112.stgit@toke.dk> References: <157909756858.1192265.6657542187065456112.stgit@toke.dk> User-Agent: StGit/0.21 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Toke Høiland-Jørgensen To make sure no new files are introduced that doesn't include the bpf/ prefix in its #include, remove tools/lib/bpf from the include path entirely, and use tools/lib instead. To fix the original issue with bpf_helper_defs.h being stale, change the Makefile rule to regenerate the file in the lib/bpf dir instead of having a local copy in selftests. Signed-off-by: Toke Høiland-Jørgensen --- tools/testing/selftests/bpf/.gitignore | 3 ++- tools/testing/selftests/bpf/Makefile | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore index 1d14e3ab70be..17dd02651dee 100644 --- a/tools/testing/selftests/bpf/.gitignore +++ b/tools/testing/selftests/bpf/.gitignore @@ -33,10 +33,11 @@ libbpf.pc libbpf.so.* test_hashmap test_btf_dump +test_cgroup_attach +test_select_reuseport xdping test_cpp *.skel.h /no_alu32 /bpf_gcc /tools -bpf_helper_defs.h diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index cd98ae875e30..4889cc3ead4b 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -21,7 +21,7 @@ LLC ?= llc LLVM_OBJCOPY ?= llvm-objcopy BPF_GCC ?= $(shell command -v bpf-gcc;) CFLAGS += -g -Wall -O2 $(GENFLAGS) -I$(CURDIR) -I$(APIDIR) -I$(LIBDIR) \ - -I$(BPFDIR) -I$(GENDIR) -I$(TOOLSINCDIR) \ + -I$(GENDIR) -I$(TOOLSINCDIR) \ -Dbpf_prog_load=bpf_prog_test_load \ -Dbpf_load_program=bpf_test_load_program LDLIBS += -lcap -lelf -lz -lrt -lpthread @@ -129,7 +129,7 @@ $(OUTPUT)/runqslower: force $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ OUTPUT=$(CURDIR)/tools/ -BPFOBJ := $(OUTPUT)/libbpf.a +BPFOBJ := $(BPFDIR)/libbpf.a $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): $(OUTPUT)/test_stub.o $(BPFOBJ) @@ -155,17 +155,17 @@ force: DEFAULT_BPFTOOL := $(OUTPUT)/tools/sbin/bpftool BPFTOOL ?= $(DEFAULT_BPFTOOL) -$(DEFAULT_BPFTOOL): force +$(DEFAULT_BPFTOOL): force $(BPFOBJ) $(Q)$(MAKE) $(submake_extras) -C $(BPFTOOLDIR) \ prefix= DESTDIR=$(OUTPUT)/tools/ install $(BPFOBJ): force - $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(OUTPUT)/ + $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BPFDIR)/ $(BPFOBJ) -BPF_HELPERS := $(OUTPUT)/bpf_helper_defs.h $(wildcard $(BPFDIR)/bpf_*.h) -$(OUTPUT)/bpf_helper_defs.h: $(BPFOBJ) +BPF_HELPERS := $(BPFDIR)/bpf_helper_defs.h $(wildcard $(BPFDIR)/bpf_*.h) +$(BPFDIR)/bpf_helper_defs.h: $(BPFOBJ) $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) \ - OUTPUT=$(OUTPUT)/ $(OUTPUT)/bpf_helper_defs.h + OUTPUT=$(BPFDIR)/ $(BPFDIR)/bpf_helper_defs.h # Get Clang's default includes on this system, as opposed to those seen by # '-target bpf'. This fixes "missing" files on some architectures/distros, @@ -186,7 +186,7 @@ MENDIAN=$(if $(IS_LITTLE_ENDIAN),-mlittle-endian,-mbig-endian) CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG)) BPF_CFLAGS = -g -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ -I$(OUTPUT) -I$(CURDIR) -I$(CURDIR)/include/uapi \ - -I$(APIDIR) -I$(LIBDIR) -I$(BPFDIR) -I$(abspath $(OUTPUT)/../usr/include) + -I$(APIDIR) -I$(LIBDIR) -I$(abspath $(OUTPUT)/../usr/include) CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-types