PackageTrack
Sign in Get early access

libbpf-rs

libbpf-rs is a safe, idiomatic, and opinionated wrapper around libbpf-sys

0.27.0 7.0M downloads/mo #3778 most downloaded on crates.io libbpf/libbpf-rs

What this package is like to depend on

Last release 24 days ago

30 Jul 2026

Release timing varies

gaps range from 2 weeks to 6 months

Some releases are documented

notes for 20 of 55 stable releases

Nothing withdrawn

no release was ever pulled

6 years old

59 releases · first in 2020

4 releases in the last 12 months

see the full history below

Release timeline

59 releases · Jun 2020 to Jul 2026
2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 59
  1. 0.27.0 30 Jul 2026
    Release notes

    What's Changed

    libbpf-rs

    • Added KprobeMultiLinkInfo & UprobeMultiLinkInfo fields that required a second info call
    • Added key_size, value_size and more getters to OpenMap{,Mut}
    • Added specific IterLinkInfo fields for LinkTypeInfo::Iter
    • Added ErrorKind::TooBig variant, surfaced when the underlying operation fails with E2BIG (e.g., a map reaching max_entries)
    • Added MapHandle::from_pinned_path_with_file_flags for opening maps with custom file flags
    • Changed name members of query info types to be OsString instead of CString
    • Made various query::*Info types non-exhaustive

    New Contributors

    Full Changelog: v0.26.2...v0.27.0

    Open source →
    Release notes
    • Added KprobeMultiLinkInfo & UprobeMultiLinkInfo fields that required a second info call.
    • Added key_size, value_size and more getters to OpenMap{,Mut}
    • Added specific IterLinkInfo fields for LinkTypeInfo::Iter.
    • Added ErrorKind::TooBig variant, surfaced when the underlying operation fails with E2BIG (e.g., a map reaching max_entries).
    • Added MapHandle::from_pinned_path_with_file_flags for opening maps with custom file flags.
    • Changed name members of query info types to be OsString instead of CString
    • Made various query::*Info types non-exhaustive
    Open source →
  2. 0.26.2 08 Apr 2026
    Release notes

    What's Changed

    libbpf-rs

    • Added ProgramMut::assoc_struct_ops for associating non-struct_ops programs with struct_ops maps
    • Added IterOpts::None variant for attach_iter_with_opts()
    • Updated libbpf-sys dependency to 1.7.0

    libbpf-cargo

    • Included missing-docs lint suppression on generated skeleton

    Full Changelog: v0.26.1...v0.26.2

    Open source →
    Release notes
    • Added ProgramMut::assoc_struct_ops for associating non-struct_ops programs with struct_ops maps
    • Added IterOpts::None variant for attach_iter_with_opts()
    • Updated libbpf-sys dependency to 1.7.0
    Open source →
  3. 0.26.1 26 Feb 2026
    Release notes

    What's Changed

    libbpf-rs

    • Added MapCore::query_fdinfo for querying map fdinfo
    • Added ProgramType::Netfilter variant
    • Adjusted Program::attach_uprobe_multi_with_opts to work with empty func_pattern

    libbpf-cargo

    • Added SkeletonBuilder::reference_obj for enabling generate skeleton to reference an object file instead of embedding it

    New Contributors

    Full Changelog: v0.26.0...v0.26.1

    Open source →
    Release notes
    • Added MapCore::query_fdinfo for querying map fdinfo
    • Added ProgramType::Netfilter variant
    • Adjusted Program::attach_uprobe_multi_with_opts to work with empty func_pattern
    Open source →
  4. 0.26.0 04 Feb 2026
    Release notes

    What's Changed

    libbpf-rs

    • Added Link::info method for retrieving LinkInfo
    • Extended LinkTypeInfo::PerfEvent variant to contain newly added PerfEventLinkInfo object
    • Added Linker::add_buf method for adding in-memory ELF files to the set of objects to link
    • Added Program::attach_iter_with_opts for attaching to iterators with additional options
    • Added Program::attach_uprobe_multi & Program::attach_uprobe_multi_opts to enable attachments of multi uprobes at once
    • Added Program::{stdout,stderr} for accessing BPF stdout and stderr streams
    • Added OpenProgram::autoload getter
    • Added OpenMap::autocreate and Map::autocreate getters
    • Added MapCore::lookup_into for looking up values into preallocated buffers
    • Added verified_insns attribute to query::ProgramInfo type
    • Made query::ProgramInfo non-exhaustive
    • Added ObjectBuilder::btf_custom_path setter

    libbpf-cargo

    • Fixed Rust type generation for trailing bitfields in composite C types
    • Fixed handling of XxxSkelBuilder::obj_builder customizations when using open() constructor
    • Allowlisted libbpf-sys 1.6.3

    New Contributors

    Full Changelog: v0.26.0-beta.1...v0.26.0

    Open source →
    Release notes
    • Added Link::info method for retrieving LinkInfo
    • Extended LinkTypeInfo::PerfEvent variant to contain newly added PerfEventLinkInfo object
    • Added Linker::add_buf method for adding in-memory ELF files to the set of objects to link
    • Added Program::attach_iter_with_opts for attaching to iterators with additional options
    • Added Program::attach_uprobe_multi & Program::attach_uprobe_multi_opts to enable attachments of multi uprobes at once
    • Added Program::{stdout,stderr} for accessing BPF stdout and stderr streams
    • Added OpenProgram::autoload getter
    • Added OpenMap::autocreate and Map::autocreate getters
    • Added MapCore::lookup_into for looking up values into preallocated buffers
    • Added verified_insns attribute to query::ProgramInfo type
    • Made query::ProgramInfo non-exhaustive
    • Added ObjectBuilder::btf_custom_path setter
    Open source →
  5. 0.26.0-beta.1 11 Aug 2025 pre-release
    Release notes

    What's Changed

    libbpf-cargo

    • Allowlisted libbpf-sys 1.6.1

    Full Changelog: v0.26.0-beta.0...v0.26.0-beta.1

    Open source →
  6. 0.26.0-beta.0 24 Jul 2025 pre-release
    Release notes

    What's Changed

    libbpf-rs

    • Added target_obj_id and target_btf_id fields to TracingLinkInfo to expose BTF information directly from kernel queries
    • Removed previously deprecated Program::get_id_by_fd method
    • Bumped minimum Rust version to 1.82

    libbpf-cargo

    • Moved BPF object content in generated skeletons into .bpf.objs section allowing easy extraction from the final binary
    • Bumped minimum Rust version to 1.82

    New Contributors

    Full Changelog: v0.25.0...v0.26.0-beta.0

    Open source →
    Release notes
    • Added target_obj_id and target_btf_id fields to TracingLinkInfo to expose BTF information directly from kernel queries
    • Removed previously deprecated Program::get_id_by_fd method
    • Bumped minimum Rust version to 1.82
    Open source →
  7. 0.25.0 30 May 2025
    Release notes

    What's Changed

    libbpf-rs

    • Added kprobe multi support for attaching programs, with and without providing additional options
    • Added Program::attach_perf_event_with_opts for attaching to perf events with additional options
    • Allow to provide additional options when attaching programs to raw tracepoints
    • Allow to provide additional options when attaching programs to kprobes
    • Introduced TracepointCategory enum for specifying tracepoint categories
    • Added max_entries getter to various map types
    • Added OpenProgramMut::set_autoattach
    • Added additional ProgramAttachType and query::LinkTypeInfo variants
    • Adjusted UprobeOpts::func_name to be an Option
    • Implemented Sync for Link
    • Updated libbpf-sys dependency to 1.5.0
    • Added ProgramInput::repeat field to run a test multiple times
    • Added ProgramOutput::duration field which represent the average duration per repetition
    • Added RingBuffer::consume_raw_n method to consume up to N items

    libbpf-cargo

    • Adjusted all <xxx>_data BPF map skeleton members to be Options
    • Adjusted numbering of generated Rust structs for anonymous C types to be less fragile in the presence of type additions
    • Removed SkeletonBuilder::skip_clang_version_check and SkeletonBuilder::debug
    • Removed --skip-clang-version-checks option of libbpf build sub-command
    • Replaced --debug option of libbpf sub-command with -v / --verbose
      • Removed --quiet option of libbpf make sub-command
    • Replaced CompilationOutput type with tracing based solution using newly added util::CargoWarningFormatter
    • Fixed handling of multiple types of same name in BTF by enumerating them in the generated skeleton
    • Bumped minimum Rust version to 1.78

    New Contributors

    Full Changelog: v0.25.0-beta.1...v0.25.0

    Open source →
    Release notes
    • Added kprobe multi support for attaching programs, with and without providing additional options
    • Added Program::attach_perf_event_with_opts for attaching to perf events with additional options
    • Allow to provide additional options when attaching programs to raw tracepoints
    • Allow to provide additional options when attaching programs to kprobes
    • Introduced TracepointCategory enum for specifying tracepoint categories
    • Added max_entries getter to various map types
    • Added OpenProgramMut::set_autoattach
    • Added additional ProgramAttachType and query::LinkTypeInfo variants
    • Adjusted UprobeOpts::func_name to be an Option
    • Implemented Sync for Link
    • Updated libbpf-sys dependency to 1.5.0
    • Added ProgramInput::repeat field to run a test multiple times
    • Added ProgramOutput::duration field which represent the average duration per repetition
    • Added RingBuffer::consume_raw_n method to consume up to N items
    Open source →
  8. 0.25.0-beta.1 17 Dec 2024 pre-release
    Release notes

    What's Changed

    libbpf-rs

    • Adjusted btf::types::EnumMember to store value as i64
    • Adjusted btf::types::Enum64Member to store value as i128

    libbpf-cargo

    • Fixed skeleton generation when enum64 types are present

    New Contributors

    Full Changelog: v0.25.0-beta.0...v0.25.0-beta.1

    Open source →
    Release notes
    • Adjusted btf::types::EnumMember to store value as i64
    • Adjusted btf::types::Enum64Member to store value as i128
    Open source →
  9. 0.25.0-beta.0 19 Nov 2024 pre-release
    Release notes

    What's Changed

    libbpf-rs

    • Added Map::lookup_batch and Map::lookup_and_delete_batch method

    libbpf-cargo

    • Represent C enums with custom types and const fields
      • Adjusted Rust correspondents in generated skeletons to no longer be wrapped in MaybeUninit
    • Adjusted SkeletonBuilder::build* methods to return CompilationOutput on success

    New Contributors

    Full Changelog: v0.24.8...v0.25.0-beta.0

    Open source →
    Release notes
    • Added Map::lookup_batch and Map::lookup_and_delete_batch method
    • Added Send & Sync impl for OpenObject & Object types
    Open source →
  10. 0.24.8 08 Nov 2024
    Release notes

    What's Changed

    libbpf-rs

    • Added Program::attach_netfilter_with_opts for attaching to netfilter hooks

    Full Changelog: v0.24.8...v0.24.8

    Open source →
    Release notes
    • Added Program::attach_netfilter_with_opts for attaching to netfilter hooks
    Open source →
  11. 0.24.7 04 Nov 2024

    Nothing published for this version

  12. 0.24.6 11 Oct 2024

    Nothing published for this version

  13. 0.24.5 30 Sep 2024
    Release notes
    • Renamed Program::get_id_by_fd to id_from_fd
      • Deprecated Program::get_id_by_fd
    • Renamed Program::get_fd_by_id to fd_from_id
      • Deprecated Program::get_fd_by_id
    • Adjusted Program::{attach_*, test_run} methods to work on shared receivers
    • Adjusted PerfBufferBuilder to work with MapCore objects
    Open source →
  14. 0.24.4 27 Aug 2024
    Release notes
    • Added Program::fd_from_pinned_path method for restoring program descriptor from a pinned path
    Open source →
  15. 0.24.3 23 Aug 2024

    Nothing published for this version

  16. 0.24.2 15 Aug 2024

    Nothing published for this version

  17. 0.24.1 08 Aug 2024

    Nothing published for this version

  18. 0.24.0 07 Aug 2024
    Release notes
    • 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
    Open source →
  19. 0.23.3 11 Jun 2024

    Nothing published for this version

  20. 0.23.2 21 May 2024
    Release notes
    • Fixed build failure on Android platforms
    Open source →
  21. 0.23.1 08 May 2024
    Release notes
    • 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
    Open source →
  22. 0.23.0 02 Apr 2024
    Release notes
    • 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
    Open source →
  23. 0.22.1 04 Jan 2024
    Release notes
    • Introduced Xdp type for working with XDP programs
    • Fixed handling of autocreate maps with Object type
    Open source →
  24. 0.22.0 06 Dec 2023
    Release notes
    • 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
    Open source →
  25. 0.21.2 31 Jul 2023
    Release notes
    • Enabled key iteration on MapHandle objects (formerly possible only on Map objects)
    • Bumped minimum Rust version to 1.64
    Open source →
  26. 0.21.1 06 Jul 2023
    Release notes
    • Fixed build failures on 32 bit x86 and aarch32
    Open source →
  27. 0.21.0 05 Jul 2023
    Release notes
    • 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
    Open source →
  28. 0.20.1 12 Apr 2023
    Release notes
    • 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
    Open source →
  29. 0.20.0 15 Mar 2023
    Release notes
    • 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
    Open source →
  30. 0.19.1 13 Oct 2022
    Release notes
    • Initial documented release
    Open source →
  31. 0.19.0 11 Oct 2022

    Nothing published for this version

  32. 0.18.0 15 Jul 2022

    Nothing published for this version

  33. 0.17.0 13 Apr 2022

    Nothing published for this version

  34. 0.16.0 10 Jan 2022

    Nothing published for this version

  35. 0.15.0 03 Dec 2021

    Nothing published for this version

  36. 0.14.0 10 Nov 2021

    Nothing published for this version

  37. 0.13.0 14 Oct 2021

    Nothing published for this version

  38. 0.12.0 03 Aug 2021

    Nothing published for this version

  39. 0.11.2 16 Jul 2021

    Nothing published for this version

  40. 0.11.1 25 Jun 2021

    Nothing published for this version

  41. 0.11.0 03 Jun 2021

    Nothing published for this version

  42. 0.10.0 30 May 2021

    Nothing published for this version

  43. 0.9.3 11 May 2021

    Nothing published for this version

  44. 0.9.2 11 May 2021

    Nothing published for this version

  45. 0.9.1 10 May 2021

    Nothing published for this version

  46. 0.9.0 22 Apr 2021

    Nothing published for this version

  47. 0.8.0 20 Apr 2021

    Nothing published for this version

  48. 0.7.2 06 Apr 2021

    Nothing published for this version

  49. 0.7.1 03 Apr 2021

    Nothing published for this version

  50. 0.7.0 24 Jan 2021

    Nothing published for this version

  51. 0.6.2 04 Jan 2021

    Nothing published for this version

  52. 0.6.1 28 Dec 2020

    Nothing published for this version

  53. 0.6.0 24 Dec 2020

    Nothing published for this version

  54. 0.5.0 26 Aug 2020

    Nothing published for this version

  55. 0.4.0 11 Aug 2020

    Nothing published for this version

  56. 0.3.0 14 Jul 2020

    Nothing published for this version

  57. 0.2.0 17 Jun 2020

    Nothing published for this version

  58. 0.1.1 10 Jun 2020

    Nothing published for this version

  59. 0.1.0 10 Jun 2020

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive