Skip to content

Releases: libbpf/libbpf-rs

v0.24.3

23 Aug 17:01

Choose a tag to compare

What's Changed

libbpf-cargo

  • Silenced possible clippy reported warnings in generated skeleton when BPF object file does not contain any maps

Full Changelog: v0.24.2...v0.24.3

v0.24.2

15 Aug 16:17

Choose a tag to compare

What's Changed

libbpf-cargo

  • Fixed panic on "open" of skeleton with kconfig map

Full Changelog: v0.24.1...v0.24.2

v0.24.1

08 Aug 17:52

Choose a tag to compare

What's Changed

libbpf-cargo

  • Fixed missing BPF object cleanup after skeleton destruction

Full Changelog: v0.24.0...v0.24.1

v0.24.0

07 Aug 21:20

Choose a tag to compare

What's Changed

libbpf-rs

  • Split {Open,}{Map,Program} into {Open,}{Map,Program} (for shared access) and {Open,}{Map,Program}Mut (for exclusive access)
  • Added AsRawLibbpf impl for OpenObject and ObjectBuilder
  • Decoupled Map and MapHandle more and introduced MapCore trait abstracting over common functionality
  • Adjusted SkelBuilder::open method to require mutable reference to storage space for BPF object
  • Adjusted {Open,}Object::from_ptr constructor to be infallible
  • Added {Open,}Object::maps{_mut,} and {Open,}Object::progs{_mut,} for BPF map and program iteration
  • Adjusted various APIs to return/use OsStr instead of CStr or str
  • Adjusted {Open,}Program to lazily retrieve name and section
    • Changed name and section methods to return &OsStr and made constructors infallible
  • Adjusted OpenObject::name to return Option<&OsStr>
  • Removed Result return type from OpenProgram::{set_log_level,set_autoload,set_flags}
  • Added Object::name method
  • Added Copy and Clone impls for types inside btf::types module
  • Adjusted OpenMap::set_inner_map_fd to return Result
  • Adjusted ProgramInput::context_in field to be a mutable reference
  • Made inner query::Tag contents publicly accessible
  • Fixed potential memory leak in RingBufferBuilder::build
  • Removed Display implementation of various enum types

libbpf-cargo

  • Reworked generated skeletons to contain publicly accessible maps and program members, no longer requiring method calls
  • Adjusted skeleton creation logic to generate Rust types for all types available in BPF
  • Renamed module for generated Rust types from <project>_types to just types
  • Renamed generated struct_ops type to StructOps and moved it out of types module
  • Fixed Rust code generation logic to properly create Default impl for arrays of pointers

New Contributors

Full Changelog: v0.23.3...v0.24.0

v0.23.3

11 Jun 22:00

Choose a tag to compare

What's Changed

libbpf-cargo

  • Fixed generation of Default impl in presence of large padding arrays

New Contributors

Full Changelog: v0.23.2...v0.23.3

v0.23.2

21 May 17:04

Choose a tag to compare

What's Changed

libbpf-rs

  • Fixed build failure on Android platforms

New Contributors

Full Changelog: v0.23.1...v0.23.2

v0.23.1

08 May 18:40

Choose a tag to compare

What's Changed

libbpf-rs

  • Added support for user ring buffers
  • Fixed handling of bloom filter type maps
    • Added Map::lookup_bloom_filter for looking up elements in a bloom filter

libbpf-cargo

  • Added "import injection" escape hatch to generated skeletons

New Contributors

Full Changelog: v0.23.0...v0.23.1

v0.23.0

02 Apr 17:13

Choose a tag to compare

What's Changed

libbpf-rs

  • Overhauled crate feature set:
    • Removed novendor feature
    • Added vendored feature to use vendored copies of all needed libraries
  • Added Program::attach_ksyscall for attaching to ksyscall handlers
  • Added Program::test_run as a way for test-running programs
  • Added OpenMap::initial_value{,_mut} for retrieving a map's initial value
  • Added replace functionality to Xdp type
  • Added low-level consume_raw and poll_raw methods to RingBuffer type
  • Added recursion_misses attribute to query::ProgramInfo type
  • Added AsRawLibbpf impl for OpenProgram
  • Fixed incorrect inference of btf::types::MemberAttr::Bitfield variant
  • Fixed examples not building on non-x86 architectures
  • Fixed potentially missing padding byte initialization on some target architectures
  • Fixed compilation issues caused by mismatching function signatures in certain cross-compilation contexts
  • Updated libbpf-sys dependency to 1.4.0
  • Bumped minimum Rust version to 1.71

libbpf-cargo

  • Removed novendor feature in favor of having disableable default feature
  • Added support for struct_ops shadow objects for generated skeletons
  • Added support for handling custom data sections in generated skeletons
  • Adjusted SkeletonBuilder::clang_args to accept an iterator of arguments instead of a string
  • Added --clang-args argument to make and build sub-commands
  • Put all generated types into single <project>_types module as opposed to having multiple modules for various sections (.bss, .rodata, etc.)
  • Fixed potential naming issues by escaping reserved keywords used in identifiers
  • Fixed potential unsoundness issues in generated skeletons by wrapping "unsafe" type in MaybeUninit
  • Added pointer based ("raw") access to datasec type to generated skeletons
  • Added better handling for bitfields to code generation logic
  • Updated libbpf-sys dependency to 1.4.0
  • Bumped minimum Rust version to 1.71

New Contributors

Full Changelog: v0.22.1...v0.23.0

v0.22.1

04 Jan 22:50

Choose a tag to compare

What's Changed

libbpf-rs

  • Introduced Xdp type for working with XDP programs
  • Fixed handling of autocreate maps with Object type

New Contributors

Full Changelog: v0.22.0...v0.22.1

v0.22.0

06 Dec 17:21

Choose a tag to compare

What's Changed

libbpf-rs

  • Reworked Error type:
    • Replaced enum with data variants with struct hiding internal structure
    • Added support for chaining of errors
    • Overhauled how errors are displayed
  • Overhauled query::ProgramInfo and query::ProgInfoIter to make them more readily usable
  • Added Btf::from_vmlinux constructor and adjusted Btf::from_path to work with both raw and ELF files
  • Reworked ObjectBuilder:
    • Made name method fallible
    • Adjusted opts to return a reference to libbpf_sys::bpf_object_open_opts
    • Removed object name argument from open_memory constructor
    • Added pin_root_path setter
  • Added AsRawLibbpf trait as a unified way to retrieve libbpf equivalents for libbpf-rs objects
  • Added Map::update_batch method
  • Implemented Send for Link
  • Bumped minimum Rust version to 1.65
  • Updated bitflags dependency to 2.0

libbpf-cargo

  • Adjusted skeleton creation logic to generate shared and exclusive datasec accessor functions
  • Removed Error enum in favor of anyhow::Error
  • Bumped minimum Rust version to 1.65

New Contributors

Full Changelog: v0.21.2...v0.22.0