Merge "Add process name to error id." into sc-dev am: a82ece06b2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15079801

Change-Id: I9a95a0de8cb882088aca8b0c61f203db6a6439a8
This commit is contained in:
Yandry Perez Clemente
2021-06-25 16:26:58 +00:00
committed by Automerger Merge Worker
3 changed files with 7 additions and 5 deletions

View File

@@ -676,7 +676,7 @@ public class Watchdog {
final UUID errorId; final UUID errorId;
if (mTraceErrorLogger.isAddErrorIdEnabled()) { if (mTraceErrorLogger.isAddErrorIdEnabled()) {
errorId = mTraceErrorLogger.generateErrorId(); errorId = mTraceErrorLogger.generateErrorId();
mTraceErrorLogger.addErrorIdToTrace(errorId); mTraceErrorLogger.addErrorIdToTrace("system_server", errorId);
} else { } else {
errorId = null; errorId = null;
} }

View File

@@ -267,7 +267,7 @@ class ProcessErrorStateRecord {
if (mService.mTraceErrorLogger.isAddErrorIdEnabled()) { if (mService.mTraceErrorLogger.isAddErrorIdEnabled()) {
errorId = mService.mTraceErrorLogger.generateErrorId(); errorId = mService.mTraceErrorLogger.generateErrorId();
mService.mTraceErrorLogger.addErrorIdToTrace(errorId); mService.mTraceErrorLogger.addErrorIdToTrace(mApp.processName, errorId);
} else { } else {
errorId = null; errorId = null;
} }

View File

@@ -46,10 +46,12 @@ public class TraceErrorLogger {
* can be uniquely identified. We also add the same id to the dropbox entry of the error, so * can be uniquely identified. We also add the same id to the dropbox entry of the error, so
* that we can join the trace and the error server-side. * that we can join the trace and the error server-side.
* *
* @param errorId The unique id with which to tag the trace. * @param processName The process name to include in the error id.
* @param errorId The unique id with which to tag the trace.
*/ */
public void addErrorIdToTrace(UUID errorId) { public void addErrorIdToTrace(String processName, UUID errorId) {
Trace.traceCounter(Trace.TRACE_TAG_ACTIVITY_MANAGER, COUNTER_PREFIX + errorId.toString(), Trace.traceCounter(Trace.TRACE_TAG_ACTIVITY_MANAGER,
COUNTER_PREFIX + processName + "#" + errorId.toString(),
PLACEHOLDER_VALUE); PLACEHOLDER_VALUE);
} }
} }