[−][src]Struct perf_event::events::Cache
A cache event.
A cache event has three identifying characteristics:
-
which cache to observe (
which
) -
what sort of request it's handling (
operation
) -
whether we want to count all cache accesses, or just misses (
result
).
For example, to measure the L1 data cache's miss rate:
// A `Cache` value representing L1 data cache read accesses. const ACCESS: Cache = Cache { which: WhichCache::L1D, operation: CacheOp::READ, result: CacheResult::ACCESS, }; // A `Cache` value representing L1 data cache read misses. const MISS: Cache = Cache { result: CacheResult::MISS, ..ACCESS }; // Construct a `Group` containing the two new counters, from which we // can get counts over matching periods of time. let mut group = Group::new()?; let access_counter = Builder::new().group(&mut group).kind(ACCESS).build()?; let miss_counter = Builder::new().group(&mut group).kind(MISS).build()?;
Fields
which: WhichCache
Which cache is being monitored? (data, instruction, ...)
operation: CacheOp
What operation is being monitored? (read, write, etc.)
result: CacheResult
All accesses, or just misses?
Trait Implementations
impl Clone for Cache
[src]
impl Debug for Cache
[src]
impl Eq for Cache
[src]
impl From<Cache> for Event
[src]
impl PartialEq<Cache> for Cache
[src]
impl StructuralEq for Cache
[src]
impl StructuralPartialEq for Cache
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,