|
From: Frank C. <fra...@gm...> - 2011-05-26 01:42:47
|
Good evening, We want to thank Josef Weindorfer and the
valgrind-users mailing list for showing how us to selectively profile
certain periods of a program's execution. Today, we used the
CALLGRIND_ZERO_STATS and CALLGRIND_DUMP_STATS in our C++ source code
to selectively profile our program.
Now, we are trying to learn how to interpret the Kachegrind
Called statistic and the callgrind_annotate IR(Instruction Register),
DR(Data Read), DW(data write) and the other associated statistics.
What we ary trying to understand is why the Kcachegrind Called
statistic for STL multiset::lower_bound is 2,161,870 while the
callgrind_annotate IR statistic for STL multiset::lower_bound is
2,511,807,993 and callgrind_annotate DR statistic for STL
multiset::lower_bound is 1,115,970,572. We were under the assumption
that the callgrind_annotate program could provide us with the number
of times a particular C++ source line was encountered during a
program's execution. Is it possible for that we are not using
callgrind_annotate correctly in order to get line counts on the
annotated source code? If that is possible, could you instruct how to
use callgrind_annotate to get most accurate line counts out of the
annotated source code? Thank you.
|
|
From: Josef W. <Jos...@gm...> - 2011-05-26 08:06:23
|
On Thursday 26 May 2011, Frank Chang wrote: > Called statistic and the callgrind_annotate IR(Instruction Register), No. Ir is "Instruction read", ie. how often the bytes of an instruction needed to be read from the instruction cache. This more or less is the number of times an instruction was executed. > DR(Data Read), DW(data write) and the other associated statistics. > What we ary trying to understand is why the Kcachegrind Called > statistic for STL multiset::lower_bound is 2,161,870 while the > callgrind_annotate IR statistic for STL multiset::lower_bound is > 2,511,807,993 and callgrind_annotate DR statistic for STL > multiset::lower_bound is 1,115,970,572. We were under the assumption > that the callgrind_annotate program could provide us with the number > of times a particular C++ source line was encountered during a > program's execution. To answer such detailed questions, you need to provide the profile data. In general: The "Called" column in the flat profile in KCachegrind shows the number of times a function was called. At the moment, this is not directly visible in callgrind_annotate. If you run "callgrind_annotate --tree=caller ...", you will see the functions calling a given function. Behind the function name, you will see the call count, e.g. "... strcmp (737x) ...". You would need to add up all call count numbers of callers. Near to sources of KCachegrind in KDE SVN (not released, but you can compile it on your own), there is a tool called "cgview", which is supposed to be a better replacement for callgrind_annotate at some point. It is in C++ and uses the same profile parser as KCachegrind. This gives you exacly the "flat profile" list of KCachegrind on the terminal. Sorting by call count e.g. is given with "cgview -c ..." Josef > Is it possible for that we are not using > callgrind_annotate correctly in order to get line counts on the > annotated source code? If that is possible, could you instruct how to > use callgrind_annotate to get most accurate line counts out of the > annotated source code? Thank you. > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |