pub struct Counter { /* private fields */ }
Expand description
A logical counter object to correspond to a physical PMC
Implementations§
source§impl Counter
impl Counter
sourcepub fn new(event: EventType) -> Result<Counter, &'static str>
pub fn new(event: EventType) -> Result<Counter, &'static str>
Creates a Counter object and assigns a physical counter for it. If it’s a general PMC, writes the UMASK and Event Code to the relevant MSR, but leaves enable bit clear.
sourcepub fn get_count_since_start(&self) -> Result<u64, &'static str>
pub fn get_count_since_start(&self) -> Result<u64, &'static str>
Allows user to get count since start without stopping/releasing the counter.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Counter
impl Send for Counter
impl Sync for Counter
impl Unpin for Counter
impl UnwindSafe for Counter
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