File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Unreleased
2020- Added ` Object::name ` method
2121- Added ` Copy ` and ` Clone ` impls for types inside ` btf::types ` module
2222- Adjusted ` OpenMap::set_inner_map_fd ` to return ` Result `
23+ - Adjusted ` ProgramInput::context_in ` field to be a mutable reference
2324- Made inner ` query::Tag ` contents publicly accessible
2425- Removed ` Display ` implementation of various ` enum ` types
2526
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ impl From<TracepointOpts> for libbpf_sys::bpf_tracepoint_opts {
104104 }
105105}
106106
107+
107108/// An immutable parsed but not yet loaded BPF program.
108109pub type OpenProgram < ' obj > = OpenProgramImpl < ' obj > ;
109110/// A mutable parsed but not yet loaded BPF program.
@@ -505,6 +506,8 @@ impl From<u32> for ProgramAttachType {
505506#[ derive( Debug , Default ) ]
506507pub struct Input < ' dat > {
507508 /// The input context to provide.
509+ ///
510+ /// The input is mutable because the kernel may modify it.
508511 pub context_in : Option < & ' dat mut [ u8 ] > ,
509512 /// The output context buffer provided to the program.
510513 pub context_out : Option < & ' dat mut [ u8 ] > ,
@@ -543,6 +546,7 @@ pub type Program<'obj> = ProgramImpl<'obj>;
543546/// A mutable loaded BPF program.
544547pub type ProgramMut < ' obj > = ProgramImpl < ' obj , Mut > ;
545548
549+
546550/// Represents a loaded [`Program`].
547551///
548552/// This struct is not safe to clone because the underlying libbpf resource cannot currently
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ use crate::common::get_test_object;
5656use crate :: common:: get_test_object_path;
5757use crate :: common:: open_test_object;
5858
59+
5960/// A helper function for instantiating a `RingBuffer` with a callback meant to
6061/// be invoked when `action` is executed and that is intended to trigger a write
6162/// to said `RingBuffer` from kernel space, which then reads a single `i32` from
You can’t perform that action at this time.
0 commit comments