Previous Topic

Next Topic

Book Contents

Book Index

CPU Call Tree

The CPU Call Tree view shows the CPU usage organized by call stacks of the threads started by the profiled application on the target JVM. To have data shown, CPU profiling must be turned on and the session must be stopped – either from this view or from CPU Hot Spots or Bundles CPU Call Tree. The format of the information displayed in the CPU tree is different, depending on whether the sampling or timing CPU method is applied.

The following types of nodes are present in the tree:

Node

Icon

Description

Thread

 

Each thread created by the target application creates a thread node, which holds a sub-tree representing its call stack.

 

 

Use real CPU time is on

 

All available threads are displayed with the same icon if the Use real CPU time option is enabled from the view pull-down menu or in the mBProfiler preferences.

 

 

Use real CPU time is off

Active thread

Currently active thread (if the Use real CPU time option is disabled) if it's run time is greater than 0,5s. To have thread durations calculated and respectively their state differentiated visually, make sure that thread profiling is active.

Non-active thread

Blocked, sleeping or waiting thread (if the Use real CPU time option is disabled).

CPU Usage

Stack frame or method consuming CPU. They may have successors.

Follow stack

Method or stack frame execution that has consumed no CPU time.

Threads are displayed with their thread names. The descendants of a thread node are the method invocations performed in the thread (the show method precision preference is on) or the frames involved in the call stack (the show line precision preference is on). These method calls can lead or not to using CPU time. Method calls are described with the fully qualified Java name (when show qualified names is selected in the mBProfiler preferences) of the class where the call has been performed, and the method name. In some special occasions, the following Strings are used instead of the method names:

The successors of a method call node are the internal calls performed in its body.

In case you have specified a project in the application's profile configuration, to go to the corresponding line of the source code associated with a call node:

The Java source file may fail to open, for example when the method belongs to an anonymous class or another situation preventing its launching has emerged. If the source file cannot be located because it is not available, an editor will be loaded with a option for specifying the relevant directory, .java file or wrapping JAR.

CPU Table and Filters

The CPU profiling information is displayed in a table whose columns can be added and removed using the Change Columns option from the popup menu or in the Preferences page: go to Window >Preferences (or Eclipse >Preferences if you are using OS X) and then to mBProfiler > Columns page.

You can filter the displayed information, thus concentrating only on a certain set of data. For details, please refer to the Filtering the Profiling Data section.

Locating the Hot Spot for a Method Call

You can easily find the CPU hot spot behind a method or a frame in the CPU call tree, right-click the stack entry and select Go to > Find in CPU Hot Spots from the popup menu. As a result, the CPU Hot Spots view will be opened with the target hot spot root node high-lighted.

Getting Memory Usage for a Method Call

To check the memory consumption including memory amount and number of produced instances, right-click the line within the relevant call stack and select Go to > Find In Memory Call Tree. The Memory Call Tree view will show up with the selected entry in the call stack.

Getting Information about the Activity of a Thread

To easily get runtime information about the activity of a thread from the CPU Call Tree view, right-click the thread root node of interest and select Go to > Find in Threads. mBProfiler will switch you to Threads view with the information about the target thread highlighted. The Threads view will offer details about the activity events of the thread.

Tracing a Call Entry within an OSGi Environment

If you are profiling an OSGi runtime, you can easily find which bundles are the source of a method call or a frame from a thread's call stack from the CPU Call Tree. Right-click the entry in the call tree and use Go to > Find in Bundles CPU Call Tree from the pop-up menu. The Bundles CPU Call Tree view will show up with the involved bundle selected.

Excluding Method Calls from Results

In certain cases, having common method calls like wait of Object or sleep of Thread included in the call tree might increase unnecessarily the amount of shown profiling data and might trouble performance analysis. You can hide such method calls from the CPU Call Tree view with the help of the exclude method filters:

  1. Define the exclusive filters for the methods:
  2. Turn on method exclude filters usage by selecting the Use Method Filters for CPU option from the view pull-down menu.