From Farid Zakaria’s Blog · Farid Zakaria · · 2m
Worshipping at the altar of Brendan Gregg
Rewind's new time command analyzes build performance by tracing asleep threads to Brendan Gregg's flame graphs.
In brief
Rewind's new time command analyzes build performance by tracing asleep threads to Brendan Gregg's flame graphs. Rewind's time command shows libuv build takes 47.4 seconds with 67% asleep time, using Gregg's off-CPU analysis. Originally reported by Farid Zakaria’s Blog.
Quick answers
- What is the critical path?
- The critical path is the longest chain of dependent work in a program. It is the minimum time the program can take to complete regardless of resources.
- What is the key takeaway from Worshipping at the altar of Brendan Gregg?
- Rewind's time command shows libuv build takes 47.4 seconds with 67% asleep time, using Gregg's off-CPU analysis.
What is the critical path?
The critical path is the longest chain of dependent work in a program. It is the minimum time the program can take to complete regardless of resources.
Rewind's time command
Rewind's new time command analyzes recordings to show where time went and what would make a run finish sooner.
Brendan Gregg's influence

All ideas for the command are inspired by or directly influenced by Brendan Gregg's work on performance analysis.
Libuv build analysis
The libuv build takes 78 seconds on one CPU with 47.4 seconds critical path and 67% asleep time.
Asleep time breakdown
23.1 seconds in epoll_pwait, 8.53 seconds in clock_nanosleep, and 100 ms in futex.
Critical path by phase

3.54 seconds configurePhase, 1.67 seconds buildPhase, 42.0 seconds checkPhase.
Critical path by process
The build starts with init, then make, then lt-run-tests, with 287 tests running sequentially.
Drag analysis
Each test spends 1-3 seconds, with 75 sleeps in clock_nanosleep and 2 sleeps in epoll_pwait.
The hrtime test

The hrtime test spends 3.38 seconds asleep in clock_nanosleep with 75 sleeps per test.
Source line analysis
The test calls uv_sleep(45) from line 39 of test/test-hrtime.c, sleeping for 45 milliseconds.
Rewind's advantage
Rewind records every context switch and wakeup, enabling off-CPU analysis without tracing.
Brendan Gregg's legacy

Gregg has been drawing off-CPU flame graphs for over a decade, with build systems reporting critical path information longer.
Rewind's impact
Rewind enables precise performance analysis by replaying builds to pinpoint sleep causes.
The future of analysis
Rewind's time command shows how to optimize builds by reducing asleep time through targeted fixes.
What to remember
Rewind's time command shows libuv build takes 47.4 seconds with 67% asleep time, using Gregg's off-CPU analysis.
Read the TL;DR — this story on one card.






