Skip to content

Commit

Permalink
fix(bench): Include clone3 in thread count
Browse files Browse the repository at this point in the history
It's a newer syscall interface and gets counted seperately in strace results.
  • Loading branch information
Beanow committed Dec 9, 2022
1 parent eaf0d71 commit 3f1f37d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tooling/bench/src/run_benchmark.rs
Expand Up @@ -64,7 +64,10 @@ fn run_strace_benchmarks(new_data: &mut utils::BenchResult) -> Result<()> {
file.as_file_mut().read_to_string(&mut output)?;

let strace_result = utils::parse_strace_output(&output);
let clone = strace_result.get("clone").map(|d| d.calls).unwrap_or(0) + 1;
// Note, we always have 1 thread. Use cloneX calls as counter for additional threads created.
let clone = 1
+ strace_result.get("clone").map(|d| d.calls).unwrap_or(0)
+ strace_result.get("clone3").map(|d| d.calls).unwrap_or(0);
let total = strace_result.get("total").unwrap().calls;
thread_count.insert(name.to_string(), clone);
syscall_count.insert(name.to_string(), total);
Expand Down

0 comments on commit 3f1f37d

Please sign in to comment.