diff options
Diffstat (limited to 'src/cli/run.zig')
| -rw-r--r-- | src/cli/run.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cli/run.zig b/src/cli/run.zig index db3529e..34455dd 100644 --- a/src/cli/run.zig +++ b/src/cli/run.zig @@ -129,6 +129,10 @@ pub fn run(init: std.process.Init, args: []const [:0]const u8) !void { // Everything pumped is recorded and read: whoever waits at it may go on. if (stops.held) session.ring.resumeAll(); stops.held = false; + // Look again for a while before sleeping: a target that finds the + // tracer asleep pays a futex wake for the event, more than the event. + var spins: usize = 0; + while (session.ring.peek() == null and spins < 2000) : (spins += 1) std.atomic.spinLoopHint(); } const ns = zt.event.now() - start; if (full) { |
