parse named anonymous memory for dumpsys meminfo

Treat [anon:libc_malloc] as native heap and anything else that
starts with [anon: as unknown.

Bug: 10212959
Change-Id: Ifd120ae86e7a22291383df37d2b96f9f2dcd68b9
This commit is contained in:
Colin Cross
2013-08-09 13:23:46 -07:00
committed by Colin Cross
parent d81a15c6b7
commit cb4728f247

View File

@@ -220,6 +220,8 @@ static void read_mapinfo(FILE *fp, stats_t* stats)
} else {
whichHeap = HEAP_ASHMEM;
}
} else if (strncmp(name, "[anon:libc_malloc]", 18) == 0) {
whichHeap = HEAP_NATIVE;
} else if (strncmp(name, "[stack", 6) == 0) {
whichHeap = HEAP_STACK;
} else if (strncmp(name, "/dev/", 5) == 0) {
@@ -246,6 +248,8 @@ static void read_mapinfo(FILE *fp, stats_t* stats)
} else if (nameLen > 4 && strcmp(name+nameLen-4, ".art") == 0) {
whichHeap = HEAP_ART;
is_swappable = true;
} else if (strncmp(name, "[anon:", 6) == 0) {
whichHeap = HEAP_UNKNOWN;
} else if (nameLen > 0) {
whichHeap = HEAP_UNKNOWN_MAP;
} else if (start == prevEnd && prevHeap == HEAP_SO) {