dotTrace 2017.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:

  • Get a quick overview on application activity.
  • Examine execution path of slowest methods (the ones that consume most time or are called frequently).
  • Determine critical execution paths.
  • Apply filter by method to limit other filters with time intervals where only the method you are interested in was executed.

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

call tree 0

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

pos 2 Short method name.

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

pos 4 Full method name.

How call time is calculated

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

tv plain list 2

Call Tree will calculate time as follows:

call tree main example

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 the Scope to This item from 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

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

To return back to the previous call tree root, click the ThemedIcon Backward Screen Gray 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

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

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

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

call tree example navpath2

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

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.

Last modified: 16 April 2018

See Also

Reference: