AbstractTraceSink
-
Cmn
abstract class AbstractTraceSink : AutoCloseable
InMemoryRingBufferTraceSink |
A |
TraceSink |
The trace sink that writes |
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 AbstractTraceSink's implementation.
Summary
Public constructors |
|
|---|---|
|
Cmn
|
Public functions |
||
|---|---|---|
abstract Unit |
close()Close the |
Cmn
|
abstract Unit |
enqueue(pooledPacketArray: PooledTracePacketArray)Enqueue a |
Cmn
|
abstract Unit |
flush()Flush any enqueued trace events to the |
Cmn
|
abstract Unit |
Called when the |
Cmn
|
Public constructors
Public functions
close
abstract fun close(): Unit
Close the AbstractTraceSink, 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 AbstractTraceSink.
If the trace sink writes to persistent storage, this forces any buffered events to be written immediately. For in-memory sinks, this is typically a no-op because they do not have an underlying persistent storage destination by default.
This function may be called from any thread.
onDroppedTraceEvent
abstract fun onDroppedTraceEvent(): Unit
Called when the AbstractTraceSink cannot keep up with incoming trace events from Tracks.
This function may be called from any thread.