Criterion-perf-events
This is a measurement plugin for Criterion.rs to measure events of the Linux perf interface.
Supported Events
Criterion-perf-events uses the perfcnt
crate and supports events provided by this crate. If you are interested in more details, please take a look at the events listed here:
Troubleshooting
If you get a "Permission denied" error, update perf_event_paranoid
:
sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'
For further details please take a look at the following link.
Example
The following code shows how to count retired instructions.
use ;
use Perf;
use HardwareEventType as Hardware;
use PerfCounterBuilderLinux as Builder;
criterion_group!;
criterion_main!;
run with:
cargo criterion
Open target/criterion/reports/index.html
to view detailed results with plots.
For all event types (Hardware::Instructions
, Hardware::CacheMisses
...) criterion will always report cycles as the unit.
Note that your event type is what is being shown, not CPU cycles.