Struct bcc::PerfEventArray[][src]

pub struct PerfEventArray { /* fields omitted */ }

Implementations

impl PerfEventArray[src]

A PerfEventArray is used to configure a BPF PERF_EVENT_ARRAY such that a call `table.perf_read(CUR_CPU_IDENTIFIER) returns the hardware counter of the event on the local cpu.

pub fn new() -> Self[src]

Creates a new PerfEventArray with defaults.There are several mandatory fields which must be configured before attaching.

pub fn table(self, name: &str) -> Self[src]

Specify the name of the table within the BPF code. This is a required item.

pub fn event(self, event: Event) -> Self[src]

The Event which will cause a probe to fire, such as a hardware or software event. This is required.

pub fn cpu(self, cpu: Option<usize>) -> Self[src]

Restrict the probe to only the given hardware thread. If this is set to None (the default), a probe will be created for each hardware thread on the system to provide system-wide coverage.

pub fn attach(self, bpf: &mut BPF) -> Result<(), BccError>[src]

Consumes the perf event and opens it. May return an error if there is a incomplete or invalid configuration or other error while loading or opening the event.

Trait Implementations

impl Default for PerfEventArray[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.