Merge "Add additional meminfo fields to SystemMemory"

This commit is contained in:
Kevin Jeon
2022-12-12 16:09:45 +00:00
committed by Android (Google) Code Review
4 changed files with 62 additions and 2 deletions

View File

@@ -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

View File

@@ -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
};

View File

@@ -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;
}

View File

@@ -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;