Documentation ¶
Overview ¶
Package perfetto provides functionality to take and examine Perfetto traces. See https://perfetto.dev.
Index ¶
Constants ¶
const ( // ErrDone is returned for calls on a trace session that is already stopped. ErrDone = fault.Const("Trace already stopped") // ErrTracingToFile is returned for read calls on a trace session that is writting to a file on the device. ErrTracingToFile = fault.Const("Cannot read buffers, when tracing to a file") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client ("consumer") of a Perfetto service.
func NewClient ¶
NewClient returns a new client using the provided socket connection. The client takes ownership of the connection and invokes the provided cleanup on shutdown.
func (*Client) Close ¶
Close closes the underlying connection to the Perfetto service of this client.
func (*Client) Query ¶
Query queries the Perfetto service for producer and data source info and invokes the given callback on each received result. This is a streaming, synchronous RPC and the callback may be invoked multiple times.
func (*Client) Trace ¶
func (c *Client) Trace(ctx context.Context, cfg *config.TraceConfig, out io.Writer) (*TraceSession, error)
Trace initiates a new Perfetto trace session using the given config. The trace buffers will be serialized to the given writer. This is an asynchronous RPC that can be controlled/waited on using the returned trace session.
type TraceSession ¶
type TraceSession struct {
// contains filtered or unexported fields
}
TraceSession is the interface to a currently running Perfetto trace.
func (*TraceSession) Read ¶
func (s *TraceSession) Read(ctx context.Context) error
Read requests the service to transfer the buffered data and writes it into the output writer. This is a synchronous call that blocks until the service is done sending data and it has been written.
func (*TraceSession) Start ¶
func (s *TraceSession) Start(ctx context.Context)
Start starts the currently deferred trace of this session. Does nothing, if the Perfetto service doesn't support deferred tracing or the trace was not started in deferred mode.
func (*TraceSession) Stop ¶
func (s *TraceSession) Stop(ctx context.Context)
Stop stops the currently running trace of this session.
Directories ¶
Path | Synopsis |
---|---|
Package android contains the android specific Perfetto tracing code.
|
Package android contains the android specific Perfetto tracing code. |
Package client implements a client for the Perfetto consumer API.
|
Package client implements a client for the Perfetto consumer API. |
Package desktop contains the desktop specific Perfetto tracing code.
|
Package desktop contains the desktop specific Perfetto tracing code. |