From 5f8e17b3ef5f258684b729ead30d95e9e4562c75 Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Sun, 17 Nov 2019 14:25:50 -0800 Subject: [PATCH] Include KReclaimable meminfo field into getMemInfo results With new KReclaimable stat available in /proc/meminfo include it in getMemInfo results so that it can be accounted in dumpsys meminfo reports. Bug: 138148041 Test: dumpsys meminfo Change-Id: Id475fcc0a63c6fc12ea64e08cec5cd24c83848a5 Signed-off-by: Suren Baghdasaryan --- core/java/android/os/Debug.java | 8 +++++++- core/jni/android_os_Debug.cpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java index 4ed7b17d15491..bf26a41c536af 100644 --- a/core/java/android/os/Debug.java +++ b/core/java/android/os/Debug.java @@ -1874,8 +1874,14 @@ public final class Debug public static final int MEMINFO_PAGE_TABLES = 13; /** @hide */ public static final int MEMINFO_KERNEL_STACK = 14; + /** + * Note: MEMINFO_KRECLAIMABLE includes MEMINFO_SLAB_RECLAIMABLE (see KReclaimable field + * description in kernel documentation). + * @hide + */ + public static final int MEMINFO_KRECLAIMABLE = 15; /** @hide */ - public static final int MEMINFO_COUNT = 15; + public static final int MEMINFO_COUNT = 16; /** * Retrieves /proc/meminfo. outSizes is filled with fields diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index 81957f577ef26..6aed1e8ffe606 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -560,6 +560,7 @@ enum { MEMINFO_VMALLOC_USED, MEMINFO_PAGE_TABLES, MEMINFO_KERNEL_STACK, + MEMINFO_KERNEL_RECLAIMABLE, MEMINFO_COUNT };