Help us shape the future of Go! Take the 2026 Go Developer Survey

memtrack

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIMemtrackGetMemory        = binder.FirstCallTransaction + 0
	TransactionIMemtrackGetGpuDeviceInfo = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodIMemtrackGetMemory        = "getMemory"
	MethodIMemtrackGetGpuDeviceInfo = "getGpuDeviceInfo"
)
View Source
const (
	MemtrackRecordFlagSmapsAccounted   int32 = (1 << 1)
	MemtrackRecordFlagSmapsUnaccounted int32 = (1 << 2)
	MemtrackRecordFlagShared           int32 = (1 << 3)
	MemtrackRecordFlagSharedPss        int32 = (1 << 4)
	MemtrackRecordFlagPrivate          int32 = (1 << 5)
	MemtrackRecordFlagSystem           int32 = (1 << 6)
	MemtrackRecordFlagDedicated        int32 = (1 << 7)
	MemtrackRecordFlagNonsecure        int32 = (1 << 8)
	MemtrackRecordFlagSecure           int32 = (1 << 9)
)
View Source
const DescriptorIMemtrack = "android.hardware.memtrack.IMemtrack"

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceInfo

type DeviceInfo struct {
	Id   int32
	Name string
}

func (*DeviceInfo) MarshalParcel

func (s *DeviceInfo) MarshalParcel(
	p *parcel.Parcel,
) error

func (*DeviceInfo) UnmarshalParcel

func (s *DeviceInfo) UnmarshalParcel(
	p *parcel.Parcel,
) error

type IMemtrack

type IMemtrack interface {
	AsBinder() binder.IBinder
	GetMemory(ctx context.Context, pid int32, type_ MemtrackType) ([]MemtrackRecord, error)
	GetGpuDeviceInfo(ctx context.Context) ([]DeviceInfo, error)
}

func NewMemtrackStub

func NewMemtrackStub(
	impl IMemtrackServer,
) IMemtrack

NewMemtrackStub creates a server-side IMemtrack wrapping the given server implementation. The returned value satisfies IMemtrack and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type IMemtrackServer

type IMemtrackServer interface {
	GetMemory(ctx context.Context, pid int32, type_ MemtrackType) ([]MemtrackRecord, error)
	GetGpuDeviceInfo(ctx context.Context) ([]DeviceInfo, error)
}

IMemtrackServer is the server-side interface that user implementations provide to NewMemtrackStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type MemtrackProxy

type MemtrackProxy struct {
	Remote binder.IBinder
}

func NewMemtrackProxy

func NewMemtrackProxy(
	remote binder.IBinder,
) *MemtrackProxy

func (*MemtrackProxy) AsBinder

func (p *MemtrackProxy) AsBinder() binder.IBinder

func (*MemtrackProxy) GetGpuDeviceInfo

func (p *MemtrackProxy) GetGpuDeviceInfo(
	ctx context.Context,
) ([]DeviceInfo, error)

func (*MemtrackProxy) GetMemory

func (p *MemtrackProxy) GetMemory(
	ctx context.Context,
	pid int32,
	type_ MemtrackType,
) ([]MemtrackRecord, error)

type MemtrackRecord

type MemtrackRecord struct {
	Flags       int32
	SizeInBytes int64
}

func (*MemtrackRecord) MarshalParcel

func (s *MemtrackRecord) MarshalParcel(
	p *parcel.Parcel,
) error

func (*MemtrackRecord) UnmarshalParcel

func (s *MemtrackRecord) UnmarshalParcel(
	p *parcel.Parcel,
) error

type MemtrackStub

type MemtrackStub struct {
	Impl      IMemtrack
	Transport binder.VersionAwareTransport
}

MemtrackStub dispatches incoming binder transactions to a typed IMemtrack implementation.

func (*MemtrackStub) Descriptor

func (s *MemtrackStub) Descriptor() string

func (*MemtrackStub) OnTransaction

func (s *MemtrackStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type MemtrackType

type MemtrackType int32
const (
	MemtrackTypeOTHER      MemtrackType = 0
	MemtrackTypeGL         MemtrackType = 1
	MemtrackTypeGRAPHICS   MemtrackType = 2
	MemtrackTypeMULTIMEDIA MemtrackType = 3
	MemtrackTypeCAMERA     MemtrackType = 4
)

Jump to

Keyboard shortcuts

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