TraceSink


Known direct subclasses
TraceSink

The trace sink that writes BufferedSink, to a new file per trace session.


Receives PooledTracePacketArrays from Tracks and asynchronously serializes them to a file or buffer, depending on implementation.

Note that while serialized trace events are typically written as Perfetto TracePacket protos so that they may be read by ui.perfetto.dev and queried with the corresponding TraceProcessor tools, the final serialization format is up to the TraceSink's implementation.

Summary

Public constructors

Cmn

Public functions

abstract Unit

Close the TraceSink, completing any enqueued writes.

Cmn
abstract Unit
enqueue(pooledPacketArray: PooledTracePacketArray)

Enqueue a PooledTracePacketArray to be written to the trace.

Cmn
abstract Unit

Flush any enqueued trace events to the TraceSink.

Cmn
abstract Unit

Called when the TraceSink cannot keep up with incoming trace events from Tracks.

Cmn

Public constructors

TraceSink

TraceSink()

Public functions

close

abstract fun close(): Unit

Close the TraceSink, completing any enqueued writes.

This function may be called from any thread.

enqueue

abstract fun enqueue(pooledPacketArray: PooledTracePacketArray): Unit

Enqueue a PooledTracePacketArray to be written to the trace.

This function may be called from any thread.

flush

abstract fun flush(): Unit

Flush any enqueued trace events to the TraceSink.

This function may be called from any thread.

onDroppedTraceEvent

abstract fun onDroppedTraceEvent(): Unit

Called when the TraceSink cannot keep up with incoming trace events from Tracks.

This function may be called from any thread.