Guides and Sample Code


Instruments User Guide

On This Page

Counters Instrument


Instrument Description

The Counters instrument records information from user-managed PM events. It can record information from a single process or from all processes running on the system.

Supported Platforms


Related Profiling Templates

Counters Profiling Template

Timeline Pane

The timeline pane displays information based on the PM events selected.

Record Settings

Click the Record Settings button (image: ../Art/instruments_recordsettings_button_inline_2x.png) in the inspector pane to customize the following recording options.

Instrument Configuration

These settings control how the instrument behaves.



Sample By

Specifies whether to sample by time or events. The default is time.


The event to sample. This option is only available when Sample By is set to sample events.

Sample Rate

How often the instrument collects data. Choose microseconds (µs), milliseconds (ms), or seconds (s).


Select to view None, User, Kernel, or Both.

Events and Formulas

Click the Add button (+) to add visible PM events and formulas. The number of events and formulas that can be recorded is hardware dependent. Trying to record too many events and formulas at once will result in an error message.

Display Settings

Click the Display Settings button (image: ../Art/instruments_displaysettings_button_inline_2x.png) in the inspector pane to customize the following display settings.

Track Display Settings

These settings control how information is displayed in the timeline pane.





How information is presented.

  • Counters: Shows any counters that have been selected.


How multiple parameters in one track are displayed. This is a fixed setting, which can’t be changed.

  • Stacked: Each statistic has its own graph.

Call Tree

The following call tree display settings filter the call tree in the detail pane.



Separate by Thread

Off by default.

Invert Call Tree

Off by default.

Hide System Libraries

Off by default.

Flatten Recursion

Off by default.

Top Functions

Off by default.

Call Tree Constraints

The following options filter the call tree to display calls that fall within a specific threshold based on the settings below.




Off by default.

Time (ms)

Off by default.

Data Mining

Allows you to filter through the collected data for specific symbols and libraries.

Detail Pane Columns

Call Tree Detail Type

The following call tree columns are available in the detail pane.

Column name


Total Samples

The number of samples collected for the symbol and its children.

Total Time

The total amount of time the symbol ran.

Running Time

The amount of time the symbol ran, and the percentage of the running time of all symbols.


The number of samples collected for the symbol and its children, and the percentage of all symbols.

Self (ms)

The amount of time spent in the function, in milliseconds. If the Top Functions option is disabled under the display settings, this value excludes time spent in other functions it calls.

# Self

The number of times the symbol has been called.

% Calls

The percentage of total calls involving the symbol name.

# Calls

The number of calls involving the symbol name.

% of Parent

The percentage of bytes used by the call’s parent.

Source Path

The path to the source file that generated the call.


An icon representing the category of the call.


The name of the library that generated the call.

Symbol Name

The name of the symbol being called.

Sample List Detail Type

The following sample list columns are available in the detail pane.

Column name



The sequence number of the sample.


The time that the sampling began.


The depth of the stack trace.


The duration of the sample.


The processor on which the thread is running.


The process being sampled.


The thread identifier.

Thread ID

The ID of the thread on which the sample occurred.

Hot Frame

The function encountered most frequently during the sample.

Hot Frame Address

The memory address of the function encountered most frequently during the sample.

Responsible Library

The library responsible for the process.

Responsible Caller

The function that created the process.