Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755939AbdLTU1A (ORCPT ); Wed, 20 Dec 2017 15:27:00 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:59186 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754388AbdLTU0z (ORCPT ); Wed, 20 Dec 2017 15:26:55 -0500 Subject: Re: [RFC PATCH net-next] tools/bpftool: use version from the kernel source tree To: Roman Gushchin , CC: , , , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann References: <20171220201943.24440-1-guro@fb.com> From: Yonghong Song Message-ID: <1fa179c1-4725-7e37-b5a9-5d7d8d36a37a@fb.com> Date: Wed, 20 Dec 2017 12:26:30 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171220201943.24440-1-guro@fb.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::5:7258] X-ClientProxiedBy: CO2PR05CA0091.namprd05.prod.outlook.com (10.165.92.17) To MWHPR15MB1839.namprd15.prod.outlook.com (10.174.255.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af338ae7-cc0a-47c8-77e6-08d547e7f74c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060);SRVR:MWHPR15MB1839; X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1839;3:M/HVAVUYT5EjyA81LzLCE9tOcQAAxGJbzUYgqbvGkAJmNkGldJsuGMT41VW9sKlA+fP9pYlx7wdUh8J2tA7bSGQYdEPxoIIXfinkYv/HdaniohKDAxpqPeBxRrtPmEr8nt9gputEY1FbYm8JTrhvOr4Lbt8on77d1GPLpG+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f616XDb4QBWC8U+7JK2mS4n2IGFw/SKIZBdpmkS0cQCLR2Oh18lbJISF+MXjLnMCixwetqXSnG6IR1JkJEDY6PdzoyUTSrNYejnN4aNsTWocyNW2AfVBJKgA/ZmMZecQRQneDq8+fyvWV+0/Hvr8kFC3EaMz/uKWrI5+qp;4:o77RbHpjNGejB3ob3LcobnewNyFyhiUQzdyk1MltY4mx/g5eaUaeQEh4REz/GHWFpBRa34wP2nnoZtfWdhNbWOjpXA6LSLReZQQtWKFZcpdvacd5I1vrt08C9eSXV8JDxWJb4OPSgUA5Y0WlvxJCeCqFwt6Sy6Ni0cjbgoQiPrCVM7yYUW6ZcNnkyJFE5xqMlxli2T3oB8Z/1W8FccfTFim13pKKkbGzpTfcR0zU5Obo0SEuXyX9yB7aSktylTOYV+PDCzKsshzs/aIH4P1cbuS2CFFh24sWfOlqVHuZPJ4/oLkgEzfY5vfJMRlcgLqr 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)(10201501046)(3002001)(3231023)(11241501184)(93006095)(93001095)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011);SRVR:MWHPR15MB1839;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR15MB1839; X-Forefront-PRVS: 0527DFA348 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(346002)(39860400002)(376002)(39380400002)(366004)(24454002)(199004)(189003)(230700001)(67846002)(5660300001)(6512007)(2906002)(6116002)(65826007)(39060400002)(4326008)(105586002)(25786009)(64126003)(83506002)(31686004)(58126008)(106356001)(6246003)(6486002)(50466002)(54906003)(316002)(53936002)(65956001)(478600001)(97736004)(7736002)(86362001)(6506007)(229853002)(305945005)(59450400001)(65806001)(31696002)(386003)(8936002)(47776003)(52396003)(68736007)(53546011)(8676002)(52146003)(52116002)(2486003)(36756003)(76176011)(81156014)(23676004)(2950100002)(81166006)(6666003)(217873001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR15MB1839;H:jasont-mbp1.dhcp.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjE1TUIxODM5OzIzOkNmMkVPL055Q1FpM3BKcXVZQXdxSThPV0w3?= =?utf-8?B?WFZqdnJhVVZvY1dOZlBsQlpaTlRVdXZ4VllzdXhFVDR4Vk5JdWl0d0htbUR6?= =?utf-8?B?T0kwU1B0dkhiTDhhUmkwUEhtRnorVnkzSU93Ri9BdUJEc0VGcGhudDZyT3ZG?= =?utf-8?B?M2JTdkM2cDNKdnN3MDdacnU3ZERRektyTVVxZmtqakUxY2NaT0NIeEF4cjlR?= =?utf-8?B?UUZkVEZxZ21iZy9HSGNBd0JUcTlFR2tWN0t6VzFPK0pLaURrMHZoQUFhRXhX?= =?utf-8?B?U1ZEbkU0QnAzSjdFamlJWnFIRkNVT0M2WitjNnpHSFhkS1o3ejdxbURxRE9M?= =?utf-8?B?cW5BTjVJeUZVN0ZzSmYwL3NReE9WQnhxRFEyYnNvOWJTeGxNWlJ3R3hpeVY1?= =?utf-8?B?YXkxUWgwVkU3aGlLV08rZ1grMVBLRWpvQk9NMjByd015bnhhUkNpMjM4WGI3?= =?utf-8?B?Tll2VmZtSHFPUEt6STN4eS8wamE0N1k4MUswRzE3SFhHaEVhdG1FcnNtN0lq?= =?utf-8?B?bHc5bkVGTm9TaDdTeTFpVmlxR0tDc01zMTdWcmhKRWlRcXJNNmNSazNBcFM2?= =?utf-8?B?VTV3c25MU2h5cStUcm1tMWZ4ZEk4ZGVLS0N1d0FRRWtCTnZ5MkMxZXlSV2VW?= =?utf-8?B?TTJEYzcrdkk2NlBWVUlrbTQ3RUpUeFkwQWVnNFpETzlzOFpT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qVybPpcpxKVjEtgb13IUTrqIp0N8QgVZp1Ah0QG6KbRfixsXDBTIUzL4S6dC+RhhjJIC6qbIDSktUXjEUN5dpyUSUA2jTFy7NINZdg4aIjD6/gr4JwZRpHW6AbQcCFLwyPbNnZ9PMABQ5CdYfqz9LElXc8bbThrzt4YwI9uZRCSpBm6Fx67g1fQPZUEkV+4yyJ6OgtZ5ddezKz6/JB71dac2cG2hPu/QO8lsa+EUX3eQx21mo4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1839;20:QbemrR7DRi3cCN31IPsz4YIB+XYtroWy5BJW5fsDGd3cFcf18g2Tur+A/bBPorrpVcIqvCqZ9S5K2v83DgEl6c8QxLXcr9A2y9RYHOUPffhWRbnfwtS6Jwdgg5OoZrD7NspeFglgtvSR5HEnFK+xlM7KJzKiF58m0RjbYf2gJ3o= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 20:26:35.0419 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af338ae7-cc0a-47c8-77e6-08d547e7f74c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1839 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: 1747 Lines: 53 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? > LIBS = -lelf -lbfd -lopcodes $(LIBBPF) > > INSTALL ?= install >