Wrap the benchmark with `codspeed-wrap-bench`, which moves itself onto the bench cores and `exec`s the benchmark — so the benchmark inherits the pinning while staying the same PID and a descendant of the profiler. The hook is a command wrapper: it takes the program and its arguments and `exec`s them.
(mut bench_cmd: CommandBuilder)
| 150 | /// while staying the same PID and a descendant of the profiler. The hook is a |
| 151 | /// command wrapper: it takes the program and its arguments and `exec`s them. |
| 152 | fn wrap_with_hook(mut bench_cmd: CommandBuilder) -> Result<CommandBuilder> { |
| 153 | bench_cmd.wrap(WRAP_BENCH_HOOK, [] as [&str; 0]); |
| 154 | Ok(bench_cmd) |
| 155 | } |
| 156 | |
| 157 | /// Wrap the benchmark leaf so it runs inside the systemd `codspeed.slice` scope. |
| 158 | /// |