Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756227AbdLTUyf (ORCPT ); Wed, 20 Dec 2017 15:54:35 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:37008 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754428AbdLTUyb (ORCPT ); Wed, 20 Dec 2017 15:54:31 -0500 Date: Wed, 20 Dec 2017 20:53:41 +0000 From: Roman Gushchin To: Jakub Kicinski CC: , , , , Alexei Starovoitov , Daniel Borkmann Subject: Re: [RFC PATCH net-next] tools/bpftool: use version from the kernel source tree Message-ID: <20171220205332.GA28352@castle> References: <20171220201943.24440-1-guro@fb.com> <20171220122921.62e10f33@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20171220122921.62e10f33@cakuba.netronome.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [2620:10d:c092:180::1:e6b3] X-ClientProxiedBy: DB3PR0102CA0021.eurprd01.prod.exchangelabs.com (2603:10a6:8::34) To BL2PR15MB1074.namprd15.prod.outlook.com (2603:10b6:201:17::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50a11bc7-b6e9-4b31-d128-08d547ebc7b7 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:CMqJj88m7qQAe4LqtlKsxfbSQfiWKxpzMn/KX54FwVsu6DgIvVc/3Wj68PAkZibsGwZ1S/ERE5h/JwRF/oBH8e5W+CiXlxJE35ct49zJDjna3lbatSbt+at5S0Dbtu03Qch1sE3KO7SSEPLIqTB31IOB4Fpz5vT4il/zVSFuWrOMq1izkQ7bA1ipIHpB0qtEEwbffTvgxcE6nozTVBYTc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nx9pJmRDXhGSWSeyZ3GGjSn8KD1SnQPVhZnEDqAt2wI097I5ff3+MjwqhPGTtnr5xnZMDrLhEtNPybytEIiQGqAFjzb71cHvdBg1Pbn0Tk6p9wHlMcav6sK7fT6g;4:Rctre8K74gpLAekILaGw07o2nO3tsbD9Zm7JWMNNKp5Ad+kXY939YB+ByV9ye+Jm4hE8uZugwShNbW6t4OpmyHU4Gjm7ZtXgN5kbQMxkjt51EtfDs3v9dMK7LnfLvBYgOuYhIZXpeI3IocuM6fMGh0M4nG5WYQ8cA29wGN7UeC346fRgYfKu+176S4M8kfVIu0NgGtVkQ5Z4HiduS2tK9txw9hFiftAr0xTRNvCmFrr8F+5sFp2YhWziB1ngFWmkSlpWDe+YtFzZtHqvyVkG7Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231023)(11241501184)(93006095)(93001095)(6041268)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(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)(376002)(346002)(39860400002)(39380400002)(366004)(396003)(199004)(189003)(51914003)(24454002)(5660300001)(83506002)(8936002)(305945005)(33656002)(105586002)(68736007)(316002)(7736002)(25786009)(58126008)(9686003)(229853002)(478600001)(4326008)(86362001)(6666003)(6916009)(55016002)(81166006)(2906002)(8676002)(53936002)(33716001)(1076002)(50466002)(6116002)(23726003)(47776003)(386003)(54906003)(2950100002)(97736004)(52396003)(39060400002)(52116002)(33896004)(6496006)(16586007)(76176011)(106356001)(6246003)(81156014)(18370500001)(217873001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1074;H:castle;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR15MB1074;23:uvqX0tuslvyWknixpPIUKvdSWjSgVqFnhkM2m78Uo?= =?us-ascii?Q?PrpV4UyDUvSpPRlwDqGwTZIW1NAqdA/TLu1qxBOIESXTfiYKqfMWHEgZB0dR?= =?us-ascii?Q?tSQSsO+aMk9xRBJhpwf4ALcvNWFhZB6Q33o8dIswpHmnhN+AxzwazKevJCeD?= =?us-ascii?Q?ZFXEuPSQuENUKjHjd6+MmiQvqyFy9T0x7zUK7kjJekm/hIV0dER13jZRxDda?= =?us-ascii?Q?MOre6SYXBOHVsW6rua6IExkOZLMKsiCgitDQpTwincRlM22NxHbXI3jLvJ6Q?= =?us-ascii?Q?DljoyK+pq7d1zeS0o5PWiin3Vi74gHtr+jttrmzEkjddA56cOwuvAbDmVP7s?= =?us-ascii?Q?eGPAyHegUZxqTBCRRS++YBQF6GjoV1T5AMtn0qkiFZwJGFMO/XvtpB5PmfIH?= =?us-ascii?Q?UADFMRO6On4i1HqTN7p9KO6imWOCIU+4Oneq5J00+rNcYKZ1oOcfhVlwqlkv?= =?us-ascii?Q?x6fMimiuPPng+HHSRZJIXVgOszXnV4pElT7epJ4rcFszapi13saekWx2vvmk?= =?us-ascii?Q?N6N4Vn0rAgGt2f9Cf9royHLqshX+vt+Cayx460z4sLvA74QjS2kVkHICrU/L?= =?us-ascii?Q?pEpz6FbonIk0+Oi0y1TX54G9CM7kNr800eRrAZ6yobcqkqGNlJ1wHo3DGWXG?= =?us-ascii?Q?o4NPa0eijvwCLiVXeIZYMkNc//GfTC1N5axQuVBygW8tcZQpOE9E1/J9Lm4l?= =?us-ascii?Q?ONBqNgPjdfXK2uoji1s9sPW+4mKe5bz+x+AfQM3u/b49EzMJMJQ6ZjNqdn86?= =?us-ascii?Q?rJXfKzKxlV4TJcxz7cDaeUNxO1+fwS4H+pp7cl5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Si08ZQxCPiV22y9TGb6xfalk6DyK+mCoHd9lc1P0ZFv7gyI1XE1XTuigGbVGVyDp3mhkQ0zT7qsm1hya1OJfaYX7bmEoRVUfI6uE/4k7vdJRnpPgOH9q34E+fjFCnMcXO4ksXM=;24:fjNKsF9dE+DUnKSNHjgNuXhjQsOOKBc4zgejGSa0S8/oQszMLs+dlbuQQp8ptD5Qat6XV3KsRR3wqoWqSc+7CRjFjMlyuHvw2rBE9NNO6qI=;7:EN1k/JAa7JRL+1K6Isf7VwPOs2YwZdtSq2SgK6021rtPcgG56+7Aj6CJwQCoJuyy6lNa+pk6HXkTJrUVEpsPKcioCe7slrIS5BWRNks/5GfgoCHXNPI3oUMn/l0xOHE8PNTZVa5+21K9/9TdM3LKiB9/k4wqwgtcKAiDbPEtdIv50gOexIUvbbuQ68czGd5zgZutUV/90ULfElMG17llKWiJjQynBSMVGNQMP1Uf/h3Gh53QifrOB8vyxlBTeQTe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1074;20:cugihvkRgjEfBXa2uStJtgngUpS7MSuGVWNl4BeClKyoQbrpN4DDN1TwdvgKAXe76yib1D3CFJrx1/XogdjrVl7ls+4au7zrbW3dhuBqGLcOTezyDVkT0mSCZe8NXLJNv0BkfMONSscjbxZTTA6uBtUvcxfCZZobYydWywxZ1Bw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 20:53:52.1860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50a11bc7-b6e9-4b31-d128-08d547ebc7b7 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: 1393 Lines: 42 On Wed, Dec 20, 2017 at 12:29:21PM -0800, Jakub Kicinski wrote: > On Wed, 20 Dec 2017 20:19:43 +0000, 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 > > Thanks for the patch, this would indeed use some improvement. > > How about we just run make to get the version like liblockdep does? > > LIBLOCKDEP_VERSION=$(shell make --no-print-directory -sC ../../.. kernelversion) > > probably s@../../..@$(srctree)@ > > $(srctree)/usr/include is not going to be there for out-of-source builds. Hm, why it's better? It's not only about the kernel version, IMO it's generally better to use includes from the source tree, rather then system-wide installed kernel headers. I've got about out-of-source builds, but do we support it in general? How can I build bpftool outside of the kernel tree? I've tried a bit, but failed. Thank you!