pub struct PerfCounter {
pub instructions_retired: u64,
pub cache_misses: u64,
pub branch_mispredictions: u64,
pub context_switches: u64,
pub cycles: u64,
}Expand description
Simulated hardware performance counter.
Fields§
§instructions_retired: u64Instructions retired (simulated).
cache_misses: u64Cache misses (simulated).
branch_mispredictions: u64Branch mispredictions (simulated).
context_switches: u64Context switches (simulated).
cycles: u64Cycles elapsed (simulated).
Implementations§
Source§impl PerfCounter
impl PerfCounter
Sourcepub fn simulate_instructions(&mut self, n: u64)
pub fn simulate_instructions(&mut self, n: u64)
Simulate a number of instructions.
Sourcepub fn simulate_cache_miss(&mut self)
pub fn simulate_cache_miss(&mut self)
Simulate a cache miss.
Sourcepub fn simulate_branch_misprediction(&mut self)
pub fn simulate_branch_misprediction(&mut self)
Simulate a branch misprediction.
Sourcepub fn cache_miss_rate_per_1k(&self) -> f64
pub fn cache_miss_rate_per_1k(&self) -> f64
Cache miss rate per 1000 instructions.
Trait Implementations§
Source§impl Clone for PerfCounter
impl Clone for PerfCounter
Source§fn clone(&self) -> PerfCounter
fn clone(&self) -> PerfCounter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PerfCounter
impl Debug for PerfCounter
Source§impl Default for PerfCounter
impl Default for PerfCounter
Source§fn default() -> PerfCounter
fn default() -> PerfCounter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PerfCounter
impl RefUnwindSafe for PerfCounter
impl Send for PerfCounter
impl Sync for PerfCounter
impl Unpin for PerfCounter
impl UnsafeUnpin for PerfCounter
impl UnwindSafe for PerfCounter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more