Android Hardware Abstraction Layer
Data Structures | Macros | Typedefs | Enumerations
memtrack.h File Reference
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <hardware/hardware.h>

Go to the source code of this file.

Data Structures

struct  memtrack_record
 
struct  memtrack_module
 

Macros

#define MEMTRACK_MODULE_API_VERSION_0_1   HARDWARE_MODULE_API_VERSION(0, 1)
 
#define MEMTRACK_HARDWARE_MODULE_ID   "memtrack"
 
#define MEMTRACK_FLAG_SMAPS_ACCOUNTED   (1 << 1)
 
#define MEMTRACK_FLAG_SMAPS_UNACCOUNTED   (1 << 2)
 
#define MEMTRACK_FLAG_SHARED   (1 << 3)
 
#define MEMTRACK_FLAG_SHARED_PSS   (1 << 4) /* shared / num_procesess */
 
#define MEMTRACK_FLAG_PRIVATE   (1 << 5)
 
#define MEMTRACK_FLAG_SYSTEM   (1 << 6)
 
#define MEMTRACK_FLAG_DEDICATED   (1 << 7)
 
#define MEMTRACK_FLAG_NONSECURE   (1 << 8)
 
#define MEMTRACK_FLAG_SECURE   (1 << 9)
 

Typedefs

typedef struct memtrack_module memtrack_module_t
 

Enumerations

enum  memtrack_type {
  MEMTRACK_TYPE_OTHER = 0, MEMTRACK_TYPE_GL = 1, MEMTRACK_TYPE_GRAPHICS = 2, MEMTRACK_TYPE_MULTIMEDIA = 3,
  MEMTRACK_TYPE_CAMERA = 4, MEMTRACK_NUM_TYPES
}
 

Macro Definition Documentation

#define MEMTRACK_FLAG_DEDICATED   (1 << 7)

Definition at line 105 of file memtrack.h.

#define MEMTRACK_FLAG_NONSECURE   (1 << 8)

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.

Definition at line 112 of file memtrack.h.

#define MEMTRACK_FLAG_PRIVATE   (1 << 5)

Definition at line 96 of file memtrack.h.

#define MEMTRACK_FLAG_SECURE   (1 << 9)

Definition at line 113 of file memtrack.h.

#define MEMTRACK_FLAG_SHARED   (1 << 3)

Flags to differentiate memory shared across multiple processes vs. memory used by a single process. Only zero or one of these may be set in a record. If none are set, record is assumed to count shared + private memory.

Definition at line 94 of file memtrack.h.

#define MEMTRACK_FLAG_SHARED_PSS   (1 << 4) /* shared / num_procesess */

Definition at line 95 of file memtrack.h.

#define MEMTRACK_FLAG_SMAPS_ACCOUNTED   (1 << 1)

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 should be set.

Definition at line 86 of file memtrack.h.

#define MEMTRACK_FLAG_SMAPS_UNACCOUNTED   (1 << 2)

Definition at line 87 of file memtrack.h.

#define MEMTRACK_FLAG_SYSTEM   (1 << 6)

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.

Definition at line 104 of file memtrack.h.

#define MEMTRACK_HARDWARE_MODULE_ID   "memtrack"

The id of this module

Definition at line 33 of file memtrack.h.

#define MEMTRACK_MODULE_API_VERSION_0_1   HARDWARE_MODULE_API_VERSION(0, 1)

Definition at line 28 of file memtrack.h.

Typedef Documentation

Every hardware module must have a data structure named HAL_MODULE_INFO_SYM and the fields of this data structure must begin with hw_module_t followed by module specific information.

Enumeration Type Documentation

Enumerator
MEMTRACK_TYPE_OTHER 
MEMTRACK_TYPE_GL 
MEMTRACK_TYPE_GRAPHICS 
MEMTRACK_TYPE_MULTIMEDIA 
MEMTRACK_TYPE_CAMERA 
MEMTRACK_NUM_TYPES 

Definition at line 64 of file memtrack.h.