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()
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.voidbegin(stringname,string[]args)
Parameters
name
string — Required
The name of the tracepoint.
args
string[] — Required
Debug arguments that must come as a key-value pair.
end()
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.voidend(stringname)
Parameters
name
string — Required
The name of the tracepoint
instant()
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.voidinstant(stringname,string[]args)
Parameters
name
string — Required
The name of the tracepoint.
args
string[] — Required
Debug arguments that must come as a key-value pair.
instantOffset()
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.voidinstantOffset(stringname,i32offset,string[]args)
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()
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.voidbeginAsync(i32cookie,stringname,string[]args)
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()
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.voidendAsync(i32cookie,stringname)
Parameters
cookie
i32 — Required
Thread id.
name
string — Required
The name of the tracepoint.
beginWithFlow()
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.voidbeginWithFlow(stringname,i32flowId,string[]args,ScopeTypescope)
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()
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.voidbeginWithTerminateFlow(stringname,i32flowId,string[]args,ScopeTypescope)
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()
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.voidinstantWithFlow(stringname,i32flowId,string[]args,ScopeTypescope)
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()
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.voidinstantWithTerminateFlow(stringname,i32flowId,string[]args,ScopeTypescope)
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"

