Skip to content

bpftool v7.0

Compare
Choose a tag to compare
@qmonnet qmonnet released this 01 Sep 22:06
v7.0.0

Note

Bpftool's version number is aligned on libbpf's version number (with an offset). The change of major version number for the current release reflects libbpf's bump (v1.0.0), but is not necessarily synonym of breaking changes in bpftool - although we do have one in this release.

Breaking change

  • Given that bpftool now relies on libbpf to provide the string names for various BPF objects, the names of cgroup attach types as displayed with bpftool cgroup show may have changed. The former names were defined in bpftool here, now they come from libbpf, here.

New features

  • Implement bpftool cgroup tree for BPF_LSM_CGROUP
  • Use strings provided by libbpf for program types, map types, attach types, link types, instead of redefining them in bpftool, including for parsing these types from the command line
  • Add bpftool feature list_builtins to list program, map, attach, or link types known to libbpf (but independent from what the system supports), to allow iterating on these types in scripts, and use this in bash completion
  • Support passing longer strings for referencing programs by name on the command line, now that the kernel can use longer names with BTF
  • Add support for BTF_KIND_ENUM64 in BTF
  • Add support for BTF_KIND_RESTRICT for bpftool gen min_core_btf
  • Support BPF_CORE_TYPE_MATCHES relocations, for bpftool gen min_core_btf
  • Indicate that a pinned object is a BPF link (when relevant) instead of “unknown” when passing a pinned path to an incorrect object type on the command line

Bug fixes

  • Fix compilation with libbfd 2.39 and newer, following a change of interface of the function used to initialise the context for the disassembler and which needs an additional printer for styled output
  • Fix feature-libbfd-liberty-z detection in the mirror's Makefile
  • Fix bootstrap for cross-compilation, by passing down the host ar to libbpf's Makefile
  • Clean errno at the beginning of the program execution to clean up after the checks performed by libcap < 2.63 and avoid breaking the batch mode
  • Check for NULL pointer in codegen_asserts() to avoid a NULL pointer dereference on skeleton generation
  • Revert the switch to libbpf's API to lift the memlock rlimit restriction, as detection for cgroup-based memory accounting would fail in some corner cases, and implement instead a more thorough probe in bpftool to check whether we need to lift the rlimit
  • Do not return value from void function in skeleton, which would produce a warning

Other internal changes

  • Remove zlib feature test from Makefile
  • Do not print the result of the disassembler-four-args feature test when building bpftool
  • Replace the use of multiple sizeof() by ARRAY_SIZE() on the array of metrics in prog.c
  • Remove outdated attach_type_name forward declaration in main.h
  • Fix a typo in a comment, which would reference the wrong library (libpcap/libcap)
  • CI: Build on several runners (Ubuntu 18.04, 20.04, 22.04)
  • README.md: Fix a broken link

Known bugs

  • Some features requiring the use of “skeletons” (feature-clang-bpf-co-re compilation option) require kernel 5.15 or more recent, with CONFIG_PERF_EVENTS set, to compile bpftool (#17).
  • Map dumps with BTF information may print erroneous values for bool fields inside of a struct (#38).

Full Changelog: v6.8.0...v7.0.0