Even if gprof worked, it probably won't help.
The method I rely on for any language and OS is random suspension .
Here's how it works. If you take multiple samples of random time on the stack, wasteful function calls or I / O appear proportionally to the part of the time that they spend. This has the advantage that problematic statements are precisely defined, as opposed to hunting in expensive procedures.
Mike dunlavey
source share