summaryrefslogtreecommitdiff
path: root/core/java/android/os/Debug.java
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-11-25 19:24:46 -0800
committerSuren Baghdasaryan <surenb@google.com>2019-12-19 15:27:05 +0000
commit5bf4706ed1a242b32e1686a2a9288acb57fdf559 (patch)
tree9cbf5a36cf65ce84d3b31e91d45b4d3617d137fc /core/java/android/os/Debug.java
parent8ffc40aa01763f145c4ecf7ab83bf1ac08a985df (diff)
Add JNI API to query sizes of ION heaps, pools and mapped part of the heaps
Provide means for system_server to query ION memory usage. The new API allows to get total size of ION heaps, pools and part of ION heaps that is mapped into user space. Bug: 138148041 Test: dumpsys meminfo Change-Id: I6d76d534bbab5ee1646e8e3e3fe5210dcf76bc23 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Diffstat (limited to 'core/java/android/os/Debug.java')
-rw-r--r--core/java/android/os/Debug.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index e34b5238aee5..9b707484cfe0 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -2567,4 +2567,27 @@ public final class Debug
* @hide
*/
public static native long getZramFreeKb();
+
+ /**
+ * Return memory size in kilobytes allocated for ION heaps.
+ *
+ * @hide
+ */
+ public static native long getIonHeapsSizeKb();
+
+ /**
+ * Return memory size in kilobytes allocated for ION pools.
+ *
+ * @hide
+ */
+ public static native long getIonPoolsSizeKb();
+
+ /**
+ * Return ION memory mapped by processes in kB.
+ * Notes:
+ * * Warning: Might impact performance as it reads /proc/<pid>/maps files for each process.
+ *
+ * @hide
+ */
+ public static native long getIonMappedSizeKb();
}