Tracing

class Tracing(cdp: CDP) : Domain

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class BufferUsageParameter(val percentFull: Double? = null, val eventCount: Double? = null, val value: Double? = null)
Link copied to clipboard
@Serializable
data class DataCollectedParameter(val value: List<Map<String, JsonElement>>)

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.

Link copied to clipboard
@Serializable
data class GetCategoriesReturn(val categories: List<String>)
Link copied to clipboard

Details exposed when memory request explicitly declared. Keep consistent with memory_dump_request_args.h and memory_instrumentation.mojom

Link copied to clipboard
@Serializable
data class RecordClockSyncMarkerParameter(val syncId: String)
Link copied to clipboard
@Serializable
data class RequestMemoryDumpParameter(val deterministic: Boolean? = null, val levelOfDetail: Tracing.MemoryDumpLevelOfDetail? = null)
Link copied to clipboard
@Serializable
data class RequestMemoryDumpReturn(val dumpGuid: String, val success: Boolean)
Link copied to clipboard
@Serializable
data class StartParameter(val categories: String? = null, val options: String? = null, val bufferUsageReportingInterval: Double? = null, val transferMode: String? = null, val streamFormat: Tracing.StreamFormat? = null, val streamCompression: Tracing.StreamCompression? = null, val traceConfig: Tracing.TraceConfig? = null, val perfettoConfig: String? = null, val tracingBackend: Tracing.TracingBackend? = null)
Link copied to clipboard

Compression type to use for traces returned via streams.

Link copied to clipboard
@Serializable
enum StreamFormat : Enum<Tracing.StreamFormat>

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.

Link copied to clipboard
@Serializable
data class TraceConfig(val recordMode: String? = null, val traceBufferSizeInKb: Double? = null, val enableSampling: Boolean? = null, val enableSystrace: Boolean? = null, val enableArgumentFilter: Boolean? = null, val includedCategories: List<String>? = null, val excludedCategories: List<String>? = null, val syntheticDelays: List<String>? = null, val memoryDumpConfig: Map<String, JsonElement>? = null)
Link copied to clipboard

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.

Link copied to clipboard
@Serializable
data class TracingCompleteParameter(val dataLossOccurred: Boolean, val stream: String? = null, val traceFormat: Tracing.StreamFormat? = null, val streamCompression: Tracing.StreamCompression? = null)

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

Properties

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

Functions

Link copied to clipboard
suspend fun end(mode: CommandMode = CommandMode.DEFAULT)

Stop trace events collection.

Link copied to clipboard
suspend fun getCategories(mode: CommandMode = CommandMode.DEFAULT): Tracing.GetCategoriesReturn

Gets supported tracing categories.

Link copied to clipboard
suspend fun recordClockSyncMarker(syncId: String)
suspend fun recordClockSyncMarker(args: Tracing.RecordClockSyncMarkerParameter, mode: CommandMode = CommandMode.DEFAULT)

Record a clock sync marker in the trace.

Link copied to clipboard
suspend fun requestMemoryDump(deterministic: Boolean? = null, levelOfDetail: Tracing.MemoryDumpLevelOfDetail? = null): Tracing.RequestMemoryDumpReturn

Request a global memory dump.

Link copied to clipboard
suspend fun start(args: Tracing.StartParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun start(categories: String? = null, options: String? = null, bufferUsageReportingInterval: Double? = null, transferMode: String? = null, streamFormat: Tracing.StreamFormat? = null, streamCompression: Tracing.StreamCompression? = null, traceConfig: Tracing.TraceConfig? = null, perfettoConfig: String? = null, tracingBackend: Tracing.TracingBackend? = null)

Start trace events collection.