Add total GPU usage report into dumpsys meminfo output

With latest kernel changes, total GPU memory usage is reported and can
be obtained via a BPF program. Create JNI interface to query it and
report inside dumpsys meminfo output.

Bug: 171261987
Test: dumpsys meminfo
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Merged-In: I949a13836d5b5bc87fc43f60871b4fbf2add6480
Change-Id: I949a13836d5b5bc87fc43f60871b4fbf2add6480
This commit is contained in:
Suren Baghdasaryan
2020-10-23 09:31:54 -07:00
parent 4c7a71448d
commit aee45ee0bc
3 changed files with 30 additions and 0 deletions

View File

@@ -2575,6 +2575,13 @@ public final class Debug
*/
public static native long getIonMappedSizeKb();
/**
* Return memory size in kilobytes used by GPU.
*
* @hide
*/
public static native long getGpuTotalUsageKb();
/**
* Return whether virtually-mapped kernel stacks are enabled (CONFIG_VMAP_STACK).
* Note: caller needs config_gz read sepolicy permission