Skip to content

Commit

Permalink
Use get_online_cpus() in right context
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarler committed May 10, 2024
1 parent 5afd876 commit 460813b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ impl Profiler<'_> {

pub fn setup_perf_events(&mut self) {
let mut prog_fds = Vec::new();
for i in 0..get_online_cpus().expect("get online CPUs") {
for i in get_online_cpus().expect("get online CPUs") {
let perf_fd =
unsafe { setup_perf_event(i.try_into().unwrap(), self.sample_freq as u64) }
.expect("setup perf event");
Expand Down

0 comments on commit 460813b

Please sign in to comment.