Re: [Yade-dev] Questions on profiling

2009-07-07 Thread Václav Šmilauer


1. How comes valgrind/kcachegrind is not removing the time for mcount 
from results? It would make sense.
See answer to 2. mcount() and -p is orthogonal to valgrind profiling 
technique.
2. Why could I profile for years without option -p and I could get 
(apparently) consistent results?
Valgrind uses different profiling technique (dynamic code 
translation/instrumentation), whereas profiling with -p inserts special 
call at the beginning (and end, I assume) of every function at compile 
time. -p is used if compiling with profile=1. Valgrind does not need 
recompilation.


Vaclav

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] Questions on profiling

2009-07-07 Thread Bruno Chareyre
I can confirm that yade is about 30% faster when profiling is disabled, 
and that callgring still give similar results (except that it is a lot 
more readable since you don't have to mentaly remove time spent in 
mcount). No debug symbols needed either.


Bruno



Bruno Chareyre a écrit :

I just ran a profiling job, and I have a questionning result.

45% of cpu time is used for the function mcount from libc.

According to some googling :

gcc inserts calls to mcount() at the start and end of functions if 
profiling (-p) is enabled.


That is good, it seems this operation will not take time if profiling 
is disabled (and it takes so much time because of function calls like 
iterator++ or body::byId(i)).


But then I have two questions in mind :
1. How comes valgrind/kcachegrind is not removing the time for mcount 
from results? It would make sense.
2. Why could I profile for years without option -p and I could get 
(apparently) consistent results?


Just asking in case somebody knows the answer already.

Bruno




--

___
Chareyre Bruno
Maitre de conference

Grenoble INP
Laboratoire 3SR - bureau E145
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp