Documentation ¶
Overview ¶
Package layout is used to find parts of the application package to load or run. It can use the running executable directory, or other supplied locations, and find files targeted to a specific abi.
Index ¶
- Constants
- func AllLayers() []string
- func DeviceInfo(ctx context.Context, os device.OSKind) (file.Path, error)
- func GapidApk(ctx context.Context, abi *device.ABI) (file.Path, error)
- func Gapir(ctx context.Context, abi *device.ABI) (file.Path, error)
- func Gapis(ctx context.Context) (file.Path, error)
- func Gapit(ctx context.Context) (file.Path, error)
- func GoArgs(ctx context.Context) []string
- func Json(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error)
- func LayerFromDataSource(name string) (string, error)
- func Library(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error)
- func LibraryName(lib LibraryType, abi *device.ABI) string
- func PerfettoCmd(ctx context.Context, abi *device.ABI) (file.Path, error)
- func Strings(ctx context.Context) (file.Path, error)
- type FileLayout
- type LibraryType
- type ZipLayout
- func (l *ZipLayout) DeviceInfo(ctx context.Context, os device.OSKind) (*zip.File, error)
- func (l *ZipLayout) GapidApk(ctx context.Context, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) Gapir(ctx context.Context, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) Gapis(ctx context.Context) (*zip.File, error)
- func (l *ZipLayout) Gapit(ctx context.Context) (*zip.File, error)
- func (l *ZipLayout) Json(ctx context.Context, lib LibraryType, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) Library(ctx context.Context, lib LibraryType, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) PerfettoCmd(ctx context.Context, abi *device.ABI) (*zip.File, error)
- func (l *ZipLayout) Strings(ctx context.Context) (*zip.File, error)
Constants ¶
const ( ErrCannotFindPackageFiles = fault.Const("Cannot find package files") ErrUnknownABI = fault.Const("Unknown device ABI: %+v") )
Variables ¶
This section is empty.
Functions ¶
func DeviceInfo ¶
DeviceInfo returns the device info executable for the given ABI.
func LayerFromDataSource ¶
Returns a layer name from a data source name
func LibraryName ¶
func LibraryName(lib LibraryType, abi *device.ABI) string
LibraryName returns the filename of the given Library.
func PerfettoCmd ¶
PerfettoCmd returns the device info executable for the given ABI.
Types ¶
type FileLayout ¶
type FileLayout interface { // Strings returns the path to the binary string table. Strings(ctx context.Context) (file.Path, error) // Gapit returns the path to the gapit binary in this layout. Gapit(ctx context.Context) (file.Path, error) // Gapis returns the path to the gapis binary in this layout. Gapis(ctx context.Context) (file.Path, error) // Gapir returns the path to the gapir binary in this layout. Gapir(ctx context.Context, abi *device.ABI) (file.Path, error) // GapidApk returns the path to gapid.apk in this layout. GapidApk(ctx context.Context, abi *device.ABI) (file.Path, error) // PerfettoCmd returns the path to the perfetto command-line tool PerfettoCmd(ctx context.Context, abi *device.ABI) (file.Path, error) // Library returns the path to the requested library. Library(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error) // Json returns the path to the Vulkan layer JSON definition for the given library. Json(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error) // GoArgs returns additional arguments to pass to go binaries. GoArgs(ctx context.Context) []string // DeviceInfo returns the device info executable for the given ABI. DeviceInfo(ctx context.Context, os device.OSKind) (file.Path, error) }
FileLayout provides a unified way of accessing various Gapid binaries.
func NewPkgLayout ¶
func NewPkgLayout(dir file.Path, create bool) (FileLayout, error)
NewPkgLayout returns a FileLayout rooted at the given directory with the standard package layout. If create is true, the package layout is created if it doesn't exist, otherwise an error is returned.
func RunfilesLayout ¶
func RunfilesLayout(manifest file.Path) (FileLayout, error)
RunfilesLayout creates a new layout based on the given runfiles manifest.
type LibraryType ¶
type LibraryType int
LibraryType enumerates the possible GAPID dynamic libraries.
const ( LibGraphicsSpy LibraryType = iota LibVirtualSwapChain LibCPUTiming LibMemoryTracker )
func LibraryFromLayerName ¶
func LibraryFromLayerName(name string) (LibraryType, error)
Returns a library from a given LayerName
type ZipLayout ¶
type ZipLayout struct {
// contains filtered or unexported fields
}
ZipLayout is a FileLayout view over a ZIP file.
func NewZipLayout ¶
NewZipLayout returns a new ZipLayout using the given ZIP file.
func (*ZipLayout) DeviceInfo ¶
DeviceInfo returns the device info executable for the given ABI.
func (*ZipLayout) Json ¶
Json returns the path to the Vulkan layer JSON definition for the given library.
func (*ZipLayout) Library ¶
func (l *ZipLayout) Library(ctx context.Context, lib LibraryType, abi *device.ABI) (*zip.File, error)
Library returns the path to the requested library.
func (*ZipLayout) PerfettoCmd ¶
PerfettoCmd returns the device info executable for the given ABI.