Struct bcc::perf_event::PerfEvent [−][src]
Implementations
impl PerfEvent
[src]
A PerfEvent
is used to configure a BPF probe which instruments a hardware
or software performance event. Must be attached to be useful.
pub fn new() -> Self
[src]
Creates a new PerfEvent
with the defaults. There are several mandatory
fields which must be configured before attaching.
pub fn handler(self, name: &str) -> Self
[src]
Specify the name of the probe handler 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 sample_period(self, count: Option<u64>) -> Self
[src]
Specifies that the probe should fire after count
number of events have
been counted. Exactly one of sample_period
or sample_frequency
must
be provided.
pub fn sample_frequency(self, hz: Option<u64>) -> Self
[src]
Causes the probe to run with a frequency specified in hertz (hz)
equivalent to the number of sampling events per second. Exactly one of
sample_period
or sample_frequency
must be provided.
pub fn pid(self, pid: Option<i32>) -> Self
[src]
Restrict the scope of the probe to only a given process and its
children. If this is set to None
(the default), the probe will cover
all processes on the system.
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 group_fd(self, group_fd: Option<i32>) -> Self
[src]
This option groups sets of probes together. This will cause the multiplexing algorithm in the kernel to group the probes to be running on PMUs concurrently. Useful for grouping related probes to maintain accurate derived metrics. One example would be to schedule cycle and retired instruction probes together to calculate CPI.
pub fn attach(self, bpf: &mut BPF) -> Result<(), BccError>
[src]
Consumes the probe and attaches it. May return an error if there is a incomplete or invalid configuration or other error while loading or attaching the probe.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PerfEvent
impl Send for PerfEvent
impl Sync for PerfEvent
impl Unpin for PerfEvent
impl UnwindSafe for PerfEvent
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>,