From 7c6ef812674f3285340fc67643284d3a65cfc7eb Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 27 Mar 2023 20:15:00 +0530 Subject: [PATCH] fix(cli/bench): look for clone3 syscalls for thread count (#18456) --- cli/bench/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/bench/main.rs b/cli/bench/main.rs index 02c775e8fb5495..48598a9b0b20b4 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -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);