Skip to content

Releases: libbpf/libbpf-rs

v0.23.3

11 Jun 22:00
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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

v0.21.2

31 Jul 17:31
Compare
Choose a tag to compare

What's Changed

libbpf-rs

  • Enabled key iteration on MapHandle objects (formerly possible only on Map objects)
  • Bumped minimum Rust version to 1.64

libbpf-cargo

  • Added Default impl for generated struct types containing pointers
  • Fixed handling of function prototype type declaration inference in BTF and skeleton generation
  • Improved error reporting in build script usage
  • Bumped minimum Rust version to 1.64

Full Changelog: v0.21.1...v0.21.2

v0.21.1

06 Jul 18:50
Compare
Choose a tag to compare

What's Changed

libbpf-rs

  • Fixed build failures on 32 bit x86 and aarch32

libbpf-cargo

  • Adjusted named padding members in generated types to have pub visibility

Full Changelog: v0.21.0...v0.21.1

v0.21.0

05 Jul 17:55
Compare
Choose a tag to compare

What's Changed

libbpf-rs

  • Added TcHook::get_handle and TcHook::get_priority methods for restoring TcHook object
  • Added Program::get_fd_by_id and Program::get_id_by_fd methods for restoring bpf management data
  • Added Map::is_pinned and Map::get_pin_path methods for getting map pin status
  • Added Program::attach_iter for attaching of programs to an iterator
  • Added Map::delete_batch method for bulk deletion of elements
  • Added read/update/delete support for queue and stack Map types
  • Added a new MapHandle which provides most functionality previously found in Map
  • Removed support for creating Map objects standalone (i.e. maps not created by libbpf)
  • Removed various <object-type>::fd() methods in favor of <object-type>::as_fd()
  • Improved btf_type_match! macro, adding support for most of Rust's match capabilities
  • Added skel module exposing skeleton related traits
  • Fixed issue where instances of Map created or opened without going through Object would leak file descriptors
  • Fixed potential Uprobe attachment failures on optimized builds caused by improper libbpf_sys::bpf_object_open_opts object initialization
  • Adjusted various methods to work with BorrowedFd instead of raw file descriptors
  • Made RingBufferBuilder::add enforce that self cannot outlive the maps passed into it
  • Adjusted Error::System variant textual representation to include errno string

libbpf-cargo

  • Adjusted skeleton generation code to ensure implementation of libbpf-rs's SkelBuilder, OpenSkel, and Skel traits
  • Improved error reporting on BPF C file compilation failure

New Contributors

Full Changelog: v0.20.1...v0.21.0

v0.20.1

12 Apr 18:07
Compare
Choose a tag to compare

What's Changed

libbpf-rs

  • Added bindings for BTF via newly introduced btf module
  • Added Map constructors from pinned paths and from map id
  • Added Map::as_libbpf_bpf_map_ptr and Object::as_libbpf_bpf_object_ptr accessors
  • Added MapInfo type as a convenience wrapper around bpf_map_info
    • Added Map::info to Map to make it easier to derive MapInfo from a Map instance
  • Added set_log_level, log_level, and autoload methods to OpenProgram
  • Removed deprecated Link::get_fd method
  • Bumped minimum Rust version to 1.63

libbpf-cargo

  • Switched over to using libbpf-rs's BTF support internally for skeleton generation
  • Fixed potential build failures on systems defaulting to stack protector usage by passing -fno-stack-protector to clang

New Contributors

Full Changelog: v0.20.0...v0.20.1