Merge "Adjust and update dumpsys meminfo output."

This commit is contained in:
Nicolas Geoffray
2019-10-03 14:12:25 +00:00
committed by Gerrit Code Review
2 changed files with 31 additions and 17 deletions

View File

@@ -278,11 +278,13 @@ public final class Debug
/** @hide */ /** @hide */
public static final int OTHER_DALVIK_OTHER_ACCOUNTING = 22; public static final int OTHER_DALVIK_OTHER_ACCOUNTING = 22;
/** @hide */ /** @hide */
public static final int OTHER_DALVIK_OTHER_CODE_CACHE = 23; public static final int OTHER_DALVIK_OTHER_ZYGOTE_CODE_CACHE = 23;
/** @hide */ /** @hide */
public static final int OTHER_DALVIK_OTHER_COMPILER_METADATA = 24; public static final int OTHER_DALVIK_OTHER_APP_CODE_CACHE = 24;
/** @hide */ /** @hide */
public static final int OTHER_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE = 25; public static final int OTHER_DALVIK_OTHER_COMPILER_METADATA = 25;
/** @hide */
public static final int OTHER_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE = 26;
/** @hide */ /** @hide */
public static final int OTHER_DVK_STAT_DALVIK_OTHER_START = public static final int OTHER_DVK_STAT_DALVIK_OTHER_START =
OTHER_DALVIK_OTHER_LINEARALLOC - NUM_OTHER_STATS; OTHER_DALVIK_OTHER_LINEARALLOC - NUM_OTHER_STATS;
@@ -292,11 +294,11 @@ public final class Debug
// Dex subsections (Boot vdex, App dex, and App vdex). // Dex subsections (Boot vdex, App dex, and App vdex).
/** @hide */ /** @hide */
public static final int OTHER_DEX_BOOT_VDEX = 26; public static final int OTHER_DEX_BOOT_VDEX = 27;
/** @hide */ /** @hide */
public static final int OTHER_DEX_APP_DEX = 27; public static final int OTHER_DEX_APP_DEX = 28;
/** @hide */ /** @hide */
public static final int OTHER_DEX_APP_VDEX = 28; public static final int OTHER_DEX_APP_VDEX = 29;
/** @hide */ /** @hide */
public static final int OTHER_DVK_STAT_DEX_START = OTHER_DEX_BOOT_VDEX - NUM_OTHER_STATS; public static final int OTHER_DVK_STAT_DEX_START = OTHER_DEX_BOOT_VDEX - NUM_OTHER_STATS;
/** @hide */ /** @hide */
@@ -304,9 +306,9 @@ public final class Debug
// Art subsections (App image, boot image). // Art subsections (App image, boot image).
/** @hide */ /** @hide */
public static final int OTHER_ART_APP = 29; public static final int OTHER_ART_APP = 30;
/** @hide */ /** @hide */
public static final int OTHER_ART_BOOT = 30; public static final int OTHER_ART_BOOT = 31;
/** @hide */ /** @hide */
public static final int OTHER_DVK_STAT_ART_START = OTHER_ART_APP - NUM_OTHER_STATS; public static final int OTHER_DVK_STAT_ART_START = OTHER_ART_APP - NUM_OTHER_STATS;
/** @hide */ /** @hide */
@@ -314,7 +316,7 @@ public final class Debug
/** @hide */ /** @hide */
@UnsupportedAppUsage @UnsupportedAppUsage
public static final int NUM_DVK_STATS = 14; public static final int NUM_DVK_STATS = OTHER_ART_BOOT + 1 - OTHER_DALVIK_NORMAL;
/** @hide */ /** @hide */
public static final int NUM_CATEGORIES = 9; public static final int NUM_CATEGORIES = 9;
@@ -540,7 +542,8 @@ public final class Debug
case OTHER_DALVIK_NON_MOVING: return ".NonMoving"; case OTHER_DALVIK_NON_MOVING: return ".NonMoving";
case OTHER_DALVIK_OTHER_LINEARALLOC: return ".LinearAlloc"; case OTHER_DALVIK_OTHER_LINEARALLOC: return ".LinearAlloc";
case OTHER_DALVIK_OTHER_ACCOUNTING: return ".GC"; case OTHER_DALVIK_OTHER_ACCOUNTING: return ".GC";
case OTHER_DALVIK_OTHER_CODE_CACHE: return ".JITCache"; case OTHER_DALVIK_OTHER_ZYGOTE_CODE_CACHE: return ".ZygoteJIT";
case OTHER_DALVIK_OTHER_APP_CODE_CACHE: return ".AppJIT";
case OTHER_DALVIK_OTHER_COMPILER_METADATA: return ".CompilerMetadata"; case OTHER_DALVIK_OTHER_COMPILER_METADATA: return ".CompilerMetadata";
case OTHER_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE: return ".IndirectRef"; case OTHER_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE: return ".IndirectRef";
case OTHER_DEX_BOOT_VDEX: return ".Boot vdex"; case OTHER_DEX_BOOT_VDEX: return ".Boot vdex";
@@ -722,7 +725,9 @@ public final class Debug
+ getOtherPrivate(OTHER_APK) + getOtherPrivate(OTHER_APK)
+ getOtherPrivate(OTHER_TTF) + getOtherPrivate(OTHER_TTF)
+ getOtherPrivate(OTHER_DEX) + getOtherPrivate(OTHER_DEX)
+ getOtherPrivate(OTHER_OAT); + getOtherPrivate(OTHER_OAT)
+ getOtherPrivate(OTHER_DALVIK_OTHER_ZYGOTE_CODE_CACHE)
+ getOtherPrivate(OTHER_DALVIK_OTHER_APP_CODE_CACHE);
} }
/** /**

View File

@@ -85,7 +85,8 @@ enum {
// Dalvik other extra sections. // Dalvik other extra sections.
HEAP_DALVIK_OTHER_LINEARALLOC, HEAP_DALVIK_OTHER_LINEARALLOC,
HEAP_DALVIK_OTHER_ACCOUNTING, HEAP_DALVIK_OTHER_ACCOUNTING,
HEAP_DALVIK_OTHER_CODE_CACHE, HEAP_DALVIK_OTHER_ZYGOTE_CODE_CACHE,
HEAP_DALVIK_OTHER_APP_CODE_CACHE,
HEAP_DALVIK_OTHER_COMPILER_METADATA, HEAP_DALVIK_OTHER_COMPILER_METADATA,
HEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE, HEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE,
@@ -282,9 +283,10 @@ static void load_maps(int pid, stats_t* stats, bool* foundSwapPss)
is_swappable = true; is_swappable = true;
} else if (base::EndsWith(name, ".vdex")) { } else if (base::EndsWith(name, ".vdex")) {
which_heap = HEAP_DEX; which_heap = HEAP_DEX;
// Handle system@framework@boot and system/framework/boot // Handle system@framework@boot and system/framework/boot|apex
if ((strstr(name.c_str(), "@boot") != nullptr) || if ((strstr(name.c_str(), "@boot") != nullptr) ||
(strstr(name.c_str(), "/boot"))) { (strstr(name.c_str(), "/boot") != nullptr) ||
(strstr(name.c_str(), "/apex") != nullptr)) {
sub_heap = HEAP_DEX_BOOT_VDEX; sub_heap = HEAP_DEX_BOOT_VDEX;
} else { } else {
sub_heap = HEAP_DEX_APP_VDEX; sub_heap = HEAP_DEX_APP_VDEX;
@@ -295,9 +297,10 @@ static void load_maps(int pid, stats_t* stats, bool* foundSwapPss)
is_swappable = true; is_swappable = true;
} else if (base::EndsWith(name, ".art") || base::EndsWith(name, ".art]")) { } else if (base::EndsWith(name, ".art") || base::EndsWith(name, ".art]")) {
which_heap = HEAP_ART; which_heap = HEAP_ART;
// Handle system@framework@boot* and system/framework/boot* // Handle system@framework@boot* and system/framework/boot|apex*
if ((strstr(name.c_str(), "@boot") != nullptr) || if ((strstr(name.c_str(), "@boot") != nullptr) ||
(strstr(name.c_str(), "/boot"))) { (strstr(name.c_str(), "/boot") != nullptr) ||
(strstr(name.c_str(), "/apex") != nullptr)) {
sub_heap = HEAP_ART_BOOT; sub_heap = HEAP_ART_BOOT;
} else { } else {
sub_heap = HEAP_ART_APP; sub_heap = HEAP_ART_APP;
@@ -309,9 +312,15 @@ static void load_maps(int pid, stats_t* stats, bool* foundSwapPss)
which_heap = HEAP_GL_DEV; which_heap = HEAP_GL_DEV;
} else if (base::StartsWith(name, "/dev/ashmem/CursorWindow")) { } else if (base::StartsWith(name, "/dev/ashmem/CursorWindow")) {
which_heap = HEAP_CURSOR; which_heap = HEAP_CURSOR;
} else if (base::StartsWith(name, "/dev/ashmem/jit-zygote-cache")) {
which_heap = HEAP_DALVIK_OTHER;
sub_heap = HEAP_DALVIK_OTHER_ZYGOTE_CODE_CACHE;
} else if (base::StartsWith(name, "/dev/ashmem")) { } else if (base::StartsWith(name, "/dev/ashmem")) {
which_heap = HEAP_ASHMEM; which_heap = HEAP_ASHMEM;
} }
} else if (base::StartsWith(name, "/memfd:jit-cache")) {
which_heap = HEAP_DALVIK_OTHER;
sub_heap = HEAP_DALVIK_OTHER_APP_CODE_CACHE;
} else if (base::StartsWith(name, "[anon:")) { } else if (base::StartsWith(name, "[anon:")) {
which_heap = HEAP_UNKNOWN; which_heap = HEAP_UNKNOWN;
if (base::StartsWith(name, "[anon:dalvik-")) { if (base::StartsWith(name, "[anon:dalvik-")) {
@@ -339,7 +348,7 @@ static void load_maps(int pid, stats_t* stats, bool* foundSwapPss)
sub_heap = HEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE; sub_heap = HEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE;
} else if (base::StartsWith(name, "[anon:dalvik-jit-code-cache") || } else if (base::StartsWith(name, "[anon:dalvik-jit-code-cache") ||
base::StartsWith(name, "[anon:dalvik-data-code-cache")) { base::StartsWith(name, "[anon:dalvik-data-code-cache")) {
sub_heap = HEAP_DALVIK_OTHER_CODE_CACHE; sub_heap = HEAP_DALVIK_OTHER_APP_CODE_CACHE;
} else if (base::StartsWith(name, "[anon:dalvik-CompilerMetadata")) { } else if (base::StartsWith(name, "[anon:dalvik-CompilerMetadata")) {
sub_heap = HEAP_DALVIK_OTHER_COMPILER_METADATA; sub_heap = HEAP_DALVIK_OTHER_COMPILER_METADATA;
} else { } else {