mbox series

[bpf-next,0/2] bpftool: fix newline for struct with padding only fields

Message ID 20220930164918.342310-1-eddyz87@gmail.com (mailing list archive)
Headers show
Series bpftool: fix newline for struct with padding only fields | expand

Message

Eduard Zingerman Sept. 30, 2022, 4:49 p.m. UTC
Hi Everyone,

a small fix for bpftool, copying commit message from the first patch
as it explains the modification.

An update for `bpftool btf dump file ... format c`.
Add a missing newline print for structures that consist of
anonymous-only padding fields. E.g. here is struct bpf_timer from
vmlinux.h before this patch:

 struct bpf_timer {
 	long: 64;
	long: 64;};

And after this patch:

 struct bpf_dynptr {
 	long: 64;
	long: 64;
 };

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>

Eduard Zingerman (2):
  bpftool: fix newline for struct with padding only fields
  selftests/bpf: verify newline for struct with padding only fields

 tools/lib/bpf/btf_dump.c                         | 15 +++++++++------
 .../bpf/progs/btf_dump_test_case_padding.c       | 16 ++++++++++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)

Comments

Andrii Nakryiko Sept. 30, 2022, 10:59 p.m. UTC | #1
On Fri, Sep 30, 2022 at 9:50 AM Eduard Zingerman <eddyz87@gmail.com> wrote:
>
> Hi Everyone,
>
> a small fix for bpftool, copying commit message from the first patch
> as it explains the modification.
>
> An update for `bpftool btf dump file ... format c`.
> Add a missing newline print for structures that consist of
> anonymous-only padding fields. E.g. here is struct bpf_timer from
> vmlinux.h before this patch:
>
>  struct bpf_timer {
>         long: 64;
>         long: 64;};
>
> And after this patch:
>
>  struct bpf_dynptr {
>         long: 64;
>         long: 64;
>  };
>
> Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
>

Some general feedback about cover letter submission:

1) Contents of cover letter is embedded into merge commit when patch
set is applied, so "Hi Everyone," looks rather weird there. Best to
just get straight to explaining the purpose of cover letter.

2) Please keep capitalization ("a small fix" -> "A small fix").

3) I don't think we add Signed-off-by into the cover letter, so please
drop it for next revision.

> Eduard Zingerman (2):
>   bpftool: fix newline for struct with padding only fields
>   selftests/bpf: verify newline for struct with padding only fields
>
>  tools/lib/bpf/btf_dump.c                         | 15 +++++++++------
>  .../bpf/progs/btf_dump_test_case_padding.c       | 16 ++++++++++++++++
>  2 files changed, 25 insertions(+), 6 deletions(-)
>
> --
> 2.37.3
>