My company's codebase has a unit test that takes unreasonably long (5 minutes wall clock time, 200ms cpu-time). It is not I/O bound, so it is probably sleeping/waiting somewhere. How would one go about discovering where?
- I can't do a textual search. The actual repository is huge and has legitimate reasons to sleep. I'd get too many false positives
- Profilers I tried (
perf
,valgrind
,gprof
) all seem to focus on finding functions that use a lot of cpu time, not wall clock time.
I ended up doing strace -r -k
and then looking for slow system calls, but surely there are more convenient approaches?