mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Martin KaFai Lau <kafai@fb.com>,
	Taeung Song <treeze.taeung@gmail.com>,
	Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	netdev@vger.kernel.org, Thomas Girard <thomas.g.girard@free.fr>,
	Martin Cermak <mcermak@redhat.com>,
	linux-kernel@vger.kernel.org, acme@kernel.org
Subject: Re: pahole + BTF was: Re: [Question] bpf: about a new 'tools/bpf/bpf_dwarf2btf'
Date: Thu, 26 Jul 2018 02:26:38 +0200	[thread overview]
Message-ID: <96728b5e-8e41-a1df-be63-becbd9606307@iogearbox.net> (raw)
In-Reply-To: <20180725201122.h7ostqw3qtfvz7sn@kafai-mbp.dhcp.thefacebook.com>

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

  reply	other threads:[~2018-07-26  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 17:23 Taeung Song
     [not found] ` <20180725175231.GA2121@redhat.com>
2018-07-25 18:27   ` pahole + BTF was: " Taeung Song
2018-07-25 19:06     ` Daniel Borkmann
2018-07-25 19:21     ` Taeung Song
2018-07-25 20:11       ` Martin KaFai Lau
2018-07-26  0:26         ` Daniel Borkmann [this message]
2018-07-26  6:04           ` Taeung Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96728b5e-8e41-a1df-be63-becbd9606307@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=acme@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=kafai@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcermak@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.g.girard@free.fr \
    --cc=treeze.taeung@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®