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

Commit 0d800228 authored by Ben Miles's avatar Ben Miles Committed by Android (Google) Code Review
Browse files

Merge "Include pid of ANRing process in perfetto traces" into udc-dev

parents f9d5d4c9 d0236469
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -880,7 +880,8 @@ public class Watchdog implements Dumpable {
                CriticalEventLog.getInstance().logLinesForSystemServerTraceFile();
        final UUID errorId = mTraceErrorLogger.generateErrorId();
        if (mTraceErrorLogger.isAddErrorIdEnabled()) {
            mTraceErrorLogger.addErrorIdToTrace("system_server", errorId);
            mTraceErrorLogger.addProcessInfoAndErrorIdToTrace("system_server", Process.myPid(),
                    errorId);
            mTraceErrorLogger.addSubjectToTrace(subject, errorId);
        }

+2 −1
Original line number Diff line number Diff line
@@ -348,7 +348,8 @@ class ProcessErrorStateRecord {
            if (mService.mTraceErrorLogger != null
                    && mService.mTraceErrorLogger.isAddErrorIdEnabled()) {
                errorId = mService.mTraceErrorLogger.generateErrorId();
                mService.mTraceErrorLogger.addErrorIdToTrace(mApp.processName, errorId);
                mService.mTraceErrorLogger.addProcessInfoAndErrorIdToTrace(
                        mApp.processName, pid, errorId);
                mService.mTraceErrorLogger.addSubjectToTrace(annotation, errorId);
            } else {
                errorId = null;
+4 −3
Original line number Diff line number Diff line
@@ -45,12 +45,13 @@ public class TraceErrorLogger {
     * 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.
     *
     * @param processName The process name to include in the error id.
     * @param processName The name of the ANRing process.
     * @param pid         The pid of the ANRing process.
     * @param errorId     The unique id with which to tag the trace.
     */
    public void addErrorIdToTrace(String processName, UUID errorId) {
    public void addProcessInfoAndErrorIdToTrace(String processName, int pid, UUID errorId) {
        Trace.traceCounter(Trace.TRACE_TAG_ACTIVITY_MANAGER,
                COUNTER_PREFIX + processName + "#" + errorId.toString(),
                COUNTER_PREFIX + processName + " " + pid + "#" + errorId.toString(),
                PLACEHOLDER_VALUE);
    }