Note that there are some explanatory texts on larger screens.

plurals
  1. POLinux time sample based profiler
    text
    copied!<p><strong>short version:</strong></p> <p>Is there a good time based sampling profiler for Linux?</p> <p><strong>long version:</strong></p> <p>I generally use <a href="http://oprofile.sourceforge.net/about/" rel="nofollow noreferrer">OProfile</a> to optimize my applications. I recently found a shortcoming that has me wondering.</p> <p>The problem was a tight loop, spawning c++filt to demangle a c++ name. I only stumbled upon the code by accident while chasing down another bottleneck. The OProfile didn't show anything unusual about the code so I almost ignored it but my code sense told me to optimize the call and see what happened. I changed the <code>popen</code> of c++filt to <code>abi::__cxa_demangle</code>. The runtime went from more than a minute to a little over a second. About a x60 speed up. </p> <p>Is there a way I could have configured OProfile to flag the <code>popen</code> call? As the profile data sits now OProfile thinks the bottle neck was the heap and <code>std::string</code> calls (which BTW once optimized dropped the runtime to less than a second, more than x2 speed up).</p> <p>Here is my OProfile configuration:</p> <pre><code>$ sudo opcontrol --status Daemon not running Event 0: CPU_CLK_UNHALTED:90000:0:1:1 Separate options: library vmlinux file: none Image filter: /path/to/executable Call-graph depth: 7 Buffer size: 65536 </code></pre> <p>Is there another profiler for Linux that could have found the bottleneck?</p> <p>I suspect the issue is that OProfile only logs its samples to the currently running process. I'd like it to always log its samples to the process I'm profiling. So if the process is currently switched out (blocking on IO or a <code>popen</code> call) OProfile would just place its sample at the blocked call.</p> <p>If I can't fix this, OProfile will only be useful when the executable is pushing near 100% CPU. It can't help with executables that have inefficient blocking calls.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload