Features

Struct Features 

Source
pub struct Features { /* private fields */ }
Expand description

Features implements BPF and BTF feature detection

Implementations§

Source§

impl Features

Source

pub fn bpf_name(&self) -> bool

Returns whether BPF program names and map names are supported.

Although the feature probe performs the check for program name, we can use this to also detect if map name is supported since they were both introduced in the same commit.

Source

pub fn bpf_probe_read_kernel(&self) -> bool

Returns whether the bpf_probe_read_kernel helper is supported.

Returns whether bpf_links are supported for Kprobes/Uprobes/Tracepoints.

Source

pub fn bpf_global_data(&self) -> bool

Returns whether BPF program global data is supported.

Returns whether BPF program cookie is supported.

Source

pub fn cpumap_prog_id(&self) -> bool

Returns whether XDP CPU Maps support chained program IDs.

Source

pub fn devmap_prog_id(&self) -> bool

Returns whether XDP Device Maps support chained program IDs.

Source

pub fn prog_info_map_ids(&self) -> bool

Returns whether bpf_prog_info supports nr_map_ids & map_ids fields.

Source

pub fn prog_info_gpl_compatible(&self) -> bool

Returns whether bpf_prog_info supports gpl_compatible field.

Source

pub fn btf(&self) -> Option<&BtfFeatures>

If BTF is supported, returns which BTF features are supported.

Trait Implementations§

Source§

impl Debug for Features

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Features

Source§

fn default() -> Features

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.