Documentation ¶
Overview ¶
Package client provides helper methods and types for starting GAPIR instances and communicating with them. The actual interaction is achieved via the gRPC service defined in: gapir/replay_service/service.proto The client package abstracts the RPC handling details and offers a higher-level interface, in particular it can manage several live GAPIR instances at the same time.
Index ¶
- Constants
- type Client
- func (client *Client) BeginReplay(ctx context.Context, key *ReplayerKey, payload string, dependent string) error
- func (client *Client) Connect(ctx context.Context, device bind.Device, abi *device.ABI) (*ReplayerKey, error)
- func (client *Client) PrewarmReplay(ctx context.Context, key *ReplayerKey, payload string, cleanup string) error
- func (client *Client) SetReplayExecutor(ctx context.Context, key *ReplayerKey, executor ReplayExecutor) (func(), error)
- type ReplayExecutor
- type ReplayerKey
Constants ¶
const ( // LaunchArgsKey is the bind device property key used to control the command // line arguments when launching GAPIR. The property must be of type []string. LaunchArgsKey = "gapir-launch-args" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles multiple GAPIR instances identified by ReplayerKey.
func (*Client) BeginReplay ¶
func (client *Client) BeginReplay(ctx context.Context, key *ReplayerKey, payload string, dependent string) error
BeginReplay sends a replay request to the replayer identified by key.
func (*Client) Connect ¶
func (client *Client) Connect(ctx context.Context, device bind.Device, abi *device.ABI) (*ReplayerKey, error)
Connect starts a GAPIR instance and return its ReplayerKey.
func (*Client) PrewarmReplay ¶
func (client *Client) PrewarmReplay(ctx context.Context, key *ReplayerKey, payload string, cleanup string) error
PrewarmReplay requests the GAPIR device to get itself into the given state
func (*Client) SetReplayExecutor ¶
func (client *Client) SetReplayExecutor(ctx context.Context, key *ReplayerKey, executor ReplayExecutor) (func(), error)
SetReplayExecutor assigns a replay executor to the replayer identified by key. It returns a cleanup function to remove the executor once the replay is finished.
type ReplayExecutor ¶
type ReplayExecutor interface { // HandlePostData handles the given post data message. HandlePostData(context.Context, *gapir.PostData) error // HandleNotification handles the given notification message. HandleNotification(context.Context, *gapir.Notification) error // HandleFinished is notified when the given replay is finished. HandleFinished(context.Context, error) error // HandleFenceReadyRequest handles when the replayer is waiting for the server // to execute the registered FenceReadyRequestCallback for fence ID provided // in the FenceReadyRequest. HandleFenceReadyRequest(context.Context, *gapir.FenceReadyRequest) error }
ReplayExecutor must be implemented by replay executors to handle some live interactions with a running replay.
type ReplayerKey ¶
type ReplayerKey struct {
// contains filtered or unexported fields
}
ReplayerKey is used to uniquely identify a GAPIR instance.