Skip to content

Commit 80567bf

Browse files
committed
update perf-event-open-sys to perf-event-open-sys2
1 parent 730aa7e commit 80567bf

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ measureme_10 = { version = "10.1.3", package = "measureme" }
3232
memchr = "2"
3333
memmap2 = "0.2.1"
3434
parking_lot = "0.12.0"
35-
perf-event-open-sys = "3.0.0"
35+
perf-event-open-sys2 = "5.0.6"
3636
prettytable-rs = "0.10"
3737
rustc-hash = "1.0.1"
3838
serde = { version = "1.0", features = ["derive"] }

measureme/Cargo.toml

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

1919
[target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dependencies]
2020
memmap2.workspace = true
21-
perf-event-open-sys.workspace = true
21+
perf-event-open-sys2.workspace = true

measureme/src/counters.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,10 @@ mod hw {
349349
type_: perf_type_id,
350350
hw_id: u32,
351351
) -> Result<Self, Box<dyn Error + Send + Sync>> {
352-
let mut attrs = perf_event_attr {
353-
size: mem::size_of::<perf_event_attr>().try_into().unwrap(),
354-
type_,
355-
config: hw_id.into(),
356-
..perf_event_attr::default()
357-
};
352+
let mut attrs = perf_event_attr::default();
353+
attrs.size = mem::size_of::<perf_event_attr>().try_into().unwrap();
354+
attrs.type_ = type_;
355+
attrs.config = hw_id.into();
358356

359357
// Only record same-thread, any CPUs, and only userspace (no kernel/hypervisor).
360358
// NOTE(eddyb) `pid = 0`, despite talking about "process id", means

0 commit comments

Comments
 (0)