pub struct KernelCapabilities {
pub supports_ringbuf: bool,
pub supports_perf_event_array: bool,
}Expand description
Kernel eBPF capabilities detection
Fields§
§supports_ringbuf: boolWhether the kernel supports BPF_MAP_TYPE_RINGBUF (requires >= 5.8)
supports_perf_event_array: boolWhether the kernel supports BPF_MAP_TYPE_PERF_EVENT_ARRAY (requires >= 4.3)
Implementations§
Source§impl KernelCapabilities
impl KernelCapabilities
Sourcepub fn get() -> Result<&'static Self, KernelCapabilityError>
pub fn get() -> Result<&'static Self, KernelCapabilityError>
Get global kernel capabilities (detected once on first call) Returns an error if neither RingBuf nor PerfEventArray is supported
Sourcepub fn get_perf_only() -> Result<&'static Self, KernelCapabilityError>
pub fn get_perf_only() -> Result<&'static Self, KernelCapabilityError>
Get kernel capabilities with PerfEventArray-only detection (for testing mode) Skips RingBuf detection and only validates PerfEventArray support Returns an error if PerfEventArray is not supported
Sourcepub fn ringbuf_supported() -> bool
pub fn ringbuf_supported() -> bool
Check if RingBuf is supported (convenience method)
Sourcepub fn perf_event_array_supported() -> bool
pub fn perf_event_array_supported() -> bool
Check if PerfEventArray is supported (convenience method)
Trait Implementations§
Source§impl Clone for KernelCapabilities
impl Clone for KernelCapabilities
Source§fn clone(&self) -> KernelCapabilities
fn clone(&self) -> KernelCapabilities
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelCapabilities
impl Debug for KernelCapabilities
impl Copy for KernelCapabilities
Auto Trait Implementations§
impl Freeze for KernelCapabilities
impl RefUnwindSafe for KernelCapabilities
impl Send for KernelCapabilities
impl Sync for KernelCapabilities
impl Unpin for KernelCapabilities
impl UnwindSafe for KernelCapabilities
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more