Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f4a2ce5 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Fix dumpsys meminfo -c output.

Also, this is supposed to be a "machine-parseable" format,
but it's not versioned at all. Added a version field so we
can change the format in the future if desired.

Change-Id: I6aa8ea46e030def04dc10634d01557a044545a9b
parent 0ab80e6c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -14894,7 +14894,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                pw.println(mi.hasActivities ? ",a" : ",e");
            } else {
                pw.print(tag); pw.print(","); pw.print(mi.shortLabel); pw.print(",");
                pw.println(mi.pss); pw.print(dumpSwapPss ? mi.swapPss : "N/A");
                pw.print(mi.pss); pw.print(","); pw.println(dumpSwapPss ? mi.swapPss : "N/A");
            }
            if (mi.subitems != null) {
                dumpMemItems(pw, prefix + "    ", mi.shortLabel, mi.subitems,
@@ -14959,6 +14959,9 @@ public final class ActivityManagerService extends ActivityManagerNative
    private final void dumpApplicationMemoryUsageHeader(PrintWriter pw, long uptime,
            long realtime, boolean isCheckinRequest, boolean isCompact) {
        if (isCompact) {
            pw.print("version,"); pw.println(MEMINFO_COMPACT_VERSION);
        }
        if (isCheckinRequest || isCompact) {
            // short checkin version
            pw.print("time,"); pw.print(uptime); pw.print(","); pw.println(realtime);
@@ -15017,6 +15020,9 @@ public final class ActivityManagerService extends ActivityManagerNative
        return stringifySize(size * 1024, 1024);
    }
    // Update this version number in case you change the 'compact' format
    private static final int MEMINFO_COMPACT_VERSION = 1;
    final void dumpApplicationMemoryUsage(FileDescriptor fd,
            PrintWriter pw, String prefix, String[] args, boolean brief, PrintWriter categoryPw) {
        boolean dumpDetails = false;