Struct bcc::PerfEventArray [−][src]
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]
fn default() -> PerfEventArray
[src]
Auto Trait Implementations
impl RefUnwindSafe for PerfEventArray
impl Send for PerfEventArray
impl Sync for PerfEventArray
impl Unpin for PerfEventArray
impl UnwindSafe for PerfEventArray
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,