Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: Profiller f...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 4582 of 4774
Post > Topic >>

Re: Profiller for Linux

by gpderetta <spamtrap@[EMAIL PROTECTED] > Mar 24, 2008 at 04:24 PM

On 24 Mar, 12:34, Noob <r...@[EMAIL PROTECTED]
> wrote:
> 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
>

Well, valgrind doesn't compute profiling information by timing each
instruction as executed by the actual cpu, but it fully emulates a
virtual cpu, cache included. This cpu is completely dedicated to the
execution of the profiled program, the profiler doesn't run inside it,
so it can't influence the results: for example, cache misses are
computed as seen from the virtual cache, not the real cache. This is
where the 30x cost comes from.

Of course what you get is not the profile of the program running on
the real cpu, but rather on the virtual cpu. There are differences in
fact: in the assence of cache misses, the cost of every instruction
is, IIRC, always a single clock cycle: a simple sum will be shown to
cost as much as a long latency division. Also there is no branch
prediciton emulation. Differences in instruction cost are only due to
cache miss extimation. Still what you get is a very precise idea of
what are the most executed modules, functions and even instrucitons in
your program.

Also you can play with the cache settings and even profile your
program as if it where running on a different cpu than your actual
machine.

--
gpd
 




 8 Posts in Topic:
Profiller for Linux
LinuxAsm <spamtrap@[E  2008-03-19 07:57:47 
Re: Profiller for Linux
Robert Redelmeier <red  2008-03-19 20:35:36 
Re: Profiller for Linux
Phil Carmody <thefatph  2008-03-19 22:05:43 
Re: Profiller for Linux
Juergen Beisert <spam  2008-03-20 19:42:08 
Re: Profiller for Linux
Noob <root@[EMAIL PROT  2008-03-20 10:08:06 
Re: Profiller for Linux
gpderetta <spamtrap@[  2008-03-21 12:30:49 
Re: Profiller for Linux
Noob <root@[EMAIL PROT  2008-03-24 12:34:13 
Re: Profiller for Linux
gpderetta <spamtrap@[  2008-03-24 16:24:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 7:04:16 CDT 2008.