dotTrace 2020.3 Help

Call Tree

Call Tree shows method execution paths. Each method node in the tree represents a top-level method executed by a certain thread. The method node lists methods it called and metrics collected during profiling.

Use Call Tree to:

To help you perform thorough call stack analysis, Call Tree offers the following functionality:

call tree 0 png

pos 1 png
The percentage of time spent in a call relative to the total selected time.

pos 2 png Short method name.

pos 3 png Total time spent in a call and its subtree. See details below.

pos 4 png Full method name.

How call time is calculated

For better understanding how Call Tree calculates time, consider the example.

tv plain list 2 png

Call Tree will calculate time as follows:

call tree main example png

Exploring most expensive calls

The easiest way to go through all most "performance-expensive" methods in your application is use the Next Important Call action (Ctrl + Shift + Right). This action navigates you to the next call with high own time. If such a call is not found in the current sub-tree, the action will navigate you to the next sibling of the currently selected node.

To go through most performance-expensive methods

  1. Select a method in Call Tree. This method will be your starting point.

  2. Press Ctrl + Shift + Right or choose Next Important Call in the context menu.

  3. Repeat step 2 to go through all important calls in your application.

Scoping to particular method calls

To simplify analysis of a certain execution path, you can limit the Call Tree scope to a particular method call.

To scope to a particular method call

  1. Select a method in Call Tree.

  2. Press Ctrl + Enter or choose Scope to This in the context menu.

After you open a particular method call, it becomes a root node in Call Tree. All other calls except the subtree of the selected node are hidden. This also automatically applies a filter by the selected method occurrence. See details about filtering next in this section.

For instance, if in the example above (see the picture) you decide to scope to the UserMethod2 call (marked as B), Call Tree will look like and calculate time as follows:

call tree example scope1 png

If a method was called from a number of places, you can merge all method call occurrences within one page.

To merge and show all method calls occurrences

  1. Select a method in Call Tree.

  2. Press Ctrl + Shift + Enter or choose the Merge Method Occurrences item from the context menu.

After this, the selected method becomes the root node in Call Tree containing all the occurrences. All other calls are hidden. This also automatically applies a filter by the method occurrences and their subtrees.

For instance, if in the example above (see the picture) you decide to see all UserMethod2 calls merged, Call Tree will look like and calculate time as follows:

call tree example scope2 png

To return back to the previous call tree root, click the ThemedIcon Backward Screen Gray png back button at the top.

Backtraces view mode

When Call Tree is focused on a method occurrence, you can switch Call Tree to the Backtraces mode using the corresponding control at the top of Call Tree.

In the Backtraces mode you can see which functions called a particular function from the bottom up. In other words, Backtraces is the inverted Call Tree view.

For instance, if in the example above (see the picture) you decide to open the UserMethod2 call (marked as B), Call Tree will show you methods called by UserMethod2:

call tree example scope1 png

If you switch Call Tree to the Backtraces mode, it will show you the execution path that ended with calling UserMethod2 or, in other words, the upper part of the tree:

call tree example backtraces png

Finding methods by name

To find a method by name

  1. Do one of the following:
    • On the menu bar, choose Edit | Find Function.

    • Press Ctrl+F.

  2. Start typing characters in the text box. As you type, the lookup list narrows down, suggesting names that match the entered substring. Note that you can use the CamelCase notation. It is case-insensitive, so there is no difference between 'gtc' and 'GTC'.

    call tree 3 png

  3. Select a class or a method from the list and press Enter.

The found method becomes a root node containing call subtrees of all its occurrences. This also applies a filter by method occurrences and their subtrees.

When navigating a call tree, there is always a problem to understand how did you get to a particular call. You can make the navigation easier by enabling the navigation path png Show current call tree filtration path mode. In this mode, all your transitions will be shown in the left gutter of Call Tree, so, it will be always clear where in the tree the focused node is.

For instance, if in the example above (see the picture) you decide to open the UserMethod2 call (marked as G), normally, it will be shown as:

call tree example navpath1 png

If you enable the navigation path png Show current call tree filtration path mode, Call Tree will also show you the whole navigation path:

call tree example navpath2 png

This works with merged call instances as well. For instance, if instead of focusing on a particular UserMethod2 instance, you open all method instances merged, the Call Tree will look as follows:

call tree example navpath3 png

Note how different parts of the tree are represented with a single ... (any code) node.

How Call Tree works as a filter

When you scope to a particular method occurrence or merged method occurrences, Call Tree works as a filter by method occurrence(s).

After the filter is applied, other filters will show data only for the time intervals where the selected method occurrence(s) (including subtree) was executed.

Call Tree as Flame graph

The flame graph is a graphical representation of the Call Tree. Each call is shown as a horizontal bar whose length depends on the call's total time, which equals the function's own time + the time of all its child functions. The longer the call, the longer the bar. To open the graph, click Flame graph in the Call Tree. This will build the graph for the current tree.

Flame graph
Last modified: 08 May 2020