dotTrace 2023.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

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

2 Short method name.

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

4 Full method name.

How call time is calculated

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

Call Tree example

Call Tree will calculate time as follows:

Call Tree example

Explore the 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 a 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 the 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.

Scope 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.

Call Tree example

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

Call Tree example

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 call 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.

Call Tree example

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

Call Tree example

To return back to the previous call tree root, click the Back 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.

Call Tree example

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

Call Tree example

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

Group calls by threads

To simplify analysis of multi-threaded applications, group call stacks by threads. To do this, click Group by Thread in the call tree.

Group by threads

Find methods by name

To find a method by name

  1. Do one of the following:

    • From the main menu, select Edit | Find Function.

    • Press Ctrl+F.

  2. Start typing characters in the field. 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 'gfnames' and 'GFNames'.

    Call Tree find methods
  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 Show current call tree filtration path mode. In this mode, all your transitions will be shown in the gutter of Call Tree, so, it will be always clear where in the tree the focused node is.

Call Tree example

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

Navigation path example

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

Navigation path example

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:

Navigation path example

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: 03 November 2023