Skip to content

Releases: libbpf/libbpf-rs

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

v0.20.0

15 Mar 20:59
Compare
Choose a tag to compare

What's Changed

libbpf-rs

  • Added support for USDT probes
  • Added BPF linker support with new Linker type
  • Added Program::attach_uprobe_with_opts for attaching Uprobes with additional options
  • Added tproxy example
  • Added option to RingBuffer::poll to block indefinitely
  • Added support for querying BPF program type using OpenProgram::prog_type
  • Added support for retrieving a BPF program's instructions using OpenProgram::insns & Program::insns
  • Added MapType::is_supported, ProgramType::is_supported, and ProgramType::is_helper_supported methods
  • Added PerfBuffer::as_libbpf_perf_buffer_ptr to access underlying libbpf-sys object
  • Adjusted various Map methods to work on shared receivers
  • Fixed Link::open constructor to be a static method
  • Fixed unsoundness in skeleton logic caused by aliased Box contents
  • Implemented Send for PerfBuffer and RingBuffer
  • Made more types implement Clone and Debug
  • Run leak sanitizer in CI
  • Updated various dependencies

libbpf-cargo

  • Fixed mismatch in size of generated types with respect to corresponding C types
  • Fixed generated skeleton potentially being unstable (changing each time)
  • Implemented Sync for generated skeletons
  • Made formatting using rustfmt optional
  • Updated various dependencies

New Contributors

Full Changelog: v0.19.1...v0.20.0