Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756430AbdLTUUg (ORCPT ); Wed, 20 Dec 2017 15:20:36 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:41174 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755222AbdLTUUb (ORCPT ); Wed, 20 Dec 2017 15:20:31 -0500 From: Roman Gushchin To: CC: , , , Roman Gushchin , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann Subject: [RFC PATCH net-next] tools/bpftool: use version from the kernel source tree Date: Wed, 20 Dec 2017 20:19:43 +0000 Message-ID: <20171220201943.24440-1-guro@fb.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c092:180::1:e6b3] X-ClientProxiedBy: DB6PR07CA0195.eurprd07.prod.outlook.com (2603:10a6:6:42::25) To BL2PR15MB1074.namprd15.prod.outlook.com (2603:10b6:201:17::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c134609-e82d-4382-a130-08d547e71100 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060);SRVR:BL2PR15MB1074; X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1074;3:iA1XkhPHnOV9PjH5ezdpcHMEd7FkvytDUE8SoVvbWFlM0luocdaxVFfOq+goB+qzJheR+cnKgwVKL1fSUcYv0xQp5cuWWZKs/shr6yTQ30/5i8PL4qp9XZXb20bZtVOVsT2aHFT12dx7S5xjbfoSV1FUjdq421RUZ+QLHb5H0rkdefqYpPNn5ICNt3CrhnNWVIC06ERu9/ftU9h8N92eByPdgFkXTXSa9TotupSHbTf6qSnmdFPy2aZqtXxM1JnR;25:1sKxySUfP6yaNCxWOT6PCxozhJX34ueK1TSJrgGHNmM+2KEffagGwtb23jmj0lrHUHLq415S2JeMYOTeIelkioSND9R/dZP5bUV2UMRa4OpwzPJ9D98lwDhD5J/E56msnWdb5lCTAUKEYkQxQvW0JSCxLAduWnG1Uyp5186f8d0CNwq+1F/ib4WUqMHWL9HzX0YO9EVYQwtBVtUpsd6+aoevGox4YFuiD6F47r6f9glWeHre/XPelj2JtmBBmvdkc7fOj4bUY6lynBlSvGj5fmeDin40WglF5/gVAdQliQ2NfFmICjO4M3vu3G4e10nnW/nbHX6DjLvHPxMsD0+jnA==;31:CV9TVo69F34j3lkXdYtEvmcavthrKIV3DdD87Jbh9Ume+/USah/WsDUpQPIGHy36Y1uQVnS3tyjcV/RA/XexaRJTnx3VzjQ/qDxGvkqU7Wqbpts5mY+XzrY1vgEG/0KsfGeffd/iperDo28F5v/4sweLdXAeOC+aV4l7mR5q5FGMDTojALRWMqW/teVWuSs1tmZg5SLRZdp1csOhDOPVVNsnegm+2I8SO0QcNSsML3w= X-MS-TrafficTypeDiagnostic: BL2PR15MB1074: X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1074;20:zm1brwgDCop57i1F6cBtjEjEpP7cdbjPedCdQDr0fDzfK/7mkLzKfKiDZPQC9z4Wq6R6i/vj90w37oIV7gKHqaQMQNVFHqHqS/2z95xefabF0y6WSX7lA2BzI40wb2xcNxraPMBZMVu2OC71gLnIhojh8/BwG5NZvzgw4j8mhx7t0dD+eMRyWeoeMfIFxVw+MHysFk3/lgxnM3AYW/64pxwNkiHoeFNXkAWkr4fxr87Ogk97+bsDRPwEpl9mv1c6YeDDziUkh+BsgtseDSXi8hGDj8KyacuKjMIVtn/GEUrCtXD+XFybzFf4gBfxrOyMwsNJgfRF4KbU9E0IJy2ZNNmtkEHdd8j/haD/QPYtZT52y1H1AJrr8MXWoa13j035BEuJFXsWf3Z2xRBPgBYyi0uKEk/Y5V2mcL/LLeOxSTrYt/H733uwPKp73sg65x/codqgy3IU7EzNh1lVeK+xhbbNOxBhE6xti6irLSwDL1gopMMauokhHxnD4gmyCD+w;4:fc3iHpbBmKmxR5ZQUI+KYpNeQ91oEKABRgglzhQeliHIdPpkaKMvN3/erQ2Zo1q+vD99tgR3nHZt4XCVnJNzVa72RRJxR7Bk6kJbNoywQ6spqEsLi7driTPI1O6t9C1MzQCrQrDGWv0AhrSkqw+OldnkA8L2VzYDrFnAOU5Mgdp8C3Qv6PnoLhY7zJJgs+wRW3N/YoQ1e2O/meT3T20w1kWReazCcVi+kS71S0Z7NAsw0DCGMEA6h6HJ1mraOPRnDSqmOrvYxtKl7z+XeK9glR/y36QXeE5BpDTO6mSQGh8bS8YJUKKcXIHj4yGsH88m X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(11241501184)(93006095)(93001095)(10201501046)(3002001)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:BL2PR15MB1074;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BL2PR15MB1074; X-Forefront-PRVS: 0527DFA348 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(39380400002)(39860400002)(376002)(346002)(366004)(189003)(199004)(386003)(6506007)(47776003)(54906003)(59450400001)(52116002)(53416004)(39060400002)(97736004)(52396003)(48376002)(53936002)(8676002)(6116002)(1076002)(50466002)(16586007)(81156014)(51416003)(106356001)(105586002)(68736007)(316002)(7736002)(25786009)(50226002)(6486002)(5660300001)(2351001)(8936002)(305945005)(69596002)(36756003)(6666003)(6916009)(2906002)(6512007)(81166006)(478600001)(86362001)(4326008)(2361001)(217873001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1074;H:castle.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q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jzm+tH+xE0cdgvId6gbIH1LThbB1wVpf9xGTwG5iNOcKc=;7:UQVPOVrLauQIC1U1qn/AiXNLGAb1jFD28S5oOVjx3sRmdQNcd0DFplxUYpw7/H4sVr/zwD/sZa9nR8GzENkswIb1tPS+hO0ceqUFTTXgHQ6p9024Ba6wRB9HkeeumiXRSX0NoKr+UDsF8cXc7cvBpCal2hX21WeDx3QgavTSw1/eH00LdL3J1wzHlGQexWe0lRo11ux08XxJIYn4XPfbX8f8VVj09e48ZxDtKZ5SivCY1RJc6IVA6ghQjeUDh1wH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1074;20:XEq/clMMw4H3YFsVit7Mf/BGx8ocUzVg7Ogoj7CIr767Tw5Pdo4oYUEwQzAY9J0u4lTdnI9Qr3hjUdtldxcZ6DUBthD++3/X4F2+/OLb+C9zFghBjEmbT56GnqDaAPiBwSZOypp3wHp+6qlvFG7tTrWAFbQ3Tvg2GI9JQImAJK4= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 20:20:07.6219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c134609-e82d-4382-a130-08d547e71100 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR15MB1074 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-20_07:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1462 Lines: 46 Bpftool determines it's own version based on the kernel version, which is picked from the linux/version.h header. It's strange to use the version of the installed kernel headers, and makes much more sense to use the version of the actual source tree, where bpftool sources are. This patch adds $(srctree)/usr/include to the list of include files, which causes bpftool to use the version from the source tree. Example: before: $ bpftool version bpftool v4.14.6 after: $ bpftool version bpftool v4.15.0 Signed-off-by: Roman Gushchin Cc: Jakub Kicinski Cc: Alexei Starovoitov Cc: Daniel Borkmann --- tools/bpf/bpftool/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 9c089cfa5f3f..6864d416c49e 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -37,7 +37,9 @@ CC = gcc CFLAGS += -O2 CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wshadow -CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi -I$(srctree)/tools/include -I$(srctree)/tools/lib/bpf -I$(srctree)/kernel/bpf/ +CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi +CFLAGS += -I$(srctree)/tools/include -I$(srctree)/tools/lib/bpf +CFLAGS += -I$(srctree)/kernel/bpf/ -I$(srctree)/usr/include LIBS = -lelf -lbfd -lopcodes $(LIBBPF) INSTALL ?= install -- 2.14.3