summaryrefslogtreecommitdiff
path: root/memtrack
diff options
context:
space:
mode:
authorKalesh Singh <kaleshsingh@google.com>2021-03-02 18:06:38 -0500
committerKalesh Singh <kaleshsingh@google.com>2021-03-02 19:39:27 -0500
commitd02d2c40606ac77b0e3785fd69327419782d07e0 (patch)
treec98e6665583ac895701fe2521bd42ca00ebe098e /memtrack
parent06811c8124c8e724ed4a41ae54a33a6b97981f4d (diff)
Memtrack HAL: Update documentation
Detail what is expected to be returned by the different memtrack types. Add what the device name is expected to be in getGpuDeviceInfo() Bug: 181704406 Test: N/A Change-Id: I5e9fe0bf5e630a8a0ec8394fa4f508657e4a56a7
Diffstat (limited to 'memtrack')
-rw-r--r--memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl21
1 files changed, 20 insertions, 1 deletions
diff --git a/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl b/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl
index 18587ee770..e78d4d7c32 100644
--- a/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl
+++ b/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl
@@ -30,6 +30,22 @@ import android.hardware.memtrack.MemtrackType;
* GL, graphics, etc. All memory sizes must be in real memory usage,
* accounting for stride, bit depth, rounding up to page size, etc.
*
+ * The following getMemory() categories are important for memory accounting in
+ * `dumpsys meminfo` and should be reported as described below:
+ *
+ * - MemtrackType::GRAPHICS and MemtrackRecord::FLAG_SMAPS_UNACCOUNTED
+ * This should report the PSS of all DMA buffers mapped by the process
+ * with the specified PID. This PSS can be calculated using ReadDmaBufPss()
+ * form libdmabufinfo.
+ *
+ * - MemtrackType::GL and MemtrackRecord::FLAG_SMAPS_UNACCOUNTED
+ * This category should report all GPU private allocations for the specified
+ * PID that are not accounted in /proc/<pid>/smaps.
+ *
+ * - MemtrackType::OTHER and MemtrackRecord::FLAG_SMAPS_UNACCOUNTED
+ * Any other memory not accounted for in /proc/<pid>/smaps if any, otherwise
+ * this should return 0.
+ *
* Constructor for the interface should be used to perform memtrack management
* setup actions and must be called once before any calls to getMemory().
*/
@@ -76,7 +92,10 @@ interface IMemtrack {
* This information is used to identify GPU devices for GPU specific
* memory accounting (e.g. DMA buffer usage).
*
+ * The device name(s) provided in getGpuDeviceInfo() must match the
+ * device name in the corresponding device(s) sysfs entry.
+ *
* @return vector of DeviceInfo populated for all GPU devices.
*/
- DeviceInfo[] getGpuDeviceInfo();
+ DeviceInfo[] getGpuDeviceInfo();
}