Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9052798ybl; Fri, 17 Jan 2020 05:39:07 -0800 (PST) X-Google-Smtp-Source: APXvYqz+4SuBJE9KwFnKEN/SCMkIdZAyU0TgTcRMSUbKW/4MsTvsv8HwGXacpbUVmTmQZHCff3g9 X-Received: by 2002:aca:af8b:: with SMTP id y133mr3413746oie.73.1579268347684; Fri, 17 Jan 2020 05:39:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579268347; cv=none; d=google.com; s=arc-20160816; b=B7P+N8KGfNefdxcUttAGozJ363WU94REVzrAmwFJEPZ3z9X4b6fKrEtIXQJFQkMQzN 9EhDN4v2d8Yg51FLA+5IeNZ114iG3UdxTzO8KK50STuod7ICEryRAzNSex5zmV0F5RMM g6Ory8J2zr6nxknW4pgLoM4f7ikD/w02OJ36sOg47lpNwBMid9Oos/MCHwqnx5YjtKLH bcziyMzdSbDGfUgIFh0R01gGMjBUSEHuz3gOmCLjNR9TPoda8x9S5JcEYGfIAi/4QOOv Lbf/H+aUHNdQ4rSyhBccBojI0Hg5MmVVlLbYSPM9nQycwL3XLW3NA7U7z6B44gxvOpeh ZKbw== 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=wv79wcIjCv8Dm7OR7RClFHC2xXjynjMMPfQf2Tr2Fo8=; b=Ry08eaWCo1AYyI6BytMxPASX4HLhDTNswHsXzuhL5111037g2X7Kq+vnjb7zAYCOcg AHHa+9KXnKWFr4JM9/DqoYWEQwmctwV2WLQzPyGoCdK61/3O2jlYCBsNsli6h5/gLGmS EP7gKIJRhWX4y3yzBvwdp3yidgEJyVExUjX33GhZTu06HZOEWuhTtqa0+zIWGGy9fXj8 vw/H95AUC98+Diwo0b1JWK1Yd3KacOneKb06E/tJ7k6EbU1WwrvSFHA2CkJQA0xYm8Yq hv/veaQ+xkxmhG/bo3U4QdRgCbiL76OBrDb2UZc/CB97XC4M5nnzfmihazB4oucuEr8n E93Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iCGoHuC6; 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 h22si15684246otk.18.2020.01.17.05.38.55; Fri, 17 Jan 2020 05:39:07 -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=iCGoHuC6; 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 S1726982AbgAQNgz (ORCPT + 99 others); Fri, 17 Jan 2020 08:36:55 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:55005 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728708AbgAQNgx (ORCPT ); Fri, 17 Jan 2020 08:36:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579268211; 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=wv79wcIjCv8Dm7OR7RClFHC2xXjynjMMPfQf2Tr2Fo8=; b=iCGoHuC65OB9ValGio4IyBrxsEaHaYFz/fkXhupQxLl5w5RR5GyLAaiZEMVVCGHSRsIlXE QBekutiEdLQ2WTMBhL//cq4hjU7lRB07SMpeaLzxXh6cvQ2iwQkjuXNjNV/fG5NOHwIcFW DyND/6XZoHrQnnYyLwiD4RCBzDV5blY= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1--vuxB2_JMsOz1JHdS9ApMg-1; Fri, 17 Jan 2020 08:36:50 -0500 X-MC-Unique: -vuxB2_JMsOz1JHdS9ApMg-1 Received: by mail-lf1-f69.google.com with SMTP id z3so4363399lfq.22 for ; Fri, 17 Jan 2020 05:36:49 -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=wv79wcIjCv8Dm7OR7RClFHC2xXjynjMMPfQf2Tr2Fo8=; b=Nz0yZ8US8aCFY8M7EnhaYgm9/D030TKxnBkPFARAf0ZBG6q618wEnfsIJHyha9uyhW zNmrq1iUbw/zHJcl1Av9e6Y39LOvl/I1N1x2767AyTz7A0/yAGrSliMjbMwtappU6Ci9 EDJMIT+oBr2soM6yXKf0EizxlQ7T1eBUymAlK1g7FJZmUB6x3kZfhc2q9+L3m53Km/1i 23cj6rfNp7pWppUJuMvUo7FC/ImMXh2upNbhlHYtYSL1jBLcwjk36Az+tzieg18M+VyV U4cl5GrN7ZV65eWvyPObgTV/gqaSdJg/3pXmgRmw8ZVEbfmfg/jSNLpYthNSnJ1UdxVY G1yQ== X-Gm-Message-State: APjAAAWKuMT53VilM255zZHysc7QX3kVCq58Zfau4qxKQ4cOjCBbOifZ I69QEjPJkelPg4pDK9a/6NR+vrSFt2qHPBU13rBrxI5LDKvDeHLZIdrqPDpBa12BzGXwvoRjXvl TobWx4KDkxZGlqXODsX5NQtaf X-Received: by 2002:a2e:9e19:: with SMTP id e25mr5545323ljk.179.1579268205887; Fri, 17 Jan 2020 05:36:45 -0800 (PST) X-Received: by 2002:a2e:9e19:: with SMTP id e25mr5545314ljk.179.1579268205612; Fri, 17 Jan 2020 05:36:45 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id b14sm12052204lff.68.2020.01.17.05.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:36:44 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 8547A1804D7; Fri, 17 Jan 2020 14:36:43 +0100 (CET) Subject: [PATCH bpf-next v4 06/10] bpftool: Use consistent include paths for libbpf 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: Fri, 17 Jan 2020 14:36:43 +0100 Message-ID: <157926820346.1555735.299604543718558729.stgit@toke.dk> In-Reply-To: <157926819690.1555735.10756593211671752826.stgit@toke.dk> References: <157926819690.1555735.10756593211671752826.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 Fix bpftool to include libbpf header files with the bpf/ prefix, to be consistent with external users of the library. Also ensure that all includes of exported libbpf header files (those that are exported on 'make install' of the library) use bracketed includes instead of quoted. 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. Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir") Acked-by: Andrii Nakryiko Signed-off-by: Toke Høiland-Jørgensen --- tools/bpf/bpftool/Documentation/bpftool-gen.rst | 2 +- tools/bpf/bpftool/Makefile | 2 +- tools/bpf/bpftool/btf.c | 8 ++++---- tools/bpf/bpftool/btf_dumper.c | 2 +- tools/bpf/bpftool/cgroup.c | 2 +- tools/bpf/bpftool/common.c | 4 ++-- tools/bpf/bpftool/feature.c | 4 ++-- tools/bpf/bpftool/gen.c | 10 +++++----- tools/bpf/bpftool/jit_disasm.c | 2 +- tools/bpf/bpftool/main.c | 4 ++-- tools/bpf/bpftool/map.c | 4 ++-- tools/bpf/bpftool/map_perf_ring.c | 4 ++-- tools/bpf/bpftool/net.c | 8 ++++---- tools/bpf/bpftool/netlink_dumper.c | 4 ++-- tools/bpf/bpftool/perf.c | 2 +- tools/bpf/bpftool/prog.c | 6 +++--- tools/bpf/bpftool/xlated_dumper.c | 2 +- 17 files changed, 35 insertions(+), 35 deletions(-) diff --git a/tools/bpf/bpftool/Documentation/bpftool-gen.rst b/tools/bpf/bpftool/Documentation/bpftool-gen.rst index 86a87da97d0b..94d91322895a 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-gen.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-gen.rst @@ -196,7 +196,7 @@ and global variables. #define __EXAMPLE_SKEL_H__ #include - #include + #include struct example { struct bpf_object_skeleton *skeleton; diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 39bc6f0f4f0b..c4e810335810 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -45,7 +45,7 @@ CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \ -I$(srctree)/kernel/bpf/ \ -I$(srctree)/tools/include \ -I$(srctree)/tools/include/uapi \ - -I$(srctree)/tools/lib/bpf \ + -I$(srctree)/tools/lib \ -I$(srctree)/tools/perf CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"' ifneq ($(EXTRA_CFLAGS),) diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index 60c75be0666d..4ba90d81b6a1 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -8,15 +8,15 @@ #include #include #include -#include -#include +#include +#include +#include #include #include #include #include #include -#include "btf.h" #include "json_writer.h" #include "main.h" @@ -532,7 +532,7 @@ static int do_dump(int argc, char **argv) if (IS_ERR(btf)) { err = PTR_ERR(btf); btf = NULL; - p_err("failed to load BTF from %s: %s", + p_err("failed to load BTF from %s: %s", *argv, strerror(err)); goto done; } diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c index d66131f69689..eb4a142016a0 100644 --- a/tools/bpf/bpftool/btf_dumper.c +++ b/tools/bpf/bpftool/btf_dumper.c @@ -8,8 +8,8 @@ #include #include #include +#include -#include "btf.h" #include "json_writer.h" #include "main.h" diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c index 2f017caa678d..62c6a1d7cd18 100644 --- a/tools/bpf/bpftool/cgroup.c +++ b/tools/bpf/bpftool/cgroup.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include "main.h" diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c index 88264abaa738..b75b8ec5469c 100644 --- a/tools/bpf/bpftool/common.c +++ b/tools/bpf/bpftool/common.c @@ -20,8 +20,8 @@ #include #include -#include -#include /* libbpf_num_possible_cpus */ +#include +#include /* libbpf_num_possible_cpus */ #include "main.h" diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c index 94735d968c34..446ba891f1e2 100644 --- a/tools/bpf/bpftool/feature.c +++ b/tools/bpf/bpftool/feature.c @@ -12,8 +12,8 @@ #include #include -#include -#include +#include +#include #include #include "main.h" diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c index 7ce09a9a6999..f8113b3646f5 100644 --- a/tools/bpf/bpftool/gen.c +++ b/tools/bpf/bpftool/gen.c @@ -12,15 +12,15 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include +#include -#include "btf.h" -#include "libbpf_internal.h" +#include "bpf/libbpf_internal.h" #include "json_writer.h" #include "main.h" @@ -333,7 +333,7 @@ static int do_skeleton(int argc, char **argv) #define %2$s \n\ \n\ #include \n\ - #include \n\ + #include \n\ \n\ struct %1$s { \n\ struct bpf_object_skeleton *skeleton; \n\ diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c index bfed711258ce..f7f5885aa3ba 100644 --- a/tools/bpf/bpftool/jit_disasm.c +++ b/tools/bpf/bpftool/jit_disasm.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "json_writer.h" #include "main.h" diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c index 1fe91c558508..6d41bbfc6459 100644 --- a/tools/bpf/bpftool/main.c +++ b/tools/bpf/bpftool/main.c @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #include "main.h" diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 86f8ab0b7e63..e6c85680b34d 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -15,9 +15,9 @@ #include #include -#include +#include +#include -#include "btf.h" #include "json_writer.h" #include "main.h" diff --git a/tools/bpf/bpftool/map_perf_ring.c b/tools/bpf/bpftool/map_perf_ring.c index 4c5531d1a450..d9b29c17fbb8 100644 --- a/tools/bpf/bpftool/map_perf_ring.c +++ b/tools/bpf/bpftool/map_perf_ring.c @@ -6,7 +6,7 @@ */ #include #include -#include +#include #include #include #include @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include "main.h" diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c index d93bee298e54..c5e3895b7c8b 100644 --- a/tools/bpf/bpftool/net.c +++ b/tools/bpf/bpftool/net.c @@ -7,7 +7,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -16,9 +17,8 @@ #include #include -#include -#include -#include "libbpf_internal.h" +#include "bpf/nlattr.h" +#include "bpf/libbpf_internal.h" #include "main.h" #include "netlink_dumper.h" diff --git a/tools/bpf/bpftool/netlink_dumper.c b/tools/bpf/bpftool/netlink_dumper.c index 550a0f537eed..5f65140b003b 100644 --- a/tools/bpf/bpftool/netlink_dumper.c +++ b/tools/bpf/bpftool/netlink_dumper.c @@ -3,11 +3,11 @@ #include #include -#include +#include #include #include -#include +#include "bpf/nlattr.h" #include "main.h" #include "netlink_dumper.h" diff --git a/tools/bpf/bpftool/perf.c b/tools/bpf/bpftool/perf.c index b2046f33e23f..3341aa14acda 100644 --- a/tools/bpf/bpftool/perf.c +++ b/tools/bpf/bpftool/perf.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include "main.h" diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 47a61ac42dc0..a3521deca869 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -17,9 +17,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "cfg.h" #include "main.h" diff --git a/tools/bpf/bpftool/xlated_dumper.c b/tools/bpf/bpftool/xlated_dumper.c index 5b91ee65a080..8608cd68cdd0 100644 --- a/tools/bpf/bpftool/xlated_dumper.c +++ b/tools/bpf/bpftool/xlated_dumper.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "disasm.h" #include "json_writer.h"