service

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2017 License: Apache-2.0 Imports: 18 Imported by: 153

Documentation

Overview

Package service is the definition of the RPC GPU debugger service exposed by the server.

It is not the actual implementation of the service functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FindHandler

type FindHandler func(*FindResponse) error

FindHandler is the handler of found items using Service.Find.

type ReportBuilder

type ReportBuilder struct {
	// contains filtered or unexported fields
}

ReportBuilder helps construct reports.

func NewReportBuilder

func NewReportBuilder() *ReportBuilder

NewReportBuilder creates and initializes new report builder.

func (*ReportBuilder) Add

func (b *ReportBuilder) Add(ctx context.Context, element *ReportItemRaw)

Add processes tags, adds references to item and adds item to report.

func (*ReportBuilder) Build

func (b *ReportBuilder) Build() *Report

Build performs final processing and returns report.

type ReportItemRaw

type ReportItemRaw struct {
	Item    *ReportItem
	Message *stringtable.Msg
	Tags    []*stringtable.Msg
}

ReportItemRaw represents ReportItem, raw message and array of raw tags.

func WrapReportItem

func WrapReportItem(item *ReportItem, m *stringtable.Msg) *ReportItemRaw

WrapReportItem wraps ReportItem into raw representation of ReportItemTagged which contains raw messages instead of references.

type Service

type Service interface {
	// Ping is a no-op function that returns immediately.
	// It can be used to measure connection latency or to keep the
	// process alive if started with the "idle-timeout" command line flag.
	Ping(ctx context.Context) error

	// GetServerInfo returns information about the running server.
	GetServerInfo(ctx context.Context) (*ServerInfo, error)

	// GetAvailableStringTables returns list of available string table descriptions.
	GetAvailableStringTables(ctx context.Context) ([]*stringtable.Info, error)

	// GetStringTable returns the requested string table.
	GetStringTable(ctx context.Context, info *stringtable.Info) (*stringtable.StringTable, error)

	// ImportCapture imports capture data emitted by the graphics spy, returning
	// the new capture identifier.
	ImportCapture(ctx context.Context, name string, data []uint8) (*path.Capture, error)

	// ExportCapture returns a capture's data that can be consumed by
	// ImportCapture or LoadCapture.
	ExportCapture(ctx context.Context, c *path.Capture) ([]byte, error)

	// LoadCapture imports capture data from a local file, returning the new
	// capture identifier.
	LoadCapture(ctx context.Context, path string) (*path.Capture, error)

	// GetDevices returns the full list of replay devices avaliable to the server.
	// These include local replay devices and any connected Android devices.
	// This list may change over time, as devices are connected and disconnected.
	// If both connected Android and Local replay devices are found,
	// the local Android devices will be returned first.
	GetDevices(ctx context.Context) ([]*path.Device, error)

	// GetDevicesForReplay returns the list of replay devices avaliable to the
	// server that are capable of replaying the given capture.
	// These include local replay devices and any connected Android devices.
	// This list may change over time, as devices are connected and disconnected.
	// If both connected Android and Local replay devices are found,
	// the local Android devices will be returned first.
	GetDevicesForReplay(ctx context.Context, p *path.Capture) ([]*path.Device, error)

	// GetFramebufferAttachment returns the ImageInfo identifier describing the
	// given framebuffer attachment and device, immediately following the atom
	// after.
	// The provided RenderSettings structure can be used to adjust maximum desired
	// dimensions of the image, as well as applying debug visualizations.
	GetFramebufferAttachment(
		ctx context.Context,
		device *path.Device,
		after *path.Command,
		attachment api.FramebufferAttachment,
		settings *RenderSettings,
		hints *UsageHints) (*path.ImageInfo, error)

	// Get resolves and returns the object, value or memory at the path p.
	Get(ctx context.Context, p *path.Any) (interface{}, error)

	// Set creates a copy of the capture referenced by p, but with the object, value
	// or memory at p replaced with v. The path returned is identical to p, but with
	// the base changed to refer to the new capture.
	Set(ctx context.Context, p *path.Any, v interface{}) (*path.Any, error)

	// Follow returns the path to the object that the value at p links to.
	// If the value at p does not link to anything then nil is returned.
	Follow(ctx context.Context, p *path.Any) (*path.Any, error)

	// BeginCPUProfile starts CPU self-profiling of the server.
	// If the CPU is already being profiled then this function will return an
	// error.
	// This is a debug API, and may be removed in the future.
	BeginCPUProfile(ctx context.Context) error

	// EndCPUProfile ends the CPU profile, returning the pprof samples.
	// This is a debug API, and may be removed in the future.
	EndCPUProfile(ctx context.Context) ([]byte, error)

	// GetPerformanceCounters returns the values of all global counters as
	// a JSON blob.
	GetPerformanceCounters(ctx context.Context) ([]byte, error)

	// GetProfile returns the pprof profile with the given name.
	GetProfile(ctx context.Context, name string, debug int32) ([]byte, error)

	// GetLogStream calls the handler with each log record raised until the
	// context is cancelled.
	GetLogStream(context.Context, log.Handler) error

	// Find performs a search using req, streaming the results to h.
	Find(ctx context.Context, req *FindRequest, h FindHandler) error
}

Directories

Path Synopsis
Package path contains types that represent data references.
Package path contains types that represent data references.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL