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 2026Releases
latest 59-
0.27.030 Jul 2026Release notes
Open source →What's Changed
libbpf-rs
- Added
KprobeMultiLinkInfo&UprobeMultiLinkInfofields that required a second info call - Added
key_size,value_sizeand more getters toOpenMap{,Mut} - Added specific
IterLinkInfofields forLinkTypeInfo::Iter - Added
ErrorKind::TooBigvariant, surfaced when the underlying operation fails withE2BIG(e.g., a map reachingmax_entries) - Added
MapHandle::from_pinned_path_with_file_flagsfor opening maps with custom file flags - Changed name members of
queryinfo types to beOsStringinstead ofCString - Made various
query::*Infotypes non-exhaustive
New Contributors
- @sonisr made their first contribution in #1377
- @fkcrazy001 made their first contribution in #1385
- @cong-or made their first contribution in #1391
- @weriomat made their first contribution in #1402
- @jacob-pro made their first contribution in #1417
Full Changelog: v0.26.2...v0.27.0
Release notes
Open source →- Added
KprobeMultiLinkInfo&UprobeMultiLinkInfofields that required a second info call. - Added
key_size,value_sizeand more getters toOpenMap{,Mut} - Added specific
IterLinkInfofields forLinkTypeInfo::Iter. - Added
ErrorKind::TooBigvariant, surfaced when the underlying operation fails withE2BIG(e.g., a map reachingmax_entries). - Added
MapHandle::from_pinned_path_with_file_flagsfor opening maps with custom file flags. - Changed name members of
queryinfo types to beOsStringinstead ofCString - Made various
query::*Infotypes non-exhaustive
- Added
-
0.26.208 Apr 2026Release notes
Open source →What's Changed
libbpf-rs
- Added
ProgramMut::assoc_struct_opsfor associating non-struct_opsprograms withstruct_opsmaps - Added
IterOpts::Nonevariant forattach_iter_with_opts() - Updated
libbpf-sysdependency to1.7.0
libbpf-cargo
- Included
missing-docslint suppression on generated skeleton
Full Changelog: v0.26.1...v0.26.2
Release notes
Open source →- Added
ProgramMut::assoc_struct_opsfor associating non-struct_ops programs with struct_ops maps - Added
IterOpts::Nonevariant forattach_iter_with_opts() - Updated
libbpf-sysdependency to1.7.0
- Added
-
0.26.126 Feb 2026Release notes
Open source →What's Changed
libbpf-rs
- Added
MapCore::query_fdinfofor querying map fdinfo - Added
ProgramType::Netfiltervariant - Adjusted
Program::attach_uprobe_multi_with_optsto work with emptyfunc_pattern
libbpf-cargo
- Added
SkeletonBuilder::reference_objfor enabling generate skeleton to reference an object file instead of embedding it
New Contributors
- @likewhatevs made their first contribution in #1336
Full Changelog: v0.26.0...v0.26.1
Release notes
Open source →- Added
MapCore::query_fdinfofor querying map fdinfo - Added
ProgramType::Netfiltervariant - Adjusted
Program::attach_uprobe_multi_with_optsto work with emptyfunc_pattern
- Added
-
0.26.004 Feb 2026Release notes
Open source →What's Changed
libbpf-rs
- Added
Link::infomethod for retrievingLinkInfo - Extended
LinkTypeInfo::PerfEventvariant to contain newly addedPerfEventLinkInfoobject - Added
Linker::add_bufmethod for adding in-memory ELF files to the set of objects to link - Added
Program::attach_iter_with_optsfor attaching to iterators with additional options - Added
Program::attach_uprobe_multi&Program::attach_uprobe_multi_optsto enable attachments of multi uprobes at once - Added
Program::{stdout,stderr}for accessing BPF stdout and stderr streams - Added
OpenProgram::autoloadgetter - Added
OpenMap::autocreateandMap::autocreategetters - Added
MapCore::lookup_intofor looking up values into preallocated buffers - Added
verified_insnsattribute toquery::ProgramInfotype - Made
query::ProgramInfonon-exhaustive - Added
ObjectBuilder::btf_custom_pathsetter
libbpf-cargo
- Fixed Rust type generation for trailing bitfields in composite C types
- Fixed handling of
XxxSkelBuilder::obj_buildercustomizations when usingopen()constructor - Allowlisted
libbpf-sys1.6.3
New Contributors
- @frelon made their first contribution in #1220
- @ver-nyan made their first contribution in #1253
- @vlrpl made their first contribution in #1258
- @sidchintamaneni made their first contribution in #1266
- @tamird made their first contribution in #1308
- @gadol21 made their first contribution in #1322
Full Changelog: v0.26.0-beta.1...v0.26.0
Release notes
Open source →- Added
Link::infomethod for retrievingLinkInfo - Extended
LinkTypeInfo::PerfEventvariant to contain newly addedPerfEventLinkInfoobject - Added
Linker::add_bufmethod for adding in-memory ELF files to the set of objects to link - Added
Program::attach_iter_with_optsfor attaching to iterators with additional options - Added
Program::attach_uprobe_multi&Program::attach_uprobe_multi_optsto enable attachments of multi uprobes at once - Added
Program::{stdout,stderr}for accessing BPF stdout and stderr streams - Added
OpenProgram::autoloadgetter - Added
OpenMap::autocreateandMap::autocreategetters - Added
MapCore::lookup_intofor looking up values into preallocated buffers - Added
verified_insnsattribute toquery::ProgramInfotype - Made
query::ProgramInfonon-exhaustive - Added
ObjectBuilder::btf_custom_pathsetter
- Added
-
0.26.0-beta.111 Aug 2025 pre-releaseRelease notes
Open source →What's Changed
libbpf-cargo
- Allowlisted
libbpf-sys1.6.1
Full Changelog: v0.26.0-beta.0...v0.26.0-beta.1
- Allowlisted
-
0.26.0-beta.024 Jul 2025 pre-releaseRelease notes
Open source →What's Changed
libbpf-rs
- Added
target_obj_idandtarget_btf_idfields toTracingLinkInfoto expose BTF information directly from kernel queries - Removed previously deprecated
Program::get_id_by_fdmethod - Bumped minimum Rust version to
1.82
libbpf-cargo
- Moved BPF object content in generated skeletons into
.bpf.objssection allowing easy extraction from the final binary - Bumped minimum Rust version to
1.82
New Contributors
- @Phoenix500526 made their first contribution in #1186
- @frobware made their first contribution in #1193
Full Changelog: v0.25.0...v0.26.0-beta.0
Release notes
Open source →- Added
target_obj_idandtarget_btf_idfields toTracingLinkInfoto expose BTF information directly from kernel queries - Removed previously deprecated
Program::get_id_by_fdmethod - Bumped minimum Rust version to
1.82
- Added
-
0.25.030 May 2025Release notes
Open source →What's Changed
libbpf-rs
- Added kprobe multi support for attaching programs, with and without providing additional options
- Added
Program::attach_perf_event_with_optsfor 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
TracepointCategoryenum for specifying tracepoint categories - Added
max_entriesgetter to various map types - Added
OpenProgramMut::set_autoattach - Added additional
ProgramAttachTypeandquery::LinkTypeInfovariants - Adjusted
UprobeOpts::func_nameto be anOption - Implemented
SyncforLink - Updated
libbpf-sysdependency to1.5.0 - Added
ProgramInput::repeatfield to run a test multiple times - Added
ProgramOutput::durationfield which represent the average duration per repetition - Added
RingBuffer::consume_raw_nmethod to consume up to N items
libbpf-cargo
- Adjusted all
<xxx>_dataBPF map skeleton members to beOptions - 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_checkandSkeletonBuilder::debug - Removed
--skip-clang-version-checksoption oflibbpf buildsub-command - Replaced
--debugoption oflibbpfsub-command with-v/--verbose- Removed
--quietoption oflibbpf makesub-command
- Removed
- Replaced
CompilationOutputtype withtracingbased solution using newly addedutil::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
- @Jongy made their first contribution in #1064
- @atenart made their first contribution in #1115
- @josefbacik made their first contribution in #1139
- @volcano0dr made their first contribution in #1142
- @theihor made their first contribution in #1153
- @chantra made their first contribution in #1159
- @SidongYang made their first contribution in #1176
- @Waujito made their first contribution in #1178
Full Changelog: v0.25.0-beta.1...v0.25.0
Release notes
Open source →- Added kprobe multi support for attaching programs, with and without providing additional options
- Added
Program::attach_perf_event_with_optsfor 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
TracepointCategoryenum for specifying tracepoint categories - Added
max_entriesgetter to various map types - Added
OpenProgramMut::set_autoattach - Added additional
ProgramAttachTypeandquery::LinkTypeInfovariants - Adjusted
UprobeOpts::func_nameto be anOption - Implemented
SyncforLink - Updated
libbpf-sysdependency to1.5.0 - Added
ProgramInput::repeatfield to run a test multiple times - Added
ProgramOutput::durationfield which represent the average duration per repetition - Added
RingBuffer::consume_raw_nmethod to consume up to N items
-
0.25.0-beta.117 Dec 2024 pre-releaseRelease notes
Open source →What's Changed
libbpf-rs
- Adjusted
btf::types::EnumMemberto store value asi64 - Adjusted
btf::types::Enum64Memberto store value asi128
libbpf-cargo
- Fixed skeleton generation when
enum64types are present
New Contributors
Full Changelog: v0.25.0-beta.0...v0.25.0-beta.1
Release notes
Open source →- Adjusted
btf::types::EnumMemberto store value asi64 - Adjusted
btf::types::Enum64Memberto store value asi128
- Adjusted
-
0.25.0-beta.019 Nov 2024 pre-releaseRelease notes
Open source →What's Changed
libbpf-rs
- Added
Map::lookup_batchandMap::lookup_and_delete_batchmethod
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 Rust correspondents in generated skeletons to no longer be wrapped in
- Adjusted
SkeletonBuilder::build*methods to returnCompilationOutputon success
New Contributors
- @JakeHillion made their first contribution in #994
Full Changelog: v0.24.8...v0.25.0-beta.0
Release notes
Open source →- Added
Map::lookup_batchandMap::lookup_and_delete_batchmethod - Added
Send&Syncimpl forOpenObject&Objecttypes
- Added
-
0.24.808 Nov 2024Release notes
Open source →What's Changed
libbpf-rs
- Added
Program::attach_netfilter_with_optsfor attaching to netfilter hooks
Full Changelog: v0.24.8...v0.24.8
Release notes
Open source →- Added
Program::attach_netfilter_with_optsfor attaching to netfilter hooks
- Added
-
0.24.704 Nov 2024Nothing published for this version
-
0.24.611 Oct 2024Nothing published for this version
-
0.24.530 Sep 2024Release notes
Open source →- Renamed
Program::get_id_by_fdtoid_from_fd- Deprecated
Program::get_id_by_fd
- Deprecated
- Renamed
Program::get_fd_by_idtofd_from_id- Deprecated
Program::get_fd_by_id
- Deprecated
- Adjusted
Program::{attach_*, test_run}methods to work on shared receivers - Adjusted
PerfBufferBuilderto work withMapCoreobjects
- Renamed
-
0.24.427 Aug 2024Release notes
Open source →- Added
Program::fd_from_pinned_pathmethod for restoring program descriptor from a pinned path
- Added
-
0.24.323 Aug 2024Nothing published for this version
-
0.24.215 Aug 2024Nothing published for this version
-
0.24.108 Aug 2024Nothing published for this version
-
0.24.007 Aug 2024Release notes
Open source →- Split
{Open,}{Map,Program}into{Open,}{Map,Program}(for shared access) and{Open,}{Map,Program}Mut(for exclusive access) - Added
AsRawLibbpfimpl forOpenObjectandObjectBuilder - Decoupled
MapandMapHandlemore and introducedMapCoretrait abstracting over common functionality - Adjusted
SkelBuilder::openmethod to require mutable reference to storage space for BPF object - Adjusted
{Open,}Object::from_ptrconstructor 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
OsStrinstead ofCStrorstr - Adjusted
{Open,}Programto lazily retrieve name and section- Changed
nameandsectionmethods to return&OsStrand made constructors infallible
- Changed
- Adjusted
OpenObject::nameto returnOption<&OsStr> - Removed
Resultreturn type fromOpenProgram::{set_log_level,set_autoload,set_flags} - Added
Object::namemethod - Added
CopyandCloneimpls for types insidebtf::typesmodule - Adjusted
OpenMap::set_inner_map_fdto returnResult - Adjusted
ProgramInput::context_infield to be a mutable reference - Made inner
query::Tagcontents publicly accessible - Fixed potential memory leak in
RingBufferBuilder::build - Removed
Displayimplementation of variousenumtypes
- Split
-
0.23.311 Jun 2024Nothing published for this version
-
0.23.221 May 2024 -
0.23.108 May 2024Release notes
Open source →- Added support for user ring buffers
- Fixed handling of bloom filter type maps
- Added
Map::lookup_bloom_filterfor looking up elements in a bloom filter
- Added
-
0.23.002 Apr 2024Release notes
Open source →- Overhauled crate feature set:
- Removed
novendorfeature - Added
vendoredfeature to use vendored copies of all needed libraries
- Removed
- Added
Program::attach_ksyscallfor attaching to ksyscall handlers - Added
Program::test_runas a way for test-running programs - Added
OpenMap::initial_value{,_mut}for retrieving a map's initial value - Added
replacefunctionality toXdptype - Added low-level
consume_rawandpoll_rawmethods toRingBuffertype - Added
recursion_missesattribute toquery::ProgramInfotype - Added
AsRawLibbpfimpl forOpenProgram - Fixed incorrect inference of
btf::types::MemberAttr::Bitfieldvariant - 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-sysdependency to1.4.0 - Bumped minimum Rust version to
1.71
- Overhauled crate feature set:
-
0.22.104 Jan 2024Release notes
Open source →- Introduced
Xdptype for working with XDP programs - Fixed handling of autocreate maps with
Objecttype
- Introduced
-
0.22.006 Dec 2023Release notes
Open source →- Reworked
Errortype:- Replaced
enumwith data variants withstructhiding internal structure - Added support for chaining of errors
- Overhauled how errors are displayed
- Replaced
- Overhauled
query::ProgramInfoandquery::ProgInfoIterto make them more readily usable - Added
Btf::from_vmlinuxconstructor and adjustedBtf::from_pathto work with both raw and ELF files - Reworked
ObjectBuilder:- Made
namemethod fallible - Adjusted
optsto return a reference tolibbpf_sys::bpf_object_open_opts - Removed object name argument from
open_memoryconstructor - Added
pin_root_pathsetter
- Made
- Added
AsRawLibbpftrait as a unified way to retrievelibbpfequivalents forlibbpf-rsobjects - Added
Map::update_batchmethod - Implemented
SendforLink - Bumped minimum Rust version to
1.65 - Updated
bitflagsdependency to2.0
- Reworked
-
0.21.231 Jul 2023Release notes
Open source →- Enabled key iteration on
MapHandleobjects (formerly possible only onMapobjects) - Bumped minimum Rust version to
1.64
- Enabled key iteration on
-
0.21.106 Jul 2023 -
0.21.005 Jul 2023Release notes
Open source →- Added
TcHook::get_handleandTcHook::get_prioritymethods for restoring TcHook object - Added
Program::get_fd_by_idandProgram::get_id_by_fdmethods for restoring bpf management data - Added
Map::is_pinnedandMap::get_pin_pathmethods for getting map pin status - Added
Program::attach_iterfor attaching of programs to an iterator - Added
Map::delete_batchmethod for bulk deletion of elements - Added read/update/delete support for queue and stack
Maptypes - Added a new
MapHandlewhich provides most functionality previously found inMap - Removed support for creating
Mapobjects 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'smatchcapabilities - Added
skelmodule exposing skeleton related traits - Fixed issue where instances of
Mapcreated or opened without going throughObjectwould leak file descriptors - Fixed potential Uprobe attachment failures on optimized builds caused by
improper
libbpf_sys::bpf_object_open_optsobject initialization - Adjusted various methods to work with
BorrowedFdinstead of raw file descriptors - Made
RingBufferBuilder::addenforce thatselfcannot outlive the maps passed into it - Adjusted
Error::Systemvariant textual representation to includeerrnostring
- Added
-
0.20.112 Apr 2023Release notes
Open source →- Added bindings for BTF via newly introduced
btfmodule - Added
Mapconstructors from pinned paths and from map id - Added
Map::as_libbpf_bpf_map_ptrandObject::as_libbpf_bpf_object_ptraccessors - Added
MapInfotype as a convenience wrapper aroundbpf_map_info- Added
Map::infotoMapto make it easier to deriveMapInfofrom aMapinstance
- Added
- Added
set_log_level,log_level, andautoloadmethods toOpenProgram - Removed deprecated
Link::get_fdmethod - Bumped minimum Rust version to
1.63
- Added bindings for BTF via newly introduced
-
0.20.015 Mar 2023Release notes
Open source →- Added support for USDT probes
- Added BPF linker support with new
Linkertype - Added
Program::attach_uprobe_with_optsfor attaching Uprobes with additional options - Added
tproxyexample - Added option to
RingBuffer::pollto 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, andProgramType::is_helper_supportedmethods - Added
PerfBuffer::as_libbpf_perf_buffer_ptrto access underlyinglibbpf-sysobject - Adjusted various
Mapmethods to work on shared receivers - Fixed
Link::openconstructor to be a static method - Fixed unsoundness in skeleton logic caused by aliased
Boxcontents - Implemented
SendforPerfBufferandRingBuffer - Made more types implement
CloneandDebug - Run leak sanitizer in CI
- Updated various dependencies
-
0.19.113 Oct 2022 -
0.19.011 Oct 2022Nothing published for this version
-
0.18.015 Jul 2022Nothing published for this version
-
0.17.013 Apr 2022Nothing published for this version
-
0.16.010 Jan 2022Nothing published for this version
-
0.15.003 Dec 2021Nothing published for this version
-
0.14.010 Nov 2021Nothing published for this version
-
0.13.014 Oct 2021Nothing published for this version
-
0.12.003 Aug 2021Nothing published for this version
-
0.11.216 Jul 2021Nothing published for this version
-
0.11.125 Jun 2021Nothing published for this version
-
0.11.003 Jun 2021Nothing published for this version
-
0.10.030 May 2021Nothing published for this version
-
0.9.311 May 2021Nothing published for this version
-
0.9.211 May 2021Nothing published for this version
-
0.9.110 May 2021Nothing published for this version
-
0.9.022 Apr 2021Nothing published for this version
-
0.8.020 Apr 2021Nothing published for this version
-
0.7.206 Apr 2021Nothing published for this version
-
0.7.103 Apr 2021Nothing published for this version
-
0.7.024 Jan 2021Nothing published for this version
-
0.6.204 Jan 2021Nothing published for this version
-
0.6.128 Dec 2020Nothing published for this version
-
0.6.024 Dec 2020Nothing published for this version
-
0.5.026 Aug 2020Nothing published for this version
-
0.4.011 Aug 2020Nothing published for this version
-
0.3.014 Jul 2020Nothing published for this version
-
0.2.017 Jun 2020Nothing published for this version
-
0.1.110 Jun 2020Nothing published for this version
-
0.1.010 Jun 2020Nothing published for this version