Skip to content

Commit

Permalink
Merge branch 'libbpf: support loading/storing any BTF'
Browse files Browse the repository at this point in the history
Andrii Nakryiko says:

====================
Add support for loading and storing BTF in either little- or big-endian
integer encodings, regardless of host endianness. This allows users of libbpf
to not care about endianness when they don't want to and transparently
open/load BTF of any endianness. libbpf will preserve original endianness and
will convert output raw data as necessary back to original endianness, if
necessary. This allows tools like pahole to be ignorant to such issues during
cross-compilation.

While working with BTF data in memory, the endianness is always native to the
host. Convetion can happen only during btf__get_raw_data() call, and only in
a raw data copy.

Additionally, it's possible to force output BTF endianness through new
btf__set_endianness() API. This which allows to create flexible tools doing
arbitrary conversions of BTF endianness, just by relying on libbpf.

Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Tony Ambardar <[email protected]>
Cc: Ilya Leoshkevich <[email protected]>
Cc: Luka Perkov <[email protected]>
====================

Signed-off-by: Alexei Starovoitov <[email protected]>
  • Loading branch information
Alexei Starovoitov committed Sep 29, 2020
2 parents f970cbc + ed9cf24 commit 85e3f31
Show file tree
Hide file tree
Showing 6 changed files with 419 additions and 98 deletions.
Loading

0 comments on commit 85e3f31

Please sign in to comment.