From f4f632f90f5b7d55b8463a1ed3a347ae9cfe1034 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Tue, 13 Jul 2021 01:45:41 +0000 Subject: [PATCH] Memtrack HAL: Report global total GPU-private memory Update memtrack hal documentation to allow reporting the global total GPU-private memory from the getMemory() API. Specify how to handle unsupported memtrack operations. Bug: 193226716 Bug: 193465681 Bug: 192621117 Test: N/A Change-Id: I6fcebd16fafdc34cc662137784e86750ee907eee Merged-In: I6fcebd16fafdc34cc662137784e86750ee907eee --- memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl b/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl index 13c3389730..88b090b68e 100644 --- a/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl +++ b/memtrack/aidl/android/hardware/memtrack/IMemtrack.aidl @@ -44,6 +44,12 @@ import android.hardware.memtrack.MemtrackType; * This category should report all GPU private allocations for the specified * PID that are not accounted in /proc//smaps. * + * getMemory() called with PID 0 should report the global total GPU-private + * memory, for MemtrackType::GL and MemtrackRecord::FLAG_SMAPS_UNACCOUNTED. + * + * getMemory() called with PID 0 for a MemtrackType other than GL should + * report 0. + * * - MemtrackType::OTHER and MemtrackRecord::FLAG_SMAPS_UNACCOUNTED * Any other memory not accounted for in /proc//smaps if any, otherwise * this should return 0. @@ -52,6 +58,9 @@ import android.hardware.memtrack.MemtrackType; * VM_PFNMAP flag set. For these mappings PSS and RSS are reported as 0 in smaps. * Such mappings have no backing page structs from which PSS/RSS can be calculated. * + * Any memtrack operation that is not supported should return a binder status with + * exception code EX_UNSUPPORTED_OPERATION. + * * Constructor for the interface should be used to perform memtrack management * setup actions and must be called once before any calls to getMemory(). */