[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa3c3448-2cc7-6e26-ada9-34af10fdddb7@iogearbox.net>
Date: Tue, 16 Apr 2019 10:02:17 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>,
Yonghong Song <yhs@...com>
Cc: Jakub Kicinski <jakub.kicinski@...ronome.com>,
Prashant Bhole <bhole_prashant_q7@....ntt.co.jp>,
Alexei Starovoitov <ast@...nel.org>,
Quentin Monnet <quentin.monnet@...ronome.com>,
Martin Lau <kafai@...com>, Song Liu <songliubraving@...com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Andrii Nakryiko <andriin@...com>
Subject: Re: [PATCH bpf-next] tools/bpftool: show btf id in program
information
On 04/16/2019 02:54 AM, Andrii Nakryiko wrote:
> On Thu, Apr 11, 2019 at 8:38 AM Yonghong Song <yhs@...com> wrote:
>>
>> cc Andrii
>>
>> On 4/11/19 12:51 AM, Daniel Borkmann wrote:
>>> On 04/10/2019 05:39 PM, Jakub Kicinski wrote:
>>>> On Wed, 10 Apr 2019 13:56:42 +0900, Prashant Bhole wrote:
>>>>> Let's add a way to know whether a program has btf context.
>>>>> Patch adds 'btf_id' in the output of program listing.
>>>>> When btf_id is present, it means program has btf context.
>>>>>
>>>>> Sample output:
>>>>> user@...t# bpftool prog list
>>>>> 25: xdp name xdp_prog1 tag 539ec6ce11b52f98 gpl
>>>>> loaded_at 2019-04-10T11:44:20+0900 uid 0
>>>>> xlated 488B not jited memlock 4096B map_ids 23
>>>>> btf_id 1
>>>>>
>>>>> Signed-off-by: Prashant Bhole <bhole_prashant_q7@....ntt.co.jp>
>>>>
>>>> Acked-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
>>>
>>> Applied, thanks!
>>>
>>> What would be the plan for the maps listing?
>> [...]
>>> I think what we could also potentially have is some way to dump
>>> the BTF type info based on such above id. Perhaps it would make
>>> sense to similarly share the verifier's printer with bpftool?
>>
>> Agreed. It does make sense to print the detailed info for a btf id
>> through bpftool.
>>
>> Andrii had a btf dumper to dump types as well as BTF elf file .btf.ext
>> contents in his private branch. Maybe Andrii can comment further
>> on this subject.
>
> Yes, absolutely, we should have this as part of bpftool. I'm going to
> start porting this logic from my private prototype very soon.
>
> I think we should be able to have both low-level (though still
> human-readable) BTF dump as close to underlying BTF data as possible,
> as well as an ability to dump struct/union/datasec definitions in
> compilable C format. E.g., for struct/union it will be struct/union
> definition, as well as all the necessary dependent types, for
> datasec/vars it will be a list of global variables declaration w/ all
> the necessary types. Thoughts?
Yes, that sounds great to me! Both is needed. For the latter, it would
also be useful if I could do e.g. a bpftool prog btf dump id xyz and it
will show a pahole like output where I can see offset, padding information
as well as size + cachelines needed for all types used by the loaded BPF
program.
Thanks,
Daniel
Powered by blists - more mailing lists