class Consumer
Defined at line 32 of file ../../third_party/perfetto/include/perfetto/ext/tracing/core/consumer.h
Public Methods
void ~Consumer ()
void OnConnect ()
Called by Service (or more typically by the transport layer, on behalf of
the remote Service), once the Consumer
<
> Service connection has been
established.
void OnDisconnect ()
Called by the Service or by the transport layer if the connection with the
service drops, either voluntarily (e.g., by destroying the ConsumerEndpoint
obtained through Service::ConnectConsumer()) or involuntarily (e.g., if the
Service process crashes).
void OnTracingDisabled (const std::string & error)
Called by the Service after the tracing session has ended. This can happen
for a variety of reasons:
- The consumer explicitly called DisableTracing()
- The TraceConfig's |duration_ms| has been reached.
- The TraceConfig's |max_file_size_bytes| has been reached.
- An error occurred while trying to enable tracing. In this case |error|
is non-empty.
void OnTraceData (std::vector<TracePacket> , bool has_more)
Called back by the Service (or transport layer) after invoking
TracingService::ConsumerEndpoint::ReadBuffers(). This function can be
called more than once. Each invocation can carry one or more
TracePacket(s). Upon the last call, |has_more| is set to false (i.e.
|has_more| is a !EOF).
void OnDetach (bool success)
Called back by the Service (or transport layer) after invoking
TracingService::ConsumerEndpoint::Detach().
The consumer can disconnect at this point and the trace session will keep
on going. A new consumer can later re-attach passing back the same |key|
passed to Detach(), but only if the two requests come from the same uid.
void OnAttach (bool success, const TraceConfig & )
Called back by the Service (or transport layer) after invoking
TracingService::ConsumerEndpoint::Attach().
void OnTraceStats (bool success, const TraceStats & )
Called back by the Service (or transport layer) after invoking
TracingService::ConsumerEndpoint::GetTraceStats().
void OnObservableEvents (const ObservableEvents & )
Called back by the Service (or transport layer) after invoking
TracingService::ConsumerEndpoint::ObserveEvents() whenever one or more
ObservableEvents of enabled event types occur.
void OnSessionCloned (const OnSessionClonedArgs & )