Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756432AbdLTU4k (ORCPT ); Wed, 20 Dec 2017 15:56:40 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:49344 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754428AbdLTU4h (ORCPT ); Wed, 20 Dec 2017 15:56:37 -0500 Date: Wed, 20 Dec 2017 20:56:00 +0000 From: Roman Gushchin To: Yonghong Song CC: , , , , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann Subject: Re: [RFC PATCH net-next] tools/bpftool: use version from the kernel source tree Message-ID: <20171220205559.GB28352@castle> References: <20171220201943.24440-1-guro@fb.com> <1fa179c1-4725-7e37-b5a9-5d7d8d36a37a@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1fa179c1-4725-7e37-b5a9-5d7d8d36a37a@fb.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [2620:10d:c092:180::1:e6b3] X-ClientProxiedBy: VI1PR0602CA0024.eurprd06.prod.outlook.com (2603:10a6:800:bc::34) To CO1PR15MB1078.namprd15.prod.outlook.com (2a01:111:e400:7b66::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25113008-65ad-4a24-5465-08d547ec1ca0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060);SRVR:CO1PR15MB1078; X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1078;3:dZem232OLCRiL+AvdCQOnqaxUFyiTKi/uRYp5lPazX3aXPF8exlFdFszF2bOsDBjrESE/qQ0BZiFKc8HzeKU2I2iIUHrZt1vKJi5+QeSf4Ql3hMarYmx3BAPnr0SSS+sBsv73nbJlvq8yiYm1D643H+3QQuMhpAjedcU7ufW9rvWS6z0XRJ188Z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oJV1l2/zVbJNh/f1PoUf54s33foOOEe2WMVs4yRBCRaHWBonZ5j305AIilIqcFIzoDFD62uuiMpLItvvLfh8+S4cvHcvAkujD3PTYrx52zKuIkpn3n/VdGWvOCrUIewF6uWPvShJU8TYbI+72aF2jK8llp;4:PzUdvjqyVwRoiBvd9kd8+4ABrBrE6Ka92NhjAiflGu8/AAfeGfHmwQthUROYi3BObfUWkE7YG76zsA1BdwoNchRrqJGh3BS5QXrJ7fBQ/SQ68w8l/+PJR6udu/lhHxn+nRjRBIHP4RaqSPFxi+8HFTZ63GZkzsdG4nE6j9YKDluZwnOLUf7PnSRs8ZFL2t0BHxXVkFjeMn2AOpBuTqOsJLJS2SllnP2fEsVm9LvfPk54gpiHs7y+Np7ZHESaSdz3yuHkGuytZiuFiZTV6ea9icN6I5AIbINX50tD8+1j8i00nWVH1DAnscPcJk/3473N X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(11241501184)(6041268)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:CO1PR15MB1078;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CO1PR15MB1078; X-Forefront-PRVS: 0527DFA348 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(346002)(39380400002)(39860400002)(376002)(396003)(24454002)(189003)(199004)(4326008)(6636002)(2906002)(5660300001)(47776003)(68736007)(8936002)(33656002)(2950100002)(6246003)(16586007)(59450400001)(83506002)(386003)(54906003)(316002)(97736004)(52116002)(58126008)(53936002)(6666003)(52396003)(53546011)(39060400002)(55016002)(106356001)(33896004)(9686003)(105586002)(305945005)(81156014)(8676002)(6496006)(6116002)(81166006)(7736002)(6862004)(1076002)(25786009)(23726003)(33716001)(478600001)(86362001)(76176011)(229853002)(50466002)(18370500001)(217873001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR15MB1078;H:castle;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO1PR15MB1078;23:cbtiLX+wAARyauLVJsqKBUpo6hsN+rChvPn1UF9BY?= =?us-ascii?Q?zBfler0Fs2Vh+SPbauNhtEyJ3JeLNlv9rc9W6DAGZHgRZDRWf/MnPFOuEMno?= =?us-ascii?Q?quPmi30U8YfKDCxjkcdMDAu1wr/6CRJZnBo1qXKJW6BPXOB86OWhgw0YY7rw?= =?us-ascii?Q?oLejslldk/ktxCqJYWAkOnmNjmDLfJUg2sqBvhpii/XYPzFMs1cBgqdH35rP?= =?us-ascii?Q?9CfotxEHN/1z8hk34CIY+twwPbosgWBWMHHSr2sM9eNrIVcl3E015cNQu2i2?= =?us-ascii?Q?TrkbHS+KoBZgDOajGcJY5xFYzS0eOVCrq4wbFkyT5Nm8z7g4WRJg4rZwGTCn?= =?us-ascii?Q?RZxFcnMHA/Ls98uWrtewvxorigructOSTzOmbm6T4Da4XyG+cgda5lqSAot5?= =?us-ascii?Q?viDyiFWiI1rHp5xFe1UBiQBp0Dn2dLrnOqp4gDw86z2/6ONV/SoF4yeLiQIH?= =?us-ascii?Q?cSebU7dj+5bNkhcz0IGMRZl4E4U+oWJK++TFkG+8303SfeKOvr5QfsuzZ8OL?= =?us-ascii?Q?weIjO7x2cg6SCqRawJBuBXTc9JRj40KLosFFXkoBtDiz4y8VY6O8PKHjUWAw?= =?us-ascii?Q?IbEbhcTfXCI0XxDtFwMu/hzCNF9Cj6iX6rKKp+U1uZUO1F25ZI3QXYJEfpJW?= =?us-ascii?Q?Sy3V4a0LzX3p9cq7urGZ6V+jY+pVIuw7OmejzxIp9eOxOY0XHCmD11wIk0b2?= =?us-ascii?Q?h2nCEx2WMM67IZmx4zwSKNeifKXtl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24G37edGfRVOUnkGEJNjfVpGLaHDZKB55QVObcBQUqnWJd372sY0ry7MDFPeIsN32jS2YYGp5lcnvuaF6Lcu3Ag8sIpwd0=;5:mOKUSQ+reVDXIohmCohpRs1V//ggQzC1A42jsDwtou87m2fjPVogIm7/++arojhJ5fyl3QIfBA09w80bi4FGIPLsKmszjhvDGNzp2HY0QYZXP+paXPTzfx7piL6O8yXafJKjrkm2wUHhFCqUba+KuILvvBqzcstNm+/rinTRysM=;24:g5riy67ORy5/76ZcAzY3szcaORTAspweiIrqAoEv3+/MepHny01oqhtJgcIjPN8AnZtNvt3uUar8BXC8o8Y6piuOwT2aJDV1ohIR9NCZCcM=;7:5PwZzOmLLPATY7217gFhFYMviDq6/JfD+QAVxPoR4YBFmW2HCniFnIGU3u6sg0gK+TWJtYqbJxhVM9N6kHk462CJXKlOHbjkh7HSLGchVlXvQSVKIT9/nf5XY3fCNwYgLuVUdcs7rCK9oHnzl3HsZc2BQU3qrnuGoFzUO/W/OeYVhj+zs44TUg0ZnPds9OcPoAx1SqaDfbYggtCPqlCXjDpKMOdjX0ng/ya9slgfSUacQhx9ohc/WOIsPMNLoQtd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB1078;20:n26P1VjXYh+19cEgGcKB9leDctYCt87CwaUuFGeQK2mIKgHtSVepeRH3QwGGoJufOrziaAFx5VP1Y9ivSv7Co7nuT39ds8GyjIsyRZ8C3GCP/DriiVT18/GyzVwMMDSwBCPMAqozDxc9yeMdy2sJHtOwyPUH22CjgbcV/nI1PUY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 20:56:13.6852 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25113008-65ad-4a24-5465-08d547ec1ca0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB1078 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: 1948 Lines: 53 On Wed, Dec 20, 2017 at 12:26:30PM -0800, Yonghong Song wrote: > > > On 12/20/17 12:19 PM, Roman Gushchin wrote: > > 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 > > -I$(srctree)/usr/include may not work if build directory is not the same as > the source directory. You probably should use > -I$(objtree)/usr/include? $(objtree) is not defined there, so it doesn't work. Tbh, I struggle to say if it's supposed to work there or not. Thanks!