summaryrefslogtreecommitdiff
path: root/core/java/android/os/Debug.java
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-12-18 09:52:42 -0800
committerSuren Baghdasaryan <surenb@google.com>2020-01-02 13:36:34 -0800
commit2018bf03f9fd96aa0326d74f23abdbaa3d4ee143 (patch)
tree6fd16205a305b31a8a5b60c6f7eb23c6df1d7b68 /core/java/android/os/Debug.java
parent5a049f5cf22d2eb5c7c4974fbf282427cb418ece (diff)
Prevent double-counting of kernel stack size in dumpsys reports
When kernel is configured with CONFIG_VMAP_STACK=y kernel stacks are mapped into process space and therefore already accounted as part of the value returned by ReadVmallocInfo and reported under MEMINFO_VM_ALLOC_USED category. Introduce isVmapStack function to check if kernel is configured with that option and if so do not exclude kernel stack size in the calculation of memory used by kernel. Bug: 146088882 Test: dumpsys meminfo with CONFIG_VMAP_STACK enabled and disabled Change-Id: I9230bbf0ab05524cf52ded35171fd9ec3da16fa0 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.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index 422761c4dca5..d7ed05577697 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -2526,4 +2526,12 @@ public final class Debug
* @hide
*/
public static native long getIonMappedSizeKb();
+
+ /**
+ * Return whether virtually-mapped kernel stacks are enabled (CONFIG_VMAP_STACK).
+ * Note: caller needs config_gz read sepolicy permission
+ *
+ * @hide
+ */
+ public static native boolean isVmapStack();
}