> On Nov 9, 2020, at 5:19 PM, Andrii Nakryiko <[email protected]> wrote:
[...]
> ...
>
> Tested-by: Alan Maguire <[email protected]>
> Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Song Liu <[email protected]>
With one nit:
> ---
> tools/bpf/bpftool/btf.c | 28 +++++++++++++++++++++++++++-
> 1 file changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> index c96b56e8e3a4..ed5e97157241 100644
> --- a/tools/bpf/bpftool/btf.c
> +++ b/tools/bpf/bpftool/btf.c
> @@ -742,9 +742,14 @@ show_btf_plain(struct bpf_btf_info *info, int fd,
> struct btf_attach_table *btf_map_table)
> {
> struct btf_attach_point *obj;
> + const char *name = u64_to_ptr(info->name);
> int n;
>
> printf("%u: ", info->id);
> + if (info->kernel_btf)
> + printf("name [%s] ", name);
> + else if (name && name[0])
> + printf("name %s ", name);
Maybe explicitly say "name <anonymous>" for btf without a name? I think
it will benefit plain output.
> printf("size %uB", info->btf_size);
>
> n = 0;
[...]
On Tue, Nov 10, 2020 at 5:15 PM Song Liu <[email protected]> wrote:
>
>
>
> > On Nov 9, 2020, at 5:19 PM, Andrii Nakryiko <[email protected]> wrote:
>
> [...]
>
> > ...
> >
> > Tested-by: Alan Maguire <[email protected]>
> > Signed-off-by: Andrii Nakryiko <[email protected]>
>
> Acked-by: Song Liu <[email protected]>
>
> With one nit:
>
> > ---
> > tools/bpf/bpftool/btf.c | 28 +++++++++++++++++++++++++++-
> > 1 file changed, 27 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> > index c96b56e8e3a4..ed5e97157241 100644
> > --- a/tools/bpf/bpftool/btf.c
> > +++ b/tools/bpf/bpftool/btf.c
> > @@ -742,9 +742,14 @@ show_btf_plain(struct bpf_btf_info *info, int fd,
> > struct btf_attach_table *btf_map_table)
> > {
> > struct btf_attach_point *obj;
> > + const char *name = u64_to_ptr(info->name);
> > int n;
> >
> > printf("%u: ", info->id);
> > + if (info->kernel_btf)
> > + printf("name [%s] ", name);
> > + else if (name && name[0])
> > + printf("name %s ", name);
>
> Maybe explicitly say "name <anonymous>" for btf without a name? I think
> it will benefit plain output.
This patch set is already landed. But I can do a follow-up patch to add this.
>
> > printf("size %uB", info->btf_size);
> >
> > n = 0;
>
> [...]
> On Nov 10, 2020, at 8:19 PM, Andrii Nakryiko <[email protected]> wrote:
>
> On Tue, Nov 10, 2020 at 5:15 PM Song Liu <[email protected]> wrote:
>>
>>
>>
>>> On Nov 9, 2020, at 5:19 PM, Andrii Nakryiko <[email protected]> wrote:
>>
>> [...]
>>
>>> ...
>>>
>>> Tested-by: Alan Maguire <[email protected]>
>>> Signed-off-by: Andrii Nakryiko <[email protected]>
>>
>> Acked-by: Song Liu <[email protected]>
>>
>> With one nit:
>>
>>> ---
>>> tools/bpf/bpftool/btf.c | 28 +++++++++++++++++++++++++++-
>>> 1 file changed, 27 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
>>> index c96b56e8e3a4..ed5e97157241 100644
>>> --- a/tools/bpf/bpftool/btf.c
>>> +++ b/tools/bpf/bpftool/btf.c
>>> @@ -742,9 +742,14 @@ show_btf_plain(struct bpf_btf_info *info, int fd,
>>> struct btf_attach_table *btf_map_table)
>>> {
>>> struct btf_attach_point *obj;
>>> + const char *name = u64_to_ptr(info->name);
>>> int n;
>>>
>>> printf("%u: ", info->id);
>>> + if (info->kernel_btf)
>>> + printf("name [%s] ", name);
>>> + else if (name && name[0])
>>> + printf("name %s ", name);
>>
>> Maybe explicitly say "name <anonymous>" for btf without a name? I think
>> it will benefit plain output.
>
> This patch set is already landed. But I can do a follow-up patch to add this.
I realized this was applied soon after sending this. Yeah, a follow-up
patch would be great.
Thanks,
Song