On Thu, Feb 10, 2022 at 4:25 PM Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > libbpf v0.7 was just released ([0]). It features a bunch of new > features, quality of life improvements (e.g., automatic handling of > RLIMIT_MEMLOCK), and a bunch of further deprecations. Also, more APIs > got better documentation, as well as various bugs were fixed and > support for older kernels was improved. > > Overall, libbpf v0.7 should be the last version with lots of > deprecations before libbpf 1.0 release. libbpf v0.8 should get a few > extra features helping with libbpf 1.0 migration, as well as the usual > stream of further improvements, but no major new deprecations are > planned so far. We are definitely getting pretty close to be ready for > the actual v1.0 release! > > Thanks to all the contributors for pushing libbpf forward! > > > ## Important updates towards Libbpf 1.0 > - no need for explicit `setrlimi(RLIMIT_MEMLOCK)` when > `LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK` is passed to > `libbpf_set_strict_mode()`. libbpf will determine whether this is > necessary automatically based on kernel's support for memcg-based > memory accounting for BPF; > - legacy BPF map definitions (using `struct bpf_map_def`) are > deprecated when `LIBBPF_STRICT_MAP_DEFINITIONS` is passed to > `libbpf_set_strict_mode()`. Please use BTF-defined map definitions. > - another batch of API deprecations. > > ## New features and APIs: > - ability to control and capture BPF verifier log output on > per-object and per-program level; > - CO-RE support and other improvements for "light skeleton"; > - further libbpf API documentation improvements; > - new feature-probing APIs (`libbpf_probe_bpf_helper()`, > `libbpf_probe_bpf_prog_type()`, `libbpf_probe_bpf_map_type()`); > - new streamlined low-level XDP APIs (`bpf_xdp_attach()`, > `bpf_xdp_detach()`, `bpf_xdp_query()`, `bpf_xdp_query_id()`); > - new `SEC("xdp.frags")`, `SEC("xdp.frags/cpumap")`, > `SEC("xdp.frags/devmap")` section definitions; > - new `SEC("iter.s/xxx")` section definitions for sleepable BPF > iterator programs. > > ## BPF-side APIs and features: > - `bpf_loop()` helper; > - `bpf_func_arg()`, `bpf_func_ret()`, `bpf_func_arg_cnt()` helpers; > - added syscall-specific `PT_REGS_xxx()` macros for retrieving > syscall arguments; > - added `BPF_KPROBE_SYSCALL()` helper macro for syscall kprobes; > - `bpf_get_retval()` and `bpf_set_retval()` helpers; > - `bpf_xdp_get_buff_len()` helper; > - `bpf_copy_from_user_task()` helper for sleepable BPF programs. > > ## Bug fixes and compatibility improvements: > - fixed compilation error for C++ due to `btf_dump__new()` macro magic; > - improved `LINUX_VERSION_CODE` detection for Ubuntu; > - improved multiple kprobe support for legacy kprobe mode on old kernels; > - improved compilation when system BTF UAPI headers are outdated; > - a bunch of fixes of `PT_REGS_PARMn*()` macros for various architectures. > > **Full Changelog**: https://github.com/libbpf/libbpf/compare/v0.6.0...v0.7.0 > > [0] https://github.com/libbpf/libbpf/releases/tag/v0.7.0 > I've noticed that libbpf.map has a bug. LIBBPF_0.7.0 didn't inherit from LIBBPF_0.6.0. I cherry picked the fix ([0]) to Github repo and updated v0.7.0 tag. Please be advised if you happened to pull the tag before this fix, you'll need to re-pull. Sorry for any inconveniences. [0] https://github.com/libbpf/libbpf/commit/2cd2d03f63242c048a896179398c68d2dbefe3d6 > -- Andrii