I have a program that should be CPU bound, but it is using well less than 100% CPU, and is not consuming input as fast as it can. It means my process is blocking or sleeping somewhere.
How to find what calls are blocking my process for the most time? Is there a tool or debugging procedure that measures the time how much time the process is asleep on each blocking system call?