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<Self, KernelCapabilityError>
pub fn detect_for_startup( force_perf_event_array: bool, ) -> Result<Self, KernelCapabilityError>
Detect kernel capabilities for process startup, including startup-oriented logs and user-facing error context.
Sourcepub fn get() -> Result<Self, KernelCapabilityError>
pub fn get() -> Result<Self, KernelCapabilityError>
Get global kernel capabilities (detected once on first cacheable call) Returns an error if neither RingBuf nor PerfEventArray support can be verified.
Sourcepub fn get_perf_only() -> Result<Self, KernelCapabilityError>
pub fn get_perf_only() -> Result<Self, KernelCapabilityError>
Detect kernel capabilities with PerfEventArray-only startup semantics. This intentionally bypasses the global cache because force-perf mode is a runtime policy override, not the kernel’s complete hardware capability set.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for KernelCapabilities
Source§impl Debug for KernelCapabilities
impl Debug for KernelCapabilities
impl Eq for KernelCapabilities
Source§impl PartialEq for KernelCapabilities
impl PartialEq for KernelCapabilities
impl StructuralPartialEq 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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