Documentation ¶
Overview ¶
Package client implements a client for the Perfetto consumer API. This is an internal package only to be used from within the gapis/perfetto package and provides implementation details for the perfetto.Client class.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindHandler ¶
BindHandler is the callback invoked when the Bind completes.
type BindSync ¶
type BindSync struct { Handler BindHandler // contains filtered or unexported fields }
BindSync is a sync helper to turn async Bind calls into sync ones. Use the Handler struct member in calling Bind() and then call Wait.
func NewBindSync ¶
NewBindSync returns a new BindSync.
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection is a connection to the Perfetto service.
func Connect ¶
Connect creates a new connection that uses the established socket to communicate with the Perfetto service.
func (*Connection) Bind ¶
func (c *Connection) Bind(ctx context.Context, service string, handler BindHandler) error
Bind binds to the given proto service.
func (*Connection) Close ¶
func (c *Connection) Close(ctx context.Context)
Close closes this connection and the underlying socket.
func (*Connection) Invoke ¶
func (c *Connection) Invoke(ctx context.Context, m *Method, args proto.Message, handler InvokeHandler) error
Invoke invokes the given method and calls the handler on a response.
type InvokeHandler ¶
InvokeHandler is the callback invoked when an Invoke gets a response. For streaming RPCs it may be invoked multiple times.
func NewIgnoreHandler ¶
func NewIgnoreHandler(ctx context.Context, cb func(error)) InvokeHandler
NewIgnoreHandler returns an InvokeHanlder that ignores the returned result, but propagates errors and ensure the response is not streaming.
func NewReadHandler ¶
func NewReadHandler(ctx context.Context, cb func(*ipc.ReadBuffersResponse, bool, error)) InvokeHandler
NewReadHandler returns an InvokeHandler that handles unmarshalling the proto bytes of a ReadBuffers response and invokes the given callback.
func NewTraceHandler ¶
func NewTraceHandler(ctx context.Context, cb func(*ipc.EnableTracingResponse, error)) InvokeHandler
NewTraceHandler returns an InvokeHandler that handles unmarshalling the proto bytes of an EnableTrace response and invokes the given callback.
type InvokeSync ¶
type InvokeSync struct { Handler InvokeHandler // contains filtered or unexported fields }
InvokeSync is a sync helper to turn async Invoke calls into sync ones. Use the Handler struct member in calling Invoke() and then call Wait.
func NewInvokeSync ¶
func NewInvokeSync(ctx context.Context, cb func(data []byte) error) *InvokeSync
NewInvokeSync returns a new InvokeSync. The given callback is called upon every successful streamed result.
func NewQuerySync ¶
func NewQuerySync(ctx context.Context, cb func(*common.TracingServiceState) error) *InvokeSync
NewQuerySync returns an InvokeSync that handles unmarshalling the proto bytes and invokes the given callback.
type Method ¶
type Method struct { Name string // contains filtered or unexported fields }
Method represents an RPC method that can be called on the Perfetto service.
type PacketWriter ¶
type PacketWriter struct {
// contains filtered or unexported fields
}
PacketWriter serializes Perfetto packets to a Writer.
func NewPacketWriter ¶
func NewPacketWriter(out io.Writer) *PacketWriter
NewPacketWriter returns a packet writer that serializes to the given writer.
func (*PacketWriter) Write ¶
func (w *PacketWriter) Write(slices []*ipc.ReadBuffersResponse_Slice) error
Write serializes the given packet slices.