Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 905e6afb authored by Yandry Perez Clemente's avatar Yandry Perez Clemente Committed by Android (Google) Code Review
Browse files

Merge "Add ANR/Watchdog subject to trace."

parents 4f78e1c8 99d97b26
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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;
            }
+13 −0
Original line number Diff line number Diff line
@@ -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);
    }
}