Merge change 20779 into donut

* changes:
  DO NOT MERGE. This is merged from master. Fix couple of bugs in the meminfo report.  . added the new "/data/dalvik-cache/" to dalvik heap  . shortened the starting line's length from 40 to 30 to handle the case where there is no name  . fixed the pri/shared for others. It was swapped.
This commit is contained in:
Android (Google) Code Review
2009-08-11 12:47:36 -07:00

View File

@@ -129,6 +129,8 @@ static void read_mapinfo(FILE *fp, stats_t* stats)
isDalvikHeap = 1; isDalvikHeap = 1;
} else if (strstr(line, "/dalvik-heap-bitmap/")) { } else if (strstr(line, "/dalvik-heap-bitmap/")) {
isDalvikHeap = 1; isDalvikHeap = 1;
} else if (strstr(line, "/data/dalvik-cache/")) {
isDalvikHeap = 1;
} else if (strstr(line, "/tmp/sqlite-heap")) { } else if (strstr(line, "/tmp/sqlite-heap")) {
isSqliteHeap = 1; isSqliteHeap = 1;
} }
@@ -158,9 +160,9 @@ static void read_mapinfo(FILE *fp, stats_t* stats)
private_dirty = temp; private_dirty = temp;
} else if (sscanf(line, "Referenced: %d kB", &temp) == 1) { } else if (sscanf(line, "Referenced: %d kB", &temp) == 1) {
referenced = temp; referenced = temp;
} else if (strlen(line) > 40 && line[8] == '-' && line[17] == ' ') { } else if (strlen(line) > 30 && line[8] == '-' && line[17] == ' ') {
// looks like a new mapping // looks like a new mapping
// example: "0000a000-00232000 rwxp 0000a000 00:00 0 [heap]" // example: "10000000-10001000 ---p 10000000 00:00 0"
break; break;
} }
} }
@@ -178,8 +180,8 @@ static void read_mapinfo(FILE *fp, stats_t* stats)
// ignore // ignore
} else { } else {
stats->otherPss += pss; stats->otherPss += pss;
stats->otherPrivateDirty += shared_dirty; stats->otherPrivateDirty += private_dirty;
stats->otherSharedDirty += private_dirty; stats->otherSharedDirty += shared_dirty;
} }
} }
} }