Crate perfcnt

Source
Expand description

Example usage:

use perfcnt::{AbstractPerfCounter, PerfCounter};
use perfcnt::linux::{PerfCounterBuilderLinux, HardwareEventType};

let mut pc: PerfCounter =
    PerfCounterBuilderLinux::from_hardware_event(HardwareEventType::CacheMisses)
        .finish().expect("Could not create the counter");
pc.start().expect("Can not start the counter");
pc.stop().expect("Can not start the counter");
let res = pc.read().expect("Can not read the counter");
println!("Measured {} cache misses.", res);

Re-exports§

Modules§

  • A wrapper around perf_event open (http://lxr.free-electrons.com/source/tools/perf/design.txt)

Traits§