Merge "Add ANR/Watchdog subject to trace."
This commit is contained in:
committed by
Android (Google) Code Review
commit
905e6afba1
@@ -685,6 +685,7 @@ public class Watchdog {
|
||||
final UUID errorId = mTraceErrorLogger.generateErrorId();
|
||||
if (mTraceErrorLogger.isAddErrorIdEnabled()) {
|
||||
mTraceErrorLogger.addErrorIdToTrace("system_server", errorId);
|
||||
mTraceErrorLogger.addSubjectToTrace(subject, errorId);
|
||||
}
|
||||
|
||||
// Log the atom as early as possible since it is used as a mechanism to trigger
|
||||
|
||||
@@ -286,6 +286,7 @@ class ProcessErrorStateRecord {
|
||||
&& mService.mTraceErrorLogger.isAddErrorIdEnabled()) {
|
||||
errorId = mService.mTraceErrorLogger.generateErrorId();
|
||||
mService.mTraceErrorLogger.addErrorIdToTrace(mApp.processName, errorId);
|
||||
mService.mTraceErrorLogger.addSubjectToTrace(annotation, errorId);
|
||||
} else {
|
||||
errorId = null;
|
||||
}
|
||||
|
||||
@@ -54,4 +54,17 @@ public class TraceErrorLogger {
|
||||
COUNTER_PREFIX + processName + "#" + errorId.toString(),
|
||||
PLACEHOLDER_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes a counter containing an ANR/Watchdog subject and a unique id so that the subject
|
||||
* can be uniquely identified.
|
||||
*
|
||||
* @param subject The subject to include in the trace.
|
||||
* @param errorId The unique id with which to tag the trace.
|
||||
*/
|
||||
public void addSubjectToTrace(String subject, UUID errorId) {
|
||||
Trace.traceCounter(Trace.TRACE_TAG_ACTIVITY_MANAGER,
|
||||
String.format("Subject(for ErrorId %s):%s", errorId.toString(), subject),
|
||||
PLACEHOLDER_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user