Just some followup...

On Tuesday 30 August 2011, Christoph Schwarz wrote:
> On 30/08/2011 3:50 AM, WAROQUIERS Philippe wrote:
> >> However, the cost seems to include overhead from valgrind itself, such
> >> as malloc&  other hooks.
...
> > Are you sure these hooks are from valgrind ?
...
> Probably not. I now believe that all those unwanted calls are to blame 
> on the C library and dynamic loader.

This has nothing to do with Valgrind/Callgrind. For every binary using shared
libs, relocation/resolving of symbols has to be done at some point in time,
and with the calls to _dl_* you see what this involves (e.g. calls to 
runtime_resolve
for lazy binding of functions from shared libs).

But this is nothing really "unwanted", and this cost should be visible with
every profiling tool. However, often, the overhead is neglectable, unless
you have a huge number of relocations to do. And yes, linking statically is
often the right solution (but not really feasable to do with every KDE/GNOME
binary).

Josef

> There were many unwanted calls to 
> functions like '_dl_runtime_resolve', '_dl_addr' and the like. Looking 
> at my call graph again, 'malloc_hook_ini' calls 'ptmalloc_init' which 
> calls '_dl_addr', and the cost of 60,000 Ir is due to '_dl_addr'.
> 
> I solved all those problems by using static linkage.
> 
> Chris
> 
> 
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better 
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
> 



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to