MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / wrap_with_hook

Function wrap_with_hook

src/executor/wall_time/isolation.rs:152–155  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
152fn 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///

Callers 1

wrap_benchMethod · 0.85

Calls 1

wrapMethod · 0.80

Tested by

no test coverage detected