by Noob <root@[EMAIL PROTECTED]
>
Mar 24, 2008 at 12:34 PM
gpderetta wrote:
> Noob wrote:
>
>> LinuxAsm wrote:
>>
>>> Does anyone know of a good code profiler for Linux?
>>
>> I recommend oprofile over gprof.
>> http://oprofile.sourceforge.net/about/
>
> Valgrind is extremely good for doing both source level
> and assembler level profiling (you get execution count
> for every single instruction!).
>
> It also does cache (both data and instruction) and memory
> allocation profiling.
>
> Kcachegrind is the perfect companion for examining and
> navigating valgrind output.
>
> The downside of valgrind is that your program will run very
> slowly (even 30x) when profiling. But I have found it incomparably
> more useful than gprof. I have no experience with oprofile.
If a profiler is too intrusive (high overhead) then it is not profiling
the application, but the combination of the application AND the profiler
itself. The impact of cache misses will be incorrectly re****ted because
the timing is different, and the profiler itself will induce extraneous
data and cache misses.
cf. http://en.wikipedia.org/wiki/Observer_effect
Regards.