I often want to know why a process in the middle of a pipeline is sleeping and not busy processing data. My current method is:
- find the
sudo strace -pt pidto get the blocking syscall and object (fd, child, futex, etc.)
- hit Ctrlc to detach strace
- look up the appropriate object in
grep /proc/or use
lsofto find the other end of the pipe or process being waited on
- repeat from #1 with the new
This is a pretty slow process that combines a lot of tools that don't play well together (
strace in particular is hard to automate). Is there a tool that will do this loop for me and plot out the wait chain of a process, or at least make one iteration less awkward?
Linux 3.2, Ubuntu LTS 12, x64, under VirtualBox, if it matters.