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

Commit 09c1da44 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"

parents 3d2dbcf0 b0a2424f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -881,7 +881,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
@@ -350,7 +350,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);
    }