Skip to content

Commit

Permalink
update perf-event-open-sys to perf-event-open-sys2
Browse files Browse the repository at this point in the history
  • Loading branch information
LuuuXXX committed Nov 21, 2024
1 parent 730aa7e commit 80567bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ measureme_10 = { version = "10.1.3", package = "measureme" }
memchr = "2"
memmap2 = "0.2.1"
parking_lot = "0.12.0"
perf-event-open-sys = "3.0.0"
perf-event-open-sys2 = "5.0.6"
prettytable-rs = "0.10"
rustc-hash = "1.0.1"
serde = { version = "1.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion measureme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ nightly = []

[target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dependencies]
memmap2.workspace = true
perf-event-open-sys.workspace = true
perf-event-open-sys2.workspace = true
10 changes: 4 additions & 6 deletions measureme/src/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,10 @@ mod hw {
type_: perf_type_id,
hw_id: u32,
) -> Result<Self, Box<dyn Error + Send + Sync>> {
let mut attrs = perf_event_attr {
size: mem::size_of::<perf_event_attr>().try_into().unwrap(),
type_,
config: hw_id.into(),
..perf_event_attr::default()
};
let mut attrs = perf_event_attr::default();
attrs.size = mem::size_of::<perf_event_attr>().try_into().unwrap();
attrs.type_ = type_;
attrs.config = hw_id.into();

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

0 comments on commit 80567bf

Please sign in to comment.