ANNOUNCE: pahole v1.23 (BTF tags and alignment inference)

Arnaldo Carvalho de Melo
2021-12-08T13:55:05Z

Hi,

The v1.23 release of pahole and its friends is out, this time
the main new features are the ability to encode BTF tags, to carry
attributes to the kernel BPF verifier for further checks and the
inference of struct member unnatural alignment (__attribute__(__aligned__(N)))
to help in generating compileable headers matching the original type
layout from BTF data.

Main git repo:

git://git.kernel.org/pub/scm/devel/pahole/pahole.git

Mirror git repo:

https://github.com/acmel/dwarves.git

tarball + gpg signature:

https://fedorapeople.org/~acme/dwarves/dwarves-1.23.tar.xz
https://fedorapeople.org/~acme/dwarves/dwarves-1.23.tar.bz2
https://fedorapeople.org/~acme/dwarves/dwarves-1.23.tar.sign

Thanks a lot to all the contributors and distro packagers, you're on the
CC list, I appreciate a lot the work you put into these tools,

Best Regards,

- Arnaldo

DWARF loader:

- Read DW_TAG_LLVM_annotation tags, associating it with variables, functions,
types. So far this is only being used by the BTF encoder, but the pretty
printer should use this as well in a future release, printing these
attributes when available.

- Initial support for DW_TAG_skeleton_unit, so far just suggest looking up a
matching .dwo file to be used instead. Automagically doing this is in the
plans for a future release.

- Fix heap overflow when accessing variable specification.

BTF encoder:

- Support the new BTF type tag attribute, encoding DW_TAG_LLVM_annotation DWARF
tags as BTF_KIND_TYPE_TAG and BTF_KIND_DECL_TAG.

This allows __attribute__((btf_type_tag("tag1"))) to be used for variables,
functions, typedefs, so that contextual information can be stored in BTF and
used by the kernel BPF verifier for more checks.

The --skip_encoding_btf_type_tag option can be used to suppress this.

- Fix handling of percpu symbols on s390.

BTF loader:

- Use cacheline size to infer alignment.

btfdiff:

- Now that the BTF loader infers struct member alingment, and as that is just
an heuristic, suppress printing the alignment when pretty printing from BTF
info like is done when printing from DWARF.

pahole:

- Add --skip_missing so that we don't stop when not finding one of the types passed
to -C.

Pretty printer:

- Fix __attribute__((__aligned__(N)) printing alignment for struct members.

- Fix nested __attribute__(__aligned__(N)) struct printing order, so that
rebuilding from the printed source circles back to the original source code
alignment semantics.

Build:

- No need to download libbpf source when using the system library (libbpf-devel).

- Make python optional