Package: android.hardware.memtrack@1.0

types

Properties

MemtrackFlag

enum MemtrackFlag: uint32_t

SMAPS_ACCOUNTED/SMAPS_UNACCOUNTED Flags to differentiate memory that can already be accounted for in /proc/<pid>/smaps , (Shared_Clean + Shared_Dirty + Private_Clean + Private_Dirty = Size). In general, memory mapped in to a userspace process is accounted unless it was mapped with remap_pfn_range.Exactly one of these must be set.

SHARED/SHARED_PSS/PRIVATE Flags to differentiate memory shared across multiple processes vs.memory used by a single process.If SHARED_PSS flags is used, the memory must be divided by the number of processes holding reference to it(shared / num_processes). Only zero or one of these may be set in a record.If none are set, record is assumed to count shared + private memory.

SYSTEM/DEDICATED Flags to differentiate memory taken from the kernel's allocation pool vs.memory that is dedicated to non-kernel allocations, for example a carveout or separate video memory.Only zero or one of these may be set in a record.If none are set, record is assumed to count system + dedicated memory.

NONSECURE/SECURE Flags to differentiate memory accessible by the CPU in non-secure mode vs.memory that is protected.Only zero or one of these may be set in a record.If none are set, record is assumed to count secure + nonsecure memory.

Details
Members
SMAPS_ACCOUNTED = 1 << 1
SMAPS_UNACCOUNTED = 1 << 2
SHARED = 1 << 3
SHARED_PSS = 1 << 4
PRIVATE = 1 << 5
SYSTEM = 1 << 6
DEDICATED = 1 << 7
NONSECURE = 1 << 8
SECURE = 1 << 9

MemtrackType

enum MemtrackType: uint32_t

Tags which define the usage of the memory buffers.

Details
Members
OTHER = 0
GL = 1
GRAPHICS = 2
MULTIMEDIA = 3
CAMERA = 4
NUM_TYPES

MemtrackStatus

enum MemtrackStatus: uint32_t
Details
Members
SUCCESS = 0
MEMORY_TRACKING_NOT_SUPPORTED = 1
TYPE_NOT_SUPPORTED = 2

MemtrackRecord

struct MemtrackRecord {uint64_t sizeInBytes; uint32_t flags}
Details
Members
sizeInBytes
flags
This is the bitfield for the MemtrackFlag indicating all the flags that are valid for this record.