Skip to content

Commit 91c2b5c

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Improve low memory reporting." into ics-mr1
2 parents 9058435 + 8ec8d41 commit 91c2b5c

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

services/java/com/android/server/am/ActivityManagerService.java

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,14 @@ public void handleMessage(Message msg) {
12481248
PrintWriter pw = new PrintWriter(sw);
12491249
StringWriter catSw = new StringWriter();
12501250
PrintWriter catPw = new PrintWriter(catSw);
1251-
dumpApplicationMemoryUsage(null, pw, " ", new String[] { }, true, catPw);
1251+
String[] emptyArgs = new String[] { };
1252+
dumpApplicationMemoryUsage(null, pw, " ", emptyArgs, true, catPw);
1253+
pw.println();
1254+
dumpProcessesLocked(null, pw, emptyArgs, 0, false);
1255+
pw.println();
1256+
dumpServicesLocked(null, pw, emptyArgs, 0, false, false);
1257+
pw.println();
1258+
dumpActivitiesLocked(null, pw, emptyArgs, 0, false, false);
12521259
String memUsage = sw.toString();
12531260
dropBuilder.append('\n');
12541261
dropBuilder.append(memUsage);
@@ -8789,6 +8796,20 @@ boolean dumpServicesLocked(FileDescriptor fd, PrintWriter pw, String[] args,
87898796
TimeUtils.formatDuration(r.createTime, nowReal, pw);
87908797
pw.print(" started="); pw.print(r.startRequested);
87918798
pw.print(" connections="); pw.println(r.connections.size());
8799+
if (r.connections.size() > 0) {
8800+
pw.println(" Connections:");
8801+
for (ArrayList<ConnectionRecord> clist : r.connections.values()) {
8802+
for (int i=0; i<clist.size(); i++) {
8803+
ConnectionRecord conn = clist.get(i);
8804+
pw.print(" ");
8805+
pw.print(conn.binding.intent.intent.getIntent().toShortString(
8806+
false, false, false));
8807+
pw.print(" -> ");
8808+
ProcessRecord proc = conn.binding.client;
8809+
pw.println(proc != null ? proc.toShortString() : "null");
8810+
}
8811+
}
8812+
}
87928813
}
87938814
if (dumpClient && r.app != null && r.app.thread != null) {
87948815
pw.println(" Client:");
@@ -8908,18 +8929,21 @@ boolean dumpProvidersLocked(FileDescriptor fd, PrintWriter pw, String[] args,
89088929
continue;
89098930
}
89108931
pw.print(" * "); pw.print(cls); pw.print(" (");
8911-
pw.print(comp.flattenToShortString()); pw.print(")");
8932+
pw.print(comp.flattenToShortString()); pw.println(")");
89128933
if (dumpAll) {
8913-
pw.println();
89148934
r.dump(pw, " ");
89158935
} else {
8916-
pw.print(" * "); pw.print(e.getKey().flattenToShortString());
89178936
if (r.proc != null) {
8918-
pw.println(":");
89198937
pw.print(" "); pw.println(r.proc);
89208938
} else {
89218939
pw.println();
89228940
}
8941+
if (r.clients.size() > 0) {
8942+
pw.println(" Clients:");
8943+
for (ProcessRecord cproc : r.clients) {
8944+
pw.print(" - "); pw.println(cproc);
8945+
}
8946+
}
89238947
}
89248948
}
89258949
needSep = true;

services/java/com/android/server/am/ContentProviderRecord.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ void dump(PrintWriter pw, String prefix) {
7474
pw.print(" initOrder="); pw.println(info.initOrder);
7575
}
7676
if (clients.size() > 0) {
77+
pw.print(prefix); pw.println("Clients:");
78+
for (ProcessRecord cproc : clients) {
79+
pw.print(prefix); pw.println(" - "); pw.println(cproc);
80+
}
7781
pw.print(prefix); pw.print("clients="); pw.println(clients);
7882
}
7983
if (externals != 0) {

0 commit comments

Comments
 (0)