class StopArgs

Defined at line 127 of file ../../third_party/perfetto/include/perfetto/tracing/data_source.h

Public Members

uint32_t internal_instance_index

Public Methods

void ~StopArgs ()
std::function<void ()> HandleStopAsynchronously ()

HandleAsynchronously() can optionally be called to defer the tracing

session stop and write tracing data just before stopping.

This function returns a closure that must be invoked after the last

trace events have been emitted. The returned closure can be called from

any thread. The caller also needs to explicitly call TraceContext.Flush()

from the last Trace() lambda invocation because no other implicit flushes

will happen after the stop signal.

When this function is called, the tracing service will defer the stop of

the tracing session until the returned closure is invoked.

However, the caller cannot hang onto this closure for too long. The

tracing service will forcefully stop the tracing session without waiting

for pending producers after TraceConfig.data_source_stop_timeout_ms

(default: 5s, can be overridden by Consumers when starting a trace).

If the closure is called after this timeout an error will be logged and

the trace data emitted will not be present in the trace. No other

functional side effects (e.g. crashes or corruptions) will happen. In

other words, it is fine to accidentally hold onto this closure for too

long but, if that happens, some tracing data will be lost.