pub struct KernelCapabilities {
pub supports_ringbuf: bool,
pub supports_perf_event_array: bool,
pub supports_ns_current_pid_tgid_helper: 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)
supports_ns_current_pid_tgid_helper: boolWhether bpf_get_ns_current_pid_tgid helper is supported for kprobe/uprobe class programs.
Implementations§
Source§impl KernelCapabilities
impl KernelCapabilities
Sourcepub fn detect_for_startup(
force_perf_event_array: bool,
) -> Result<&'static Self, KernelCapabilityError>
pub fn detect_for_startup( force_perf_event_array: bool, ) -> Result<&'static Self, KernelCapabilityError>
Detect kernel capabilities for process startup, including startup-oriented logs and user-facing error context.
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)
Sourcepub fn ns_current_pid_tgid_helper_supported() -> bool
pub fn ns_current_pid_tgid_helper_supported() -> bool
Check if bpf_get_ns_current_pid_tgid helper is supported.
Trait Implementations§
Source§impl Clone for KernelCapabilities
impl Clone for KernelCapabilities
Source§fn clone(&self) -> KernelCapabilities
fn clone(&self) -> KernelCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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 UnsafeUnpin 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
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>
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>
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