Improve watchdog diagnostics.

Capture stack traces from the system process using the same
mechanism as ANRs (which will initialize traces.txt, etc).
Also record the watchdog reset in the dropbox for uploading.

Bug: 2475557
This commit is contained in:
Dan Egnor
2010-03-04 14:20:31 -08:00
parent 4736ff3534
commit 9bdc94b7a4
2 changed files with 22 additions and 20 deletions

View File

@@ -4662,7 +4662,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
* @param pids of dalvik VM processes to dump stack traces for
* @return file containing stack traces, or null if no dump file is configured
*/
private static File dumpStackTraces(ArrayList<Integer> pids) {
public static File dumpStackTraces(ArrayList<Integer> pids) {
String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null);
if (tracesPath == null || tracesPath.length() == 0) {
return null;
@@ -8958,10 +8958,13 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
* @param logFile to include in the report, null if none
* @param crashInfo giving an application stack trace, null if absent
*/
private void addErrorToDropBox(String eventType,
public void addErrorToDropBox(String eventType,
ProcessRecord process, HistoryRecord activity, HistoryRecord parent,
String subject, String report, File logFile,
ApplicationErrorReport.CrashInfo crashInfo) {
// NOTE -- this must never acquire the ActivityManagerService lock,
// otherwise the watchdog may be prevented from resetting the system.
String dropboxTag;
if (process == null || process.pid == MY_PID) {
dropboxTag = "system_server_" + eventType;