diff options
| author | Joe Onorato <joeo@google.com> | 2010-10-21 14:54:19 -0400 |
|---|---|---|
| committer | Joe Onorato <joeo@google.com> | 2010-10-22 12:36:07 -0400 |
| commit | eb95b0877aa386938ed20e9429a211eac8b8b805 (patch) | |
| tree | 73ceba181879f8468b27bcaecc68358947e0f23d | |
| parent | 8d0083423ff338abdd6a4d74dd008409abaaa4fd (diff) | |
| download | frameworks_base-eb95b0877aa386938ed20e9429a211eac8b8b805.zip frameworks_base-eb95b0877aa386938ed20e9429a211eac8b8b805.tar.gz frameworks_base-eb95b0877aa386938ed20e9429a211eac8b8b805.tar.bz2 | |
Show app services in adb bugreport (dumpstate).
There is a 60s timeout for this command. I'd rather do it as an individual timeout
for each of the services, but this is easier and will probably cover for busted apps
well enough. Also, this is running last in dumpstate, so if it's lost... oh well.
Also, clean up the formatting of the service dump so it's more readable in bugreport.
Change-Id: Ibd727f4b3366f7af9e7ef1e231868f5cedc48132
| -rw-r--r-- | cmds/dumpstate/dumpstate.c | 8 | ||||
| -rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 23 |
2 files changed, 16 insertions, 15 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index 35f0249..3c0dee4 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -174,6 +174,14 @@ static void dumpstate() { to increase its timeout. we really need to do the timeouts in dumpsys itself... */ run_command("DUMPSYS", 60, "dumpsys", NULL); + + printf("========================================================\n"); + printf("== Application Services\n"); + printf("========================================================\n"); + + /* Instead of a 60s timeout, we should give each service a 5 second timeout */ + run_command("APP SERVICES", 60, "dumpsys", "activity", "service", NULL); + } static void usage() { diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index b0ace2f..54a7aa1 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -7284,7 +7284,7 @@ public final class ActivityManagerService extends ActivityManagerNative } return; } else if ("service".equals(cmd)) { - dumpService(fd, pw, args, opti, dumpAll); + dumpService(fd, pw, args, opti); return; } else if ("services".equals(cmd) || "s".equals(cmd)) { synchronized (this) { @@ -7643,8 +7643,7 @@ public final class ActivityManagerService extends ActivityManagerNative * - the first arg isn't the flattened component name of an existing service: * dump all services whose component contains the first arg as a substring */ - protected void dumpService(FileDescriptor fd, PrintWriter pw, String[] args, - int opti, boolean dumpAll) { + protected void dumpService(FileDescriptor fd, PrintWriter pw, String[] args, int opti) { String[] newArgs; String componentNameString; ServiceRecord r; @@ -7664,7 +7663,7 @@ public final class ActivityManagerService extends ActivityManagerNative } if (r != null) { - dumpService(fd, pw, r, newArgs, dumpAll); + dumpService(fd, pw, r, newArgs); } else { ArrayList<ServiceRecord> services = new ArrayList<ServiceRecord>(); synchronized (this) { @@ -7676,7 +7675,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } for (int i=0; i<services.size(); i++) { - dumpService(fd, pw, services.get(i), newArgs, dumpAll); + dumpService(fd, pw, services.get(i), newArgs); } } } @@ -7685,16 +7684,10 @@ public final class ActivityManagerService extends ActivityManagerNative * Invokes IApplicationThread.dumpService() on the thread of the specified service if * there is a thread associated with the service. */ - private void dumpService(FileDescriptor fd, PrintWriter pw, ServiceRecord r, String[] args, - boolean dumpAll) { - pw.println(" Service " + r.name.flattenToString()); - if (dumpAll) { - synchronized (this) { - pw.print(" * "); pw.println(r); - r.dump(pw, " "); - } - pw.println(""); - } + private void dumpService(FileDescriptor fd, PrintWriter pw, ServiceRecord r, String[] args) { + pw.println("------------------------------------------------------------" + + "-------------------"); + pw.println("APP SERVICE: " + r.name.flattenToString()); if (r.app != null && r.app.thread != null) { try { // flush anything that is already in the PrintWriter since the thread is going |
