Documentation ¶
Overview ¶
Package capture contains all the core GAPIS functionality for dealing with loaded captures.
Index ¶
- Constants
- func Captures() []*path.Capture
- func Export(ctx context.Context, p *path.Capture, w io.Writer) error
- func Get(ctx context.Context) *path.Capture
- func Import(ctx context.Context, name string, key string, src Source) (*path.Capture, error)
- func New(ctx context.Context, c Capture) (*path.Capture, error)
- func NewState(ctx context.Context) (*api.GlobalState, error)
- func Put(ctx context.Context, c *path.Capture) context.Context
- type Capture
- type ErrUnsupportedVersion
- type GraphicsCapture
- func NewGraphicsCapture(ctx context.Context, name string, header *Header, initialState *InitialState, ...) (*GraphicsCapture, error)
- func ResolveGraphics(ctx context.Context) (*GraphicsCapture, error)
- func ResolveGraphicsFromID(ctx context.Context, id id.ID) (*GraphicsCapture, error)
- func ResolveGraphicsFromPath(ctx context.Context, p *path.Capture) (*GraphicsCapture, error)
- func (c *GraphicsCapture) CloneInitialState() *InitialState
- func (c *GraphicsCapture) Export(ctx context.Context, w io.Writer) error
- func (g *GraphicsCapture) Name() string
- func (c *GraphicsCapture) NewState(ctx context.Context) *api.GlobalState
- func (c *GraphicsCapture) NewUninitializedState(ctx context.Context) *api.GlobalState
- func (c *GraphicsCapture) NewUninitializedStateSharingAllocator(ctx context.Context, oldGlobalState *api.GlobalState) *api.GlobalState
- func (g *GraphicsCapture) Path(ctx context.Context) (*path.Capture, error)
- func (c *GraphicsCapture) Service(ctx context.Context, p *path.Capture) *service.Capture
- type InitialState
- type PerfettoCapture
- type Source
Constants ¶
const ( // CurrentCaptureVersion is incremented on breaking changes to the capture format. // NB: Also update equally named field in gapii/cc/spy_base.cpp CurrentCaptureVersion int32 = 4 )
Variables ¶
This section is empty.
Functions ¶
func Export ¶
Export encodes the given capture and associated resources and writes it to the supplied io.Writer in the pack file format, producing output suitable for use with Import or opening in the trace editor.
Types ¶
type Capture ¶
type Capture interface { // Name returns the name of the capture. Name() string // Service returns the service.Capture description for this capture. Service(ctx context.Context, p *path.Capture) *service.Capture // Export exports the capture in binary format to the given writer. Export(ctx context.Context, w io.Writer) error }
Capture represents data from a trace.
func ResolveFromID ¶
ResolveFromID resolves a single capture with the ID id.
type ErrUnsupportedVersion ¶
type ErrUnsupportedVersion struct{ Version int32 }
func (ErrUnsupportedVersion) Error ¶
func (e ErrUnsupportedVersion) Error() string
type GraphicsCapture ¶
type GraphicsCapture struct { Header *Header Commands []api.Cmd APIs []api.API Observed interval.U64RangeList InitialState *InitialState Messages []*TraceMessage // contains filtered or unexported fields }
func NewGraphicsCapture ¶
func NewGraphicsCapture(ctx context.Context, name string, header *Header, initialState *InitialState, cmds []api.Cmd) (*GraphicsCapture, error)
NewGraphicsCapture returns a new graphics capture with the given values.
func ResolveGraphics ¶
func ResolveGraphics(ctx context.Context) (*GraphicsCapture, error)
ResolveGraphics resolves the capture from a context previously annotated by Put, and ensures that it is a graphics capture.
func ResolveGraphicsFromID ¶
ResolveGraphicsFromID resolves a single graphics capture with the ID id.
func ResolveGraphicsFromPath ¶
ResolveGraphicsFromPath resolves a single graphics capture with the path p.
func (*GraphicsCapture) CloneInitialState ¶
func (c *GraphicsCapture) CloneInitialState() *InitialState
CloneInitialState clones this capture's initial state and returns it.
func (*GraphicsCapture) Export ¶
Export encodes the given capture and associated resources and writes it to the supplied io.Writer in the .gfxtrace format.
func (*GraphicsCapture) Name ¶
func (g *GraphicsCapture) Name() string
Name returns the capture's name.
func (*GraphicsCapture) NewState ¶
func (c *GraphicsCapture) NewState(ctx context.Context) *api.GlobalState
NewState returns a new, initialized GlobalState object built for the capture c. If the capture contains a mid-execution state, then this will be copied into the returned state.
func (*GraphicsCapture) NewUninitializedState ¶
func (c *GraphicsCapture) NewUninitializedState(ctx context.Context) *api.GlobalState
NewUninitializedState returns a new, uninitialized GlobalState built for the capture c. The returned state does not contain the capture's mid-execution state.
func (*GraphicsCapture) NewUninitializedStateSharingAllocator ¶
func (c *GraphicsCapture) NewUninitializedStateSharingAllocator(ctx context.Context, oldGlobalState *api.GlobalState) *api.GlobalState
type InitialState ¶
type PerfettoCapture ¶
type PerfettoCapture struct { Processor *perfetto.Processor // contains filtered or unexported fields }
func ResolvePerfetto ¶
func ResolvePerfetto(ctx context.Context) (*PerfettoCapture, error)
ResolvePerfetto resolves the capture from a context previously annotated by Put, and ensures that it is a perfetto capture.
func ResolvePerfettoFromID ¶
ResolvePerfettoFromID resolves a single perfetto capture with the ID id.
func ResolvePerfettoFromPath ¶
ResolvePerfettoFromPath resolves a single perfetto capture with the path p.
func (*PerfettoCapture) Name ¶
func (c *PerfettoCapture) Name() string
type Source ¶
type Source interface { // ReadCloser returns an io.ReadCloser instance, from which capture data // can be read and closed after reading. ReadCloser() (io.ReadCloser, error) // Size returns the total size in bytes of this source. Size() (uint64, error) }
Source represents the source of capture data.