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, src Source) (*path.Capture, error)
- func New(ctx context.Context, a arena.Arena, name string, header *Header, ...) (*path.Capture, error)
- func NewState(ctx context.Context) (*api.GlobalState, error)
- func Put(ctx context.Context, c *path.Capture) context.Context
- type Capture
- func (c *Capture) CloneInitialState(a arena.Arena) *InitialState
- func (c *Capture) Export(ctx context.Context, w io.Writer) error
- func (c *Capture) NewState(ctx context.Context) *api.GlobalState
- func (c *Capture) NewUninitializedState(ctx context.Context) *api.GlobalState
- func (c *Capture) Service(ctx context.Context, p *path.Capture) *service.Capture
- type ErrUnsupportedVersion
- type InitialState
- type Source
Constants ¶
const ( // CurrentCaptureVersion is incremented on breaking changes to the capture format. // NB: Also update equally named field in spy_base.cpp CurrentCaptureVersion int32 = 3 )
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.
func New ¶
func New(ctx context.Context, a arena.Arena, name string, header *Header, initialState *InitialState, cmds []api.Cmd) (*path.Capture, error)
New returns a path to a new capture with the given name, header and commands, using the arena a for allocations. The new capture is stored in the database.
Types ¶
type Capture ¶
type Capture struct { Name string Header *Header Commands []api.Cmd APIs []api.API Observed interval.U64RangeList InitialState *InitialState Arena arena.Arena Messages []*TraceMessage }
func ResolveFromID ¶
ResolveFromID resolves a single capture with the ID id.
func ResolveFromPath ¶
ResolveFromPath resolves a single capture with the path p.
func (*Capture) CloneInitialState ¶ added in v1.3.1
func (c *Capture) CloneInitialState(a arena.Arena) *InitialState
CloneInitialState clones this capture's initial state and returns it.
func (*Capture) Export ¶
Export encodes the given capture and associated resources and writes it to the supplied io.Writer in the .gfxtrace format.
func (*Capture) NewState ¶
func (c *Capture) 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 (*Capture) NewUninitializedState ¶ added in v0.9.6
func (c *Capture) 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.
type ErrUnsupportedVersion ¶ added in v0.9.0
type ErrUnsupportedVersion struct{ Version int32 }
func (ErrUnsupportedVersion) Error ¶ added in v0.9.0
func (e ErrUnsupportedVersion) Error() string