Skip to content

Commit 4adb48d

Browse files
committed
Update perf-event-open-sys to 3.0.0.
1 parent 93ee6da commit 4adb48d

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

measureme/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ nightly = []
2323

2424
[target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dependencies]
2525
memmap2 = "0.2.1"
26-
perf-event-open-sys = "1.0.1"
26+
perf-event-open-sys = "3.0.0"

measureme/src/counters.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,10 @@ mod hw {
321321
counter_type: super::HwCounterType,
322322
) -> Result<Self, Box<dyn Error + Send + Sync>> {
323323
let (type_, hw_id) = match counter_type {
324-
super::HwCounterType::Instructions => (
325-
perf_type_id_PERF_TYPE_HARDWARE,
326-
perf_hw_id_PERF_COUNT_HW_INSTRUCTIONS,
327-
),
328-
super::HwCounterType::Irqs => {
329-
(perf_type_id_PERF_TYPE_RAW, model.irqs_counter_config()?)
324+
super::HwCounterType::Instructions => {
325+
(PERF_TYPE_HARDWARE, PERF_COUNT_HW_INSTRUCTIONS)
330326
}
327+
super::HwCounterType::Irqs => (PERF_TYPE_RAW, model.irqs_counter_config()?),
331328
super::HwCounterType::Raw0420 => {
332329
match model {
333330
CpuModel::Amd(AmdGen::Zen) => {}
@@ -338,7 +335,7 @@ mod hw {
338335
),
339336
}
340337

341-
(perf_type_id_PERF_TYPE_RAW, 0x04_20)
338+
(PERF_TYPE_RAW, 0x04_20)
342339
}
343340
};
344341
Self::with_type_and_hw_id(type_, hw_id)
@@ -792,7 +789,7 @@ mod hw {
792789
// which only reliably remains `0` when `SpecLockMap` is disabled.
793790
if matches!(gen, Zen | UnknownMaybeZenLike) {
794791
if let Ok(spec_lock_map_commit) =
795-
Counter::with_type_and_hw_id(perf_type_id_PERF_TYPE_RAW, 0x08_25)
792+
Counter::with_type_and_hw_id(PERF_TYPE_RAW, 0x08_25)
796793
{
797794
use super::HwCounterRead;
798795

0 commit comments

Comments
 (0)