[ANNOUNCEMENT] libbpf v0.8 release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



libbpf v0.8 was just released ([0]). It has some long-awaited new
features (USDT support, BPF sub-skeleton support), added support to
latest kernel features (multi-kprobe, BPF cookies for fentry/fexit,
etc), but also a lot of quality of life improvements (BPF verifier log
post-processing done by libbpf) and functionality to make CO-RE-based
application (in very general BPF portability sense) easier to write
and support. Further API documentation was added to existing and newly
added APIs as well.

libbpf v0.8 is intended to be the last v0.x release, so the next one
is going to be official v1.0 with deprecated APIs and per-1.0
behaviors removed. Let's use the time between v0.8 and the next v1.0
release to fix any missed or outstanding issues, tighten up error
handling and safety checks, where appropriate, as well as complete and
improve libbpf API documentation. New features are still welcome, of
course, but first and foremost I'd like to focus on general polish as
much as possible. I also encourage everyone to help with documenting a
pretty big API surface of libbpf as much as you can!

Thank you to all the contributors for making libbpf better!


## New features and APIs:
- major improvements for `uprobe`/`uretprobe` programs:
  - support auto-resolution of binaries and shared libraries from
PATH, if necessary;
  - support attaching by function names (only by IP was supported before);
- support attaching to USDTs (`SEC("usdt/...")` and
`bpf_program__attach_usdt()`) with initially supported architectures:
  - x86-64 (amd64);
  - x86 (i386);
  - s390x;
  - ARM64 (aarch64);
  - RISC V (riscv);
- improved BPF verifier log reporting for CO-RE relocation failures
(no more obscure "invalid func unknown#195896080" errors);
- auto-adjust BPF ringbuf size according to host kernel's page size
requirements;
- high-level BPF map APIs: `bpf_map__lookup_elem()`,
`bpf_map__update_elem()`, etc that validate key/value buffer sizes;
- `bpf_link_create()` can create all bpf_link-based (including raw_tp,
fentry/fexit, etc), falling back to `bpf_raw_tracepoint_open()` on old
kernels transparently;
- support opting out from auto-loading BPF programs declaratively with
`SEC("?...")`;
- support opting out from auto-creation of declarative BPF maps with
`bpf_map__set_autocreate()`;
- support multi-kprobes (`SEC("kprobe.multi/...")` and
`bpf_program__attach_kprobe_multi_opts()`);
- support target-less `SEC()` programs (e.g., `SEC("kprobe")`,
`SEC("tp")`, etc);
- support BPF sub-skeletons for "incomplete" BPF object files
(requires matching `bpftool` to generate `.subskel.h`);
- BPF cookie support for `fentry`/`fexit`/`fmod_ret` BPF programs
(`bpf_program__attach_trace_opts()`);
- support for custom `SEC()` handlers (`libbpf_register_prog_handler()`).

## BPF-side API
- BPF-side USDT APIs. See new `usdt.bpf.h` header:
  - `BPF_USDT()` program wrapper macro;
  - `bpf_usdt_arg()`, `bpf_usdt_arg_cnt()`, `bpf_usdt_cookie()` helpers;
- new `bpf_core_field_offset()` CO-RE helper and support
`bpf_core_field_size(type, field)` forms;
- `barrier()` and `barrier_var()` macros for improving BPF code generation;
- `__kptr` and `__kptr_ref` tags added;
- ARC architecture support in `bpf_tracing.h` header;
- new BPF helpers:
  - `bpf_skb_set_tstamp()`;
  - `bpf_ima_file_hash()`;
  - `bpf_kptr_xchg()`;
  - `bpf_map_lookup_percpu_elem()`.

## Bug fixes
- netlink bug fixes;
- libbpf.pc fixes to support patch releases properly;
- `BPF_MAP_TYPE_PERF_EVENT_ARRAY` map auto-pinning fix;
- minor CO-RE fixes and improvements for some corner cases;
- various other small fixes and improvements.

**Full Changelog**: https://github.com/libbpf/libbpf/compare/v0.7.0...v0.8.0

  [0] https://github.com/libbpf/libbpf/releases/tag/v0.8.0

-- Andrii



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux