1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(cli/bench): look for clone3 syscalls for thread count (#18456)

This commit is contained in:
Divy Srivastava 2023-03-27 20:15:00 +05:30 committed by GitHub
parent 357bcfcf79
commit 9ebce6e725
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);