|
From: Michael.Schmidt@L-3com.com - 2008-06-30 20:22:21
|
Hello, I have questions about "Show Absolute Costs" and "Show Relative Costs". I apologize if this information is documented somewhere, but I couldn't find it. Suppose I am visualizing method A's Call Graph, and A calls method B. Does "Show Absolute Costs" display the total program runtime spent in B? Does "Show Relative Costs" display the percentage of time that A spends calling B? How are the relative times computed? Does each each link contain a weight, and the tree is traversed to get a total relative percentage? Thanks, Mike |
|
From: Josef W. <Jos...@gm...> - 2008-07-01 14:22:04
|
On Monday 30 June 2008, Mic...@l-... wrote: > Suppose I am visualizing method A's Call Graph, and A calls method B. Does "Show Absolute Costs" display the total program runtime spent in B? No. The general idea is this: For any function shown in the callgraph around function X (ie. function X is visualized/activated), only that part of inclusive cost is shown which is also part of X's inclusive cost. This holds true both for callers and callees of X. "Absolute" is in contrast to "relative", and does not say anything about "total". Thus, only that cost of B is shown while function A was above on the call stack. If B also was called from another function, the allover runtime of B probably is higher. This should be documented in the "What's this" help of the call graph in KCachegrind (Press Shift+F1 and the call graph view). Actually, this context sensitive help is quite extensive. > Does "Show Relative Costs" display the percentage of time that A spends calling B? Yes (apart from the fact that callgrind can not simulate accurte "time"). You also want to switch on "Percentage relative to Parent"; otherwise, all costs are given relative to the total program cost. > How are the relative times computed? In your case, with A being visualized and calling B, nothing is calculated. The shown value on B is exactly the "cost spent over the call arc A => B", and this is directly measured by callgrind (I assume here that there is no function C with A => C => B). > Does each each link contain a weight, and the tree is traversed to get a total relative percentage? No. Callgrind actually measures the cost spent on a link/call arc. So for all the call arcs going into and out of the currently visualized/active function, the values are precise. For indirectly calling/called function in respect to the active function, the values are estimated (as they are not separately measured). Josef |