summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/os/Debug.java16
-rw-r--r--core/jni/android_os_Debug.cpp7
-rw-r--r--services/core/java/com/android/server/stats/pull/StatsPullAtomService.java15
-rw-r--r--services/core/java/com/android/server/stats/pull/SystemMemoryUtil.java26
4 files changed, 62 insertions, 2 deletions
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index 399f11b0f2a7..a31c2e6693b6 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -1956,7 +1956,21 @@ public final class Debug
/** @hide */
public static final int MEMINFO_UNEVICTABLE = 18;
/** @hide */
- public static final int MEMINFO_COUNT = 19;
+ public static final int MEMINFO_AVAILABLE = 19;
+ /** @hide */
+ public static final int MEMINFO_ACTIVE_ANON = 20;
+ /** @hide */
+ public static final int MEMINFO_INACTIVE_ANON = 21;
+ /** @hide */
+ public static final int MEMINFO_ACTIVE_FILE = 22;
+ /** @hide */
+ public static final int MEMINFO_INACTIVE_FILE = 23;
+ /** @hide */
+ public static final int MEMINFO_CMA_TOTAL = 24;
+ /** @hide */
+ public static final int MEMINFO_CMA_FREE = 25;
+ /** @hide */
+ public static final int MEMINFO_COUNT = 26;
/**
* 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 5e0d9b32380c..fe957624cf4b 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -587,6 +587,13 @@ enum {
MEMINFO_ACTIVE,
MEMINFO_INACTIVE,
MEMINFO_UNEVICTABLE,
+ MEMINFO_AVAILABLE,
+ MEMINFO_ACTIVE_ANON,
+ MEMINFO_INACTIVE_ANON,
+ MEMINFO_ACTIVE_FILE,
+ MEMINFO_INACTIVE_FILE,
+ MEMINFO_CMA_TOTAL,
+ MEMINFO_CMA_FREE,
MEMINFO_COUNT
};
diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
index c379abc72dc0..6c616e0584df 100644
--- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
+++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
@@ -2408,7 +2408,20 @@ public class StatsPullAtomService extends SystemService {
metrics.gpuTotalUsageKb,
metrics.gpuPrivateAllocationsKb,
metrics.dmaBufTotalExportedKb,
- metrics.shmemKb));
+ metrics.shmemKb,
+ metrics.totalKb,
+ metrics.freeKb,
+ metrics.availableKb,
+ metrics.activeKb,
+ metrics.inactiveKb,
+ metrics.activeAnonKb,
+ metrics.inactiveAnonKb,
+ metrics.activeFileKb,
+ metrics.inactiveFileKb,
+ metrics.swapTotalKb,
+ metrics.swapFreeKb,
+ metrics.cmaTotalKb,
+ metrics.cmaFreeKb));
return StatsManager.PULL_SUCCESS;
}
diff --git a/services/core/java/com/android/server/stats/pull/SystemMemoryUtil.java b/services/core/java/com/android/server/stats/pull/SystemMemoryUtil.java
index 9ebf59ef8363..2ab4fdf77232 100644
--- a/services/core/java/com/android/server/stats/pull/SystemMemoryUtil.java
+++ b/services/core/java/com/android/server/stats/pull/SystemMemoryUtil.java
@@ -83,6 +83,19 @@ final class SystemMemoryUtil {
result.pageTablesKb = (int) mInfos[Debug.MEMINFO_PAGE_TABLES];
result.kernelStackKb = (int) mInfos[Debug.MEMINFO_KERNEL_STACK];
result.shmemKb = (int) mInfos[Debug.MEMINFO_SHMEM];
+ result.totalKb = (int) mInfos[Debug.MEMINFO_TOTAL];
+ result.freeKb = (int) mInfos[Debug.MEMINFO_FREE];
+ result.availableKb = (int) mInfos[Debug.MEMINFO_AVAILABLE];
+ result.activeKb = (int) mInfos[Debug.MEMINFO_ACTIVE];
+ result.inactiveKb = (int) mInfos[Debug.MEMINFO_INACTIVE];
+ result.activeAnonKb = (int) mInfos[Debug.MEMINFO_ACTIVE_ANON];
+ result.inactiveAnonKb = (int) mInfos[Debug.MEMINFO_INACTIVE_ANON];
+ result.activeFileKb = (int) mInfos[Debug.MEMINFO_ACTIVE_FILE];
+ result.inactiveFileKb = (int) mInfos[Debug.MEMINFO_INACTIVE_FILE];
+ result.swapTotalKb = (int) mInfos[Debug.MEMINFO_SWAP_TOTAL];
+ result.swapFreeKb = (int) mInfos[Debug.MEMINFO_SWAP_FREE];
+ result.cmaTotalKb = (int) mInfos[Debug.MEMINFO_CMA_TOTAL];
+ result.cmaFreeKb = (int) mInfos[Debug.MEMINFO_CMA_FREE];
result.totalIonKb = totalIonKb;
result.gpuTotalUsageKb = gpuTotalUsageKb;
result.gpuPrivateAllocationsKb = gpuPrivateAllocationsKb;
@@ -97,6 +110,19 @@ final class SystemMemoryUtil {
public int pageTablesKb;
public int kernelStackKb;
public int shmemKb;
+ public int totalKb;
+ public int freeKb;
+ public int availableKb;
+ public int activeKb;
+ public int inactiveKb;
+ public int activeAnonKb;
+ public int inactiveAnonKb;
+ public int activeFileKb;
+ public int inactiveFileKb;
+ public int swapTotalKb;
+ public int swapFreeKb;
+ public int cmaTotalKb;
+ public int cmaFreeKb;
public int totalIonKb;
public int gpuTotalUsageKb;
public int gpuPrivateAllocationsKb;