Guides and Sample Code

Developer

Instruments User Guide

On This Page

Sampler Instrument

Overview

Instrument Description

The Sampler instrument captures information on all running threads for a process at regular intervals by stopping the process and recording the stack trace information. It can record information from a single process only.

Supported Platforms

iOS

Related Profiling Templates

N/A

Timeline Pane

The timeline pane displays the stack depth at each sample time.

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.

Sample Interval

Set how often the instrument records a stack trace. Use the pop-up menu to choose from microseconds, milliseconds, or seconds.

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.

Setting

Description

Options

Style

How information is presented.

  • CPU Usage: The percentage of CPU capabilities being used.

Sample Perspective

An option whether to record all sample counts or running sample times.

Call Tree

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

Setting

State

Separate by Thread

Off by default.

Invert Call Tree

Off by default.

Hide System Symbols

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.

Setting

State

Count

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

Definition

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.

Samples

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.

Total %

The percentage of total calls involving the symbol name.

Self %

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

Parent %

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

Category

An icon representing the category of the call.

Library

The name of the library that generated the call.

Source Path

The path to the source file 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

Definition

#

The sequence number of the sample.

Timestamp

The time that the sampling began.

Depth

The depth of the stack trace.

Duration

The amount of time the sampling occurred.

CPU

The CPU the thread is running on.

Process

The process being sampled.

Thread

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.