Releases: libbpf/libbpf-rs
Releases · libbpf/libbpf-rs
v0.24.0
What's Changed
libbpf-rs
- Split
{Open,}{Map,Program}
into{Open,}{Map,Program}
(for shared access) and{Open,}{Map,Program}Mut
(for exclusive access) - Added
AsRawLibbpf
impl forOpenObject
andObjectBuilder
- Decoupled
Map
andMapHandle
more and introducedMapCore
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 ofCStr
orstr
- Adjusted
{Open,}Program
to lazily retrieve name and section- Changed
name
andsection
methods to return&OsStr
and made constructors infallible
- Changed
- Adjusted
OpenObject::name
to returnOption<&OsStr>
- Removed
Result
return type fromOpenProgram::{set_log_level,set_autoload,set_flags}
- Added
Object::name
method - Added
Copy
andClone
impls for types insidebtf::types
module - Adjusted
OpenMap::set_inner_map_fd
to returnResult
- 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 variousenum
types
libbpf-cargo
- 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>_types
to justtypes
- Renamed generated
struct_ops
type toStructOps
and moved it out oftypes
module - Fixed Rust code generation logic to properly create
Default
impl for arrays of pointers
New Contributors
Full Changelog: v0.23.3...v0.24.0
v0.23.3
What's Changed
libbpf-cargo
- Fixed generation of
Default
impl in presence of large padding arrays
New Contributors
- @rbartlensky made their first contribution in #786
Full Changelog: v0.23.2...v0.23.3
v0.23.2
What's Changed
libbpf-rs
- Fixed build failure on Android platforms
New Contributors
Full Changelog: v0.23.1...v0.23.2
v0.23.1
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
- Added
libbpf-cargo
- Added "import injection" escape hatch to generated skeletons
New Contributors
- @ThisSeanZhang made their first contribution in #770
- @barthr made their first contribution in #778
Full Changelog: v0.23.0...v0.23.1
v0.23.0
What's Changed
libbpf-rs
- Overhauled crate feature set:
- Removed
novendor
feature - Added
vendored
feature to use vendored copies of all needed libraries
- Removed
- 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 toXdp
type - Added low-level
consume_raw
andpoll_raw
methods toRingBuffer
type - Added
recursion_misses
attribute toquery::ProgramInfo
type - Added
AsRawLibbpf
impl forOpenProgram
- 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 to1.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 tomake
andbuild
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 to1.4.0
- Bumped minimum Rust version to
1.71
New Contributors
- @arighi made their first contribution in #680
- @jfernandez made their first contribution in #687
- @honsunrise made their first contribution in #693
- @EHfive made their first contribution in #742
- @eliad-wiz made their first contribution in #750
Full Changelog: v0.22.1...v0.23.0
v0.22.1
What's Changed
libbpf-rs
- Introduced
Xdp
type for working with XDP programs - Fixed handling of autocreate maps with
Object
type
New Contributors
- @eyakubovich made their first contribution in #637
Full Changelog: v0.22.0...v0.22.1
v0.22.0
What's Changed
libbpf-rs
- Reworked
Error
type:- Replaced
enum
with data variants withstruct
hiding internal structure - Added support for chaining of errors
- Overhauled how errors are displayed
- Replaced
- Overhauled
query::ProgramInfo
andquery::ProgInfoIter
to make them more readily usable - Added
Btf::from_vmlinux
constructor and adjustedBtf::from_path
to work with both raw and ELF files - Reworked
ObjectBuilder
:- Made
name
method fallible - Adjusted
opts
to return a reference tolibbpf_sys::bpf_object_open_opts
- Removed object name argument from
open_memory
constructor - Added
pin_root_path
setter
- Made
- Added
AsRawLibbpf
trait as a unified way to retrievelibbpf
equivalents forlibbpf-rs
objects - Added
Map::update_batch
method - Implemented
Send
forLink
- Bumped minimum Rust version to
1.65
- Updated
bitflags
dependency to2.0
libbpf-cargo
- Adjusted skeleton creation logic to generate shared and exclusive datasec accessor functions
- Removed
Error
enum in favor ofanyhow::Error
- Bumped minimum Rust version to
1.65
New Contributors
Full Changelog: v0.21.2...v0.22.0
v0.21.2
What's Changed
libbpf-rs
- Enabled key iteration on
MapHandle
objects (formerly possible only onMap
objects) - Bumped minimum Rust version to
1.64
libbpf-cargo
- Added
Default
impl for generatedstruct
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
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
What's Changed
libbpf-rs
- Added
TcHook::get_handle
andTcHook::get_priority
methods for restoring TcHook object - Added
Program::get_fd_by_id
andProgram::get_id_by_fd
methods for restoring bpf management data - Added
Map::is_pinned
andMap::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 inMap
- 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'smatch
capabilities - Added
skel
module exposing skeleton related traits - Fixed issue where instances of
Map
created or opened without going throughObject
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 thatself
cannot outlive the maps passed into it - Adjusted
Error::System
variant textual representation to includeerrno
string
libbpf-cargo
- Adjusted skeleton generation code to ensure implementation of
libbpf-rs
'sSkelBuilder
,OpenSkel
, andSkel
traits - Improved error reporting on BPF C file compilation failure
New Contributors
- @yan-ace62 made their first contribution in #436
- @yunbo-xufeng made their first contribution in #441
Full Changelog: v0.20.1...v0.21.0