TraceSink


public abstract class 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

Public methods

abstract void

Close the TraceSink, completing any enqueued writes.

abstract void

Enqueue a PooledTracePacketArray to be written to the trace.

abstract void

Flush any enqueued trace events to the TraceSink.

abstract void

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

Public constructors

TraceSink

Added in 2.0.0-alpha01
public TraceSink()

Public methods

close

Added in 2.0.0-alpha01
public abstract void close()

Close the TraceSink, completing any enqueued writes.

This function may be called from any thread.

enqueue

Added in 2.0.0-alpha01
public abstract void enqueue(@NonNull PooledTracePacketArray pooledPacketArray)

Enqueue a PooledTracePacketArray to be written to the trace.

This function may be called from any thread.

flush

Added in 2.0.0-alpha01
public abstract void flush()

Flush any enqueued trace events to the TraceSink.

This function may be called from any thread.

onDroppedTraceEvent

Added in 2.0.0-alpha01
public abstract void onDroppedTraceEvent()

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

This function may be called from any thread.