Skip to content

Commit

Permalink
fix(cli/bench): look for clone3 syscalls for thread count (denoland#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Mar 27, 2023
1 parent 357bcfc commit 9ebce6e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/bench/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,14 @@ async fn main() -> Result<()> {
file.as_file_mut().read_to_string(&mut output)?;

let strace_result = test_util::parse_strace_output(&output);
let clone = strace_result.get("clone").map(|d| d.calls).unwrap_or(0) + 1;
let clone =
strace_result
.get("clone")
.map(|d| d.calls)
.unwrap_or_else(|| {
strace_result.get("clone3").map(|d| d.calls).unwrap_or(0)
})
+ 1;
let total = strace_result.get("total").unwrap().calls;
thread_count.insert(name.to_string(), clone as i64);
syscall_count.insert(name.to_string(), total as i64);
Expand Down

0 comments on commit 9ebce6e

Please sign in to comment.