Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ITraceCategory

interface ITraceCategory
Extends com.amazon.apmf.IStandard ITraceCategory interface contains APIs that emit tracepoints for various application operations based on the Category type. Predefined categories have been provided for convenience. Use IVtrace’s internCategory call to create an ITraceCategory object.

Methods

begin()

void begin(string name, string[] args)
Create a tracepoint with trace_type “begin”, along with the passed parameters. The name and category provided in this begin method should match that in the end method to denote they belong to the same trace session.

Parameters

name
string — Required The name of the tracepoint.
args
string[] — Required Debug arguments that must come as a key-value pair.

end()

void end(string name)
Create a tracepoint with trace_type “end”, along with the passed parameters. The name and category provided in this end method should match that in the begin method to denote they belong to the same trace session.

Parameters

name
string — Required The name of the tracepoint

instant()

void instant(string name, string[] args)
Create a tracepoint with trace_type “instant”, along with the passed parameters. This tracepoint denotes an event at an instance of time within the trace file.

Parameters

name
string — Required The name of the tracepoint.
args
string[] — Required Debug arguments that must come as a key-value pair.

instantOffset()

void instantOffset(string name, i32 offset, string[] args)
Create a tracepoint with trace_type “instant”, along with the passed parameters. This tracepoint denotes an event at an instance of time within the trace file with a time offset.

Parameters

name
string — Required The name of the tracepoint.
offset
i32 — Required Time offset.
args
string[] — Required Debug arguments that must come as a key-value pair.

beginAsync()

void beginAsync(i32 cookie, string name, string[] args)
Create a tracepoint with trace_type “begin”, along with the passed parameters. This tracepoint is used to track an application on a thread. The name and category provided in this begin method should match that in the end method to denote they belong to the same trace session.

Parameters

cookie
i32 — Required Thread id.
name
string — Required The name of the tracepoint.
args
string[] — Required Debug arguments that must come as a key-value pair.

endAsync()

void endAsync(i32 cookie, string name)
Create a tracepoint with trace_type “end”, along with the passed parameters. This tracepoint is used to track an application on a thread. The name, category, and cookie provided in this end method should match that in the begin method to denote they belong to the same trace session.

Parameters

cookie
i32 — Required Thread id.
name
string — Required The name of the tracepoint.

beginWithFlow()

void beginWithFlow(string name, i32 flowId, string[] args, ScopeType scope)
Creates a tracepoint with trace_type “begin” along with the passed parameters. This tracepoint will be associated with a flowId, denoting that two (or more) tracepoints are connected. If the flowId is unique, then this tracepoint will be the start of the flow, otherwise this tracepoint will be connected to the previous tracepoint with the same flowId. If scope is globalScope, the caller is responsible for ensuring that it’s globally-unique (e.g. by generating a random value). This should be used only for flow events which cross the process boundary (e.g. IPCs). Otherwise, the given flowId is xor’ed with Perfetto’s internal process track id to attempt to ensure that it’s globally unique. The name and category provided in this begin method should match that in the end method to denote they belong to the same trace session.

Parameters

name
string — Required The name of the tracepoint.
flowId
i32 — Required Id to denote that two (or more) tracepoints are related.
args
string[] — Required Debug arguments that must come as a key-value pair.
scope
ScopeType — Required ScopeType enum used to declare if globally or process scoped.

beginWithTerminateFlow()

void beginWithTerminateFlow(string name, i32 flowId, string[] args, ScopeType scope)
Creates a tracepoint with trace_type “begin” along with the passed parameters. This tracepoint will also end the Flow associated with the flowId, releasing the Id allowing it to be reused. If scope is globalScope, the caller is responsible for ensuring that it’s globally-unique (e.g. by generating a random value). This should be used only for flow events which cross the process boundary (e.g. IPCs). Otherwise, the given flowId is xor’ed with Perfetto’s internal process track id to attempt to ensure that it’s globally unique. The name and category provided in this begin method should match that in the end method to denote they belong to the same trace session.

Parameters

name
string — Required The name of the tracepoint.
flowId
i32 — Required The Id of the Flow to terminate.
args
string[] — Required Debug arguments that must come as a key-value pair.
scope
ScopeType — Required ScopeType enum used to declare if globally or process scoped.

instantWithFlow()

void instantWithFlow(string name, i32 flowId, string[] args, ScopeType scope)
Creates a tracepoint with trace_type “instant” along with the passed parameters. This tracepoint will be associated with a flowId, denoting that two (or more) tracepoints are connected. If the flowId is unique, then this tracepoint will be the start of the flow, otherwise this tracepoint will be connected to the previous tracepoint with the same flowId. If scope is globalScope, the caller is responsible for ensuring that it’s globally-unique (e.g. by generating a random value). This should be used only for flow events which cross the process boundary (e.g. IPCs). Otherwise, the given flowId is xor’ed with Perfetto’s internal process track id to attempt to ensure that it’s globally unique.

Parameters

name
string — Required The name of the tracepoint.
flowId
i32 — Required Id to denote that two (or more) tracepoints are related.
args
string[] — Required Debug arguments that must come as a key-value pair.
scope
ScopeType — Required ScopeType enum used to declare if globally or process scoped.

instantWithTerminateFlow()

void instantWithTerminateFlow(string name, i32 flowId, string[] args, ScopeType scope)
Creates a tracepoint with trace_type “instant” along with the passed parameters. This tracepoint will also end the Flow associated with the flowId, releasing the Id allowing it to be reused. If scope is globalScope, the caller is responsible for ensuring that it’s globally-unique (e.g. by generating a random value). This should be used only for flow events which cross the process boundary (e.g. IPCs). Otherwise, the given flowId is xor’ed with Perfetto’s internal process track id to attempt to ensure that it’s globally unique.

Parameters

name
string — Required The name of the tracepoint.
flowId
i32 — Required The Id of the Flow to terminate.
args
string[] — Required Debug arguments that must come as a key-value pair.
scope
ScopeType — Required ScopeType enum used to declare if globally or process scoped.

isEnabled()

bool isEnabled()
Allows checking if traces from the category are enabled.

Returns

bool true if enabled, otherwise false.

Constants

APP

string = "app"

UPL

string = "upl"

UCC

string = "ucc"

ASSETS

string = "assets"

AUDIO

string = "audio"

BG_MGR

string = "bg_mgr"

BLUETOOTH

string = "bluetooth"

CAMERA

string = "camera"

DOWNLOAD

string = "download"

EVENT_MGR

string = "event_mgr"

GRAPHICS

string = "graphics"

INPUT

string = "input"

IPC

string = "ipc"

KEYBOARD

string = "keyboard"

LIFECYCLE

string = "lifecycle"

NETWORK

string = "network"

PACKAGE

string = "package"

POWER

string = "power"

RESOURCE

string = "resource"

SECURITY

string = "security"

STORAGE

string = "storage"

SYSTEM

string = "system"

THERMAL

string = "thermal"

UI

string = "ui"

VIDEO

string = "video"

VOICE

string = "voice"

WEBVIEW

string = "webview"

SERVICE_REGISTRAR

string = "service_registrar"

DEVICE_CONFIG

string = "device_config"

MSGR

string = "msgr"
Last modified on October 29, 2026