perfcnt 0.2.0

Library to configure and read hardware performance counters in rust.
Documentation

perfcnt Build Status Crates.io

A library to program performance counters in rust.

Example library usage

let mut pc: PerfCounter = PerfCounterBuilderLinux::from_hardware_event(HardwareEventType::CacheMisses)
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);
  • See examples/ directory for more code-snippets on how-to use the library to create counters.

Documentation

Provided Programs

  • perfcnt-list: Lists all architecture specific events available on the current machine (currently only supports Intel x86).

Known limitations

  • Linux support without breakpoints and tracepoints
  • No Windows or MacOS X support
  • Missing raw AMD and ARM aarch64 events