Tracing Domain
Methods
- Tracing.end
- Tracing.start
- Tracing.getCategories Experimental
- Tracing.recordClockSyncMarker Experimental
- Tracing.requestMemoryDump Experimental
Events
- Tracing.tracingComplete
- Tracing.bufferUsage Experimental
- Tracing.dataCollected Experimental
Types
- Tracing.TraceConfig
- Tracing.MemoryDumpConfig Experimental
- Tracing.MemoryDumpLevelOfDetail Experimental
- Tracing.StreamCompression Experimental
- Tracing.StreamFormat Experimental
- Tracing.TracingBackend Experimental
Methods
Tracing.start #
Start trace events collection.
Tracing.start support is experimental.
Parameters
categoriesOptional
stringCategory/tag filter
optionsOptional
stringTracing options
bufferUsageReportingIntervalOptional
numberIf set, the agent will issue bufferUsage events at this interval, specified in milliseconds
transferModeOptional
stringWhether to report trace events as series of dataCollected events or to save trace to a
stream (defaults to ReportEvents).
Allowed values: ReportEvents, ReturnAsStream
streamFormatOptional
Trace data format to use. This only applies when using ReturnAsStream
transfer mode (defaults to json).
streamCompressionOptional
Compression format to use. This only applies when using ReturnAsStream
transfer mode (defaults to none)
traceConfigOptional
perfettoConfigOptional
stringBase64-encoded serialized perfetto.protos.TraceConfig protobuf message
When specified, the parameters categories, options, traceConfig
are ignored. (Encoded as a base64 string when passed over JSON)
tracingBackendOptional
Tracing.getCategories Experimental#
Gets supported tracing categories.
Return object
categories array[ string ]A list of supported tracing categories.
Tracing.recordClockSyncMarker Experimental#
Record a clock sync marker in the trace.
Parameters
syncId stringThe ID of this clock sync marker
Tracing.requestMemoryDump Experimental#
Request a global memory dump.
Parameters
deterministicOptional
booleanEnables more deterministic results by forcing garbage collection
levelOfDetailOptional
Specifies level of details in memory dump. Defaults to "detailed".
Return object
dumpGuid stringGUID of the resulting global memory dump.
success booleanTrue iff the global memory dump succeeded.
Events
Tracing.tracingComplete #
Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.
Parameters
dataLossOccurred booleanIndicates whether some trace data is known to have been lost, e.g. because the trace ring buffer wrapped around.
streamOptional
A handle of the stream that holds resulting trace data.
traceFormatOptional
Trace data format of returned stream.
streamCompressionOptional
Compression format of returned stream.
Tracing.bufferUsage Experimental#
Parameters
percentFullOptional
numberA number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.
eventCountOptional
numberAn approximate number of events in the trace log.
valueOptional
numberA number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.
Tracing.dataCollected Experimental#
Contains a bucket of collected trace events. When tracing is stopped collected events will be sent as a sequence of dataCollected events followed by tracingComplete event.
Parameters
value array[ object ]Types
Tracing.TraceConfig #
Type: object
Properties
recordModeOptional
stringControls how the trace buffer stores data. The default is recordUntilFull.
Allowed values: recordUntilFull, recordContinuously, recordAsMuchAsPossible, echoToConsole
traceBufferSizeInKbOptional
numberSize of the trace buffer in kilobytes. If not specified or zero is passed, a default value of 200 MB would be used.
enableSamplingOptional
booleanTurns on JavaScript stack sampling.
enableSystraceOptional
booleanTurns on system tracing.
enableArgumentFilterOptional
booleanTurns on argument filter.
includedCategoriesOptional
array[ string ]Included category filters.
excludedCategoriesOptional
array[ string ]Excluded category filters.
syntheticDelaysOptional
array[ string ]Configuration to synthesize the delays in tracing.
memoryDumpConfigOptional
Configuration for memory dump triggers. Used only when "memory-infra" category is enabled.
Tracing.MemoryDumpConfig Experimental#
Configuration for memory dump. Used only when "memory-infra" category is enabled.
Type: object
Tracing.MemoryDumpLevelOfDetail Experimental#
Details exposed when memory request explicitly declared. Keep consistent with memory_dump_request_args.h and memory_instrumentation.mojom
Type: string
Allowed values: background, light, detailed
Tracing.StreamCompression Experimental#
Compression type to use for traces returned via streams.
Type: string
Allowed values: none, gzip
Tracing.StreamFormat Experimental#
Data format of a trace. Can be either the legacy JSON format or the protocol buffer format. Note that the JSON format will be deprecated soon.
Type: string
Allowed values: json, proto
Tracing.TracingBackend Experimental#
Backend type to use for tracing. chrome uses the Chrome-integrated
tracing service and is supported on all platforms. system is only
supported on Chrome OS and uses the Perfetto system tracing service.
auto chooses system when the perfettoConfig provided to Tracing.start
specifies at least one non-Chrome data source; otherwise uses chrome.
Type: string
Allowed values: auto, chrome, system