The Call Graph view provides you with a visual representation of your code hierarchy, laying out each function according to where it is called and using arrows to connect calling functions. The direction of the arrow indicates which function was the calling function. An arrow pointing to a function tells you that function is the callee and the function from which the line originates is the calling function. This topic describes the layout of the Call Graph in more depth, providing a quick overview of how the hierarchy is built and what the bullets to the right and left of the functions represent.
The hierarchy of functions, as presented in the Call Graph view, is built based on the call chains sampled during execution.
The Call Graph view depends on call stack unwinding, an option you can set using the Capture Options dailog box. For more information on call stack unwinding, see Capture options.
The originating function is placed in the far left column and functions it calls are placed in the column to its right. Functions that these functions call are placed in a column to the right of that and so on down the line, until all of the functions have been placed. There is a caveat to this placing behavior. If a function is called at multiple levels of the hierarchy, it is placed as far left as possible in the Call Graph view.
To illustrate, if the function
a which in turn calls function
it looks like this:
If, in addition to function
put in a higher place in the hierarchy, nearer to main, it might
look like this:
The Call Graph view presents a simple call hierarchy, but real-world algorithms describe hierarchies far more complex than those shown in the figures. Rather than present the Call Graph view with all of these connections visually represented as a spider web of call arrows, the Call Graph view uses a simple method to determine whether or not to draw a call line.
In cases where the calling function is in the same column or in a column to the left or right of the called function, a call arrow is drawn from the caller to the callee. If, however, the called function appears in a column more than one column to the left of the calling function, a bullet is added to the left of the calling function and to the right of the called function. The number contained in the bullet represents how many calling or called functions the bullet represents.
Right-click on a caller or callee bullet to see all of the functions contained in it. Choose a function in the contextual menu to select and center that function in the Call Graph view. In this way, all of the calling and called functions are still easily accessible, but call arrows are not used to cross many layers of the hierarchy.
In the bottom left hand corner of the Call Graph view is a mini-map that can be used to easily navigate around the Call Graph view when the hierarchy is too large to fit in the editor section of Eclipse.
When inside the mini-map, but outside the draggable view area, the cursor changes into a crosshair. Click on a location in the mini-map to center on that section. If you hover over the draggable area box within the mini-map, the cursor changes into a hand that enables you to click and drag the view area. Panning the view area in this way enables you to quickly scan sections of the hierarchy without using the scroll bars.
The objects in the mini-map have the same color coding as the functions in the Call Graph view itself. The bright red function in the hierarchy appears as bright red in the mini-map so that you can use the mini-map to quickly zoom to a bottleneck. Selected functions appear dark blue in the mini-map.
You can hide the mini-map by using the Hide Mini-map button, located to the left of the drop-down menu in the toolbar.
The Call Graph view color codes the functions according to total samples so the critical functions are quickly identifiable in the Call Graph view. These colors range from bright red to light yellow, red being the highest value, light yellow the lowest. These colors are easily identifiable in the mini-map so you can scroll quickly to the critical functions.
Left-clicking on any function in the hierarchy selects it. In addition to coloring the rectangle dark blue, it changes the color of all of the arrows from gray to black, clearly showing you to what functions the selection function is connected.
Selecting a function also changes any connected caller or callee bullets from gray to black.