Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1382455imm; Wed, 25 Jul 2018 17:27:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc1VhLc4DRPVMEAMadaV5Qtmllhnwvm2q5Sk4zXplaIxVixkuXocMg7LNck+uudg/dzMQ/u X-Received: by 2002:a65:6699:: with SMTP id b25-v6mr22740040pgw.426.1532564875236; Wed, 25 Jul 2018 17:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532564875; cv=none; d=google.com; s=arc-20160816; b=KGRFdWnxc8vcE2sANqebqhj0WqVb///vonn9DkbRPRDaJmwPJPsEp4BeGgpMWqHsCE dOHY9nRRzoMIdQvR+D+/c2QajCKh0M17oOcaaTWfhMRRtBmKEuLVN71fosP2F/1L446m 5W+8LDtg2IR8PL2cXHPgMYzwJZnx42koiEt7WlStb9w77Kle2ghl5VpGxzTm4Vz+Tk2N xqDNFqwxy064Vr6i78dnFky40MLurANiNUaZIKUgczNJd5TYBXHb5OQepp2PWRSsSgcH Rs4qTjprERlGnU588SuD4eH67OwOLqKxaUIgyUcq3ht3TJth3MMeqb/xdu01QMDMmkwh alZQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=ammE910Fr/9RibHtFfT3Vu80D9nTitBlWd98p1Qyxwk=; b=CToYmjImBbCt3K4bQw8/kBbmGDuvCZuTrCoZbOf2X2v5Ni3aLnNnyq7UMn5LNK+Hpr gSE9FUesRUQ9h3iCFIoeGfzbGLL04xLzerzjFbgHi/OyAQrH4jn/lwK4FsxQm3T/UG6o nfWcYp04AlINLsXk9tFpyQks9hQRXQwo3/KULiYla0igQmM2gTQCwCA53/OqLEB2PXge d8BcGWzf+b4bZza+lo0MmYK171eeGGRtFrqPgXieibarw1pu6Qf0BTnOLQ+HhNZesZvk MGPJYL4KTUNdtoamEsueceCg4MNMTfHc/07No3qhf9tF+8JhXCFxoGZo7FYH1ADtQtK1 XBXg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si15398186pgb.107.2018.07.25.17.27.40; Wed, 25 Jul 2018 17:27:55 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728590AbeGZBk6 (ORCPT + 99 others); Wed, 25 Jul 2018 21:40:58 -0400 Received: from www62.your-server.de ([213.133.104.62]:52774 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728369AbeGZBk6 (ORCPT ); Wed, 25 Jul 2018 21:40:58 -0400 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1fiU79-0001VS-1z; Thu, 26 Jul 2018 02:26:43 +0200 Received: from [99.0.85.34] (helo=localhost.localdomain) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1fiU78-0003xx-NJ; Thu, 26 Jul 2018 02:26:42 +0200 Subject: Re: pahole + BTF was: Re: [Question] bpf: about a new 'tools/bpf/bpf_dwarf2btf' To: Martin KaFai Lau , Taeung Song , Arnaldo Carvalho de Melo Cc: Alexei Starovoitov , netdev@vger.kernel.org, Thomas Girard , Martin Cermak , linux-kernel@vger.kernel.org, acme@kernel.org References: <47cfb90e-a9f4-8127-2b89-0e20d9fda2f0@gmail.com> <20180725175231.GA2121@redhat.com> <35663517-26e1-c2a2-1554-5dd90be2747f@gmail.com> <592c6325-23d0-771b-cc28-6a66842a1265@gmail.com> <20180725201122.h7ostqw3qtfvz7sn@kafai-mbp.dhcp.thefacebook.com> From: Daniel Borkmann Message-ID: <96728b5e-8e41-a1df-be63-becbd9606307@iogearbox.net> Date: Thu, 26 Jul 2018 02:26:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180725201122.h7ostqw3qtfvz7sn@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.0/24782/Wed Jul 25 18:44:42 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/25/2018 10:11 PM, Martin KaFai Lau wrote: > On Thu, Jul 26, 2018 at 04:21:31AM +0900, Taeung Song wrote: >> On 07/26/2018 03:27 AM, Taeung Song wrote: >>> On 07/26/2018 02:52 AM, Arnaldo Carvalho de Melo wrote: >>>> Em Thu, Jul 26, 2018 at 02:23:32AM +0900, Taeung Song escreveu: >>>>> Hi, >>>>> >>>>> Building bpf programs with .BTF section, >>>>> I thought it'd be better to convert dwarf info to .BTF by >>>>> a new tool such as 'tools/bpf/bpf_dwarf2btf' instead of pahole >>>>> in the future. >>>>> Currently for bpf binary that have .BTF section, >>>>> we need to use pahole from https://github.com/iamkafai/pahole/tree/btf >>>>> with the command line such as "pahole -J bpf_prog.o". >>>>> I think it is great but if implementing new 'bpf_dwarf2btf' >>>>> (dwarf parsing + btf encoder code written by Martin KaFai Lau on >>>>> the pahole project i.e. btf.h, btf_encoder.c, btf_encoder.h, >>>>> libbtf.c, libbtf.h), >>>>> BPF developers would more easily use functionalities based on BTF. >>>> >>>> What would be easier exactly? Not having to install a package but build >>>> it from the kernel sources? >>>> >>>> Many kernel developers already have pahole installed for other uses, so >>>> no need to install anything. >>> >>> Understood, but I think there are many non-kernel developers >>> developing BPF programs and they mightn't have or use pahole. >>> >>> So, if providing the 'dwarf2btf' feature on tools/bpf or tools/bpf/bpftool, >>> non-kernel developers can also more easily build bpf prog with .BPF, no ? > Some quick thoughts, > IMO, I suspect if it is in the distro's pahole package, it should be easy > enough for kernel and non kernel developer to install. > BTF usage is still evolving, we might re-evaluate going forward but at this > point I think leveraging pahole's existing capability is a good option. Agree, if there will be a future use-case where pahole might not be well-fitting, we could add it to bpftool then so I wouldn't rule it out, but for the functionality right now it seems good to reuse it. Presumably BPF developers have it installed anyway to inspect struct padding from BPF obj files. Thanks, Daniel