|
From: Prashant K S <ks...@gm...> - 2008-04-09 09:43:39
|
Hi,
I am trying to use the callgrind tool. I am using the option --instr-atstart=no
so that instrumentation does not start at beginning. At some point I switch
the instrumentation on by calling callgrind_control -i on. So I assume the
instrumentation starts at this point. Now I interrupt my process and there
by killing it. Now a dump callgrind.out.1424 is generated. I run
callgrind_annotate --inclusive=yes callgrind.out.1424 >out.txt. Now the
out.txt has the out put in the below format. There are function names after
??? on each line. I have removed the name because of proprietory information
reason. If you can see the PROGRAM TOTALS value is less than the indvidual
functions. I didn't understand this representation. Can you please explain.
Also if there is a function by name A::func(), in some lines it is printed
as A::func()'2. What does the '2 indicate?
Regards,
Prashant
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.1424' (creator: callgrind-3.3.0)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
L2 cache:
Timerange: Basic block 0 - 9610908
Trigger: Program termination
Profiled target: process name with args(PID 1424, part 1)
Events recorded: Ir
Events shown: Ir
Event sort order: Ir
Thresholds: 99
Include dirs:
User annotated:
Auto-annotation: off
--------------------------------------------------------------------------------
Ir
--------------------------------------------------------------------------------
55,319,754 PROGRAM TOTALS
--------------------------------------------------------------------------------
Ir file:function
--------------------------------------------------------------------------------
110,633,950 ???:
110,600,478 ???:
109,597,596 ???:
65,273,219 ???:
55,317,147 ???:
55,316,595 ???:
54,451,919 ???:
54,446,777 ???:
50,481,955 ???:
48,717,035 ???:
48,714,091 ???:
48,309,314 ???:
48,307,034 ???:
45,603,233 ???:
45,599,050 ???:
45,522,180 ???:
45,422,355 ???:
25,867,267 ???:
24,022,839 ???:
20,481,756 ???:
17,996,392 ???:
16,789,430 ???:
15,539,320 ???:
13,684,120 ???:
13,615,214 ???:
12,092,398 ???:
12,090,770 ???:
11,268,782 ???:
9,567,567 ???:
9,566,169 ???:
9,507,190 ???:
9,299,070 ???:
8,813,507 ???:
8,787,293 ???:
7,805,162 ???:
6,443,845 ???:
5,251,893 ???:
5,247,271 ???:
4,977,293 ???:
4,914,519 ???:
4,826,971 ???:
4,688,683 ???:
4,684,039 ???:
4,571,908 ???:
4,568,905 ???:
4,385,765 ???:
4,295,475 ???:
4,220,146 ???:
4,147,336 ???:
4,062,689 ???:
4,014,449 ???:
3,671,449 ???:
3,591,933 ???:
3,548,294 ???:
3,467,962 ???:
3,464,919 ???:
3,375,023 ???:
3,296,902 ???:
3,270,883 ???:
3,194,663 ???:
3,188,035 ???:
3,186,651 ???:
3,150,789 ???:
3,137,166 ???:
3,072,942 ???:
2,981,427 ???:
2,934,276 ???:
2,696,537 ???:
2,624,329 ???:
2,623,898 ???:
2,611,841 ???:
2,588,039 ???:
2,512,174 ???:
2,487,714 ???:
2,373,992 ???:
2,328,047 ???:
2,312,723 ???:
2,311,032 ???:
2,269,224 ???:
2,237,006 ???:
2,232,487 ???:
2,228,546 ???:
2,208,000 ???:
2,191,573 ???:
2,181,806 ???:
2,139,270 ???:
2,084,422 ???:
2,067,134 ???:
2,059,064 ???:
2,026,768 ???:
2,003,622 ???:
1,970,744 ???:
1,967,608 ???:
1,955,486 ???:
1,940,001 ???:
1,934,295 ???:
1,826,497 ???:
1,811,127 ???:
1,810,326 ???:
1,809,958 ???:
1,758,136 ???:
1,735,937 ???:
1,658,495 ???:
1,586,599 ???:
1,551,344 ???:
1,493,343 ???:
1,363,885 ???:
1,304,232 ???:
1,122,932 ???:
1,075,669 ???:
928,566 ???:
921,776 ???:
912,679 /hom
884,737 ???:
884,683 ???:
882,208 /hom
861,894 /hom
780,265 ???:
725,004 ???:
704,030 ???:
701,150 ???:
622,112 ???:
604,368 ???:
583,746 ???:
574,951 ???:
573,478 ???:
563,164 ???:
560,842 ???:
555,662 ???:
526,627 ???:
|
|
From: Josef W. <Jos...@gm...> - 2008-04-09 16:08:12
|
On Wednesday 09 April 2008, Prashant K S wrote: > reason. If you can see the PROGRAM TOTALS value is less than the indvidual > functions. I didn't understand this representation. It would be appropriate for callgrind_annotate to check for this and put out a warning like this (however, this should at least be mentioned in the manual). "WARNING: Some inclusive cost collected by callgrind for your program is more than 100% of the total cost. This indicates that there are recursive function cycles executed in your code which screw up inclusive cost collection. For correct output, a cycle detection post-processing needs to be done, which currently is not implemented in callgrind_annotate. Please use KCachegrind, which handles this case correctly. Also, check the manual chapter about cycle avoidance approaches available in Callgrind." > Can you please explain. > Also if there is a function by name A::func(), in some lines it is printed > as A::func()'2. What does the '2 indicate? Callgrind can distinguish recursion levels up to a given level. The default is 2 (to not exhaust memory), which means that function'2 contains all the cost happening at any recursion of function with level >= 2. The existance of such a function also explains the inclusive cost>100% in your case. You can raise this value e.g. by using "--separate-recs=20", which potentially gets rid of any cycles and then, gives correct inclusive cost. Josef > > Regards, > Prashant > |
|
From: Prashant K S <ks...@gm...> - 2008-04-09 16:21:41
|
Thanks a lot. This is indeed the case. On 4/9/08, Josef Weidendorfer <Jos...@gm...> wrote: > > On Wednesday 09 April 2008, Prashant K S wrote: > > reason. If you can see the PROGRAM TOTALS value is less than the > indvidual > > functions. I didn't understand this representation. > > It would be appropriate for callgrind_annotate to check for this and > put out a warning like this (however, this should at least be mentioned > in the manual). > > "WARNING: > Some inclusive cost collected by callgrind for your program is more than > 100% of the total cost. This indicates that there are recursive function > cycles executed in your code which screw up inclusive cost collection. For > correct output, a cycle detection post-processing needs to be done, which > currently is not implemented in callgrind_annotate. > Please use KCachegrind, which handles this case correctly. Also, check the > manual chapter about cycle avoidance approaches available in Callgrind." > > > Can you please explain. > > Also if there is a function by name A::func(), in some lines it is > printed > > as A::func()'2. What does the '2 indicate? > > Callgrind can distinguish recursion levels up to a given level. The > default > is 2 (to not exhaust memory), which means that function'2 contains all the > cost > happening at any recursion of function with level >= 2. The existance of > such > a function also explains the inclusive cost>100% in your case. > You can raise this value e.g. by using "--separate-recs=20", which > potentially > gets rid of any cycles and then, gives correct inclusive cost. > > Josef > > > > > Regards, > > Prashant > > > |