libbpf-cargo
Cargo plugin to build bpf programs
0.27.0
6.0M downloads/mo
#4134 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 22 of 58 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
62 releases · first in 2020
4 releases in the last 12 months
see the full history below
Release timeline
62 releases · Jun 2020 to Jul 2026Releases
latest 60 of 62-
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
- 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 →- Included
missing-docslint suppression on generated skeleton - 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
SkeletonBuilder::reference_objfor enabling generate skeleton to reference an object file instead of embedding it
- 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 →- 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
- 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 →- Moved BPF object content in generated skeletons into
.bpf.objssection allowing easy extraction from the final binary - 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 →- 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
-
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
- 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 →- 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
- 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
- Added
-
0.24.704 Nov 2024 -
0.24.611 Oct 2024Release notes
Open source →- Fixed incorrect Cargo environment variable query when used in build script context
-
0.24.530 Sep 2024Nothing published for this version
-
0.24.427 Aug 2024Release notes
Open source →- Adjusted skeleton generation code to work around
libbpfforward compatibility issue when an old systemlibbpfis being used instead of the vendored copy
- Adjusted skeleton generation code to work around
-
0.24.323 Aug 2024Release notes
Open source →- Silenced possible
clippyreported warnings in generated skeleton when BPF object file does not contain any maps
- Silenced possible
-
0.24.215 Aug 2024 -
0.24.108 Aug 2024 -
0.24.007 Aug 2024Release notes
Open source →- 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>_typesto justtypes - Renamed generated
struct_opstype toStructOpsand moved it out oftypesmodule - Fixed Rust code generation logic to properly create
Defaultimpl for arrays of pointers
-
0.23.311 Jun 2024 -
0.23.221 May 2024Nothing published for this version
-
0.23.108 May 2024 -
0.23.002 Apr 2024Release notes
Open source →- Removed
novendorfeature in favor of having disableable default feature - Added support for
struct_opsshadow objects for generated skeletons - Added support for handling custom data sections in generated skeletons
- Adjusted
SkeletonBuilder::clang_argsto accept an iterator of arguments instead of a string - Added
--clang-argsargument tomakeandbuildsub-commands - Put all generated types into single
<project>_typesmodule 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"
types in
MaybeUninit - Added pointer based ("raw") access to datasec type to generated skeletons
- Added better handling for bitfields to code generation logic
- Updated
libbpf-sysdependency to1.4.0 - Bumped minimum Rust version to
1.71
- Removed
-
0.22.104 Jan 2024Nothing published for this version
-
0.22.006 Dec 2023Release notes
Open source →- Adjusted skeleton creation logic to generate shared and exclusive datasec accessor functions
- Removed
Errorenum in favor ofanyhow::Error - Bumped minimum Rust version to
1.65
-
0.21.231 Jul 2023Release notes
Open source →- Added
Defaultimpl for generatedstructtypes 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
- Added
-
0.21.106 Jul 2023Release notes
Open source →- Adjusted named padding members in generated types to have
pubvisibility
- Adjusted named padding members in generated types to have
-
0.21.005 Jul 2023Release notes
Open source →- Adjusted skeleton generation code to ensure implementation of
libbpf-rs'sSkelBuilder,OpenSkel, andSkeltraits - Improved error reporting on BPF C file compilation failure
- Adjusted skeleton generation code to ensure implementation of
-
0.20.112 Apr 2023Release notes
Open source →- 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-protectortoclang
- Switched over to using
-
0.20.015 Mar 2023Release notes
Open source →- Fixed mismatch in size of generated types with respect to corresponding C types
- Fixed generated skeleton potentially being unstable (changing each time)
- Implemented
Syncfor generated skeletons - Made formatting using
rustfmtoptional - Updated various dependencies
-
0.13.113 Oct 2022Nothing published for this version
-
0.13.011 Oct 2022Nothing published for this version
-
0.12.015 Jul 2022Nothing published for this version
-
0.11.013 Apr 2022Nothing published for this version
-
0.10.010 Jan 2022Nothing published for this version
-
0.9.403 Dec 2021Nothing published for this version
-
0.9.310 Nov 2021Nothing published for this version
-
0.9.214 Oct 2021Nothing published for this version
-
0.9.116 Aug 2021Nothing published for this version
-
0.9.003 Aug 2021Nothing published for this version
-
0.8.122 Jul 2021Nothing published for this version
-
0.8.016 Jul 2021Nothing published for this version
-
0.7.225 Jun 2021Nothing published for this version
-
0.7.103 Jun 2021Nothing published for this version
-
0.7.030 May 2021Nothing published for this version
-
0.6.311 May 2021Nothing published for this version
-
0.6.211 May 2021Nothing published for this version
-
0.6.110 May 2021Nothing published for this version
-
0.6.020 Apr 2021Nothing published for this version
-
0.5.121 Mar 2021Nothing published for this version
-
0.5.005 Mar 2021Nothing published for this version
-
0.4.325 Jan 2021Nothing published for this version
-
0.4.206 Jan 2021Nothing published for this version
-
0.4.104 Jan 2021Nothing published for this version
-
0.4.030 Dec 2020Nothing published for this version
-
0.3.029 Dec 2020Nothing published for this version
-
0.2.128 Dec 2020Nothing published for this version
-
0.2.024 Dec 2020Nothing published for this version
-
0.1.423 Nov 2020Nothing published for this version
-
0.1.326 Aug 2020Nothing published for this version
-
0.1.210 Jun 2020Nothing published for this version