mbox series

[bpf-next,v1,0/3] Improve .BTF_ids patching and alignment

Message ID cover.1726806756.git.tony.ambardar@gmail.com
Headers show
Series Improve .BTF_ids patching and alignment | expand

Message

Tony Ambardar Sept. 20, 2024, 7:49 a.m. UTC
Hello all,

This patch series offers improvements to the way .BTF_ids section data is
created and later patched by resolve_btfids.

Patch #1 simplifies the byte-order translation in resolve_btfids while
making it more resilient to future .BTF_ids encoding updates.

Patch #2 makes sure all BTF ID data is 4-byte aligned, and not only the
.BTF_ids used for vmlinux.

Patch #3 syncs the above changes in btf_ids.h to tools/include, obviating
a previous alignment fix in selftests/bpf.

Feedback and suggestions are welcome!

Best regards,
Tony


Tony Ambardar (3):
  tools/resolve_btfids: Simplify handling cross-endian compilation
  bpf: btf: Ensure natural alignment of .BTF_ids section
  tools/bpf, selftests/bpf : Sync btf_ids.h to tools

 include/linux/btf_ids.h                       |  1 +
 tools/bpf/resolve_btfids/main.c               | 60 +++++---------
 tools/include/linux/btf_ids.h                 | 80 +++++++++++++++++--
 .../selftests/bpf/prog_tests/resolve_btfids.c |  6 --
 4 files changed, 97 insertions(+), 50 deletions(-)

Comments

Jiri Olsa Sept. 23, 2024, 11:07 a.m. UTC | #1
On Fri, Sep 20, 2024 at 12:49:10AM -0700, Tony Ambardar wrote:
> Hello all,
> 
> This patch series offers improvements to the way .BTF_ids section data is
> created and later patched by resolve_btfids.
> 
> Patch #1 simplifies the byte-order translation in resolve_btfids while
> making it more resilient to future .BTF_ids encoding updates.
> 
> Patch #2 makes sure all BTF ID data is 4-byte aligned, and not only the
> .BTF_ids used for vmlinux.
> 
> Patch #3 syncs the above changes in btf_ids.h to tools/include, obviating
> a previous alignment fix in selftests/bpf.
> 
> Feedback and suggestions are welcome!
> 
> Best regards,
> Tony

nice, thanks for the fix

Jean-Philippe, Viktor,
any chance you could check/test this patchset? it changes your recent
cross building fixes

thanks,
jirka

> 
> 
> Tony Ambardar (3):
>   tools/resolve_btfids: Simplify handling cross-endian compilation
>   bpf: btf: Ensure natural alignment of .BTF_ids section
>   tools/bpf, selftests/bpf : Sync btf_ids.h to tools
> 
>  include/linux/btf_ids.h                       |  1 +
>  tools/bpf/resolve_btfids/main.c               | 60 +++++---------
>  tools/include/linux/btf_ids.h                 | 80 +++++++++++++++++--
>  .../selftests/bpf/prog_tests/resolve_btfids.c |  6 --
>  4 files changed, 97 insertions(+), 50 deletions(-)
> 
> -- 
> 2.34.1
>