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

Commit d606d979 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Add Traces for sysui dumps to highlight slow dumpables.

Test: perfetto ; dumpsysui bugreport-critical
Bug: 292221335
Change-Id: I4a5397d3cf6f775f685ece68ec1fcd7cb267aaa2
parent 8aef12b5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -432,9 +432,11 @@ constructor(
        }

        private inline fun PrintWriter.wrapSection(entry: DumpsysEntry, block: () -> Unit) {
            Trace.beginSection(entry.name)
            preamble(entry)
            val dumpTime = measureTimeMillis(block)
            footer(entry, dumpTime)
            Trace.endSection()
        }

        /**
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.dump

import android.os.Trace
import java.io.PrintWriter

/**
@@ -83,10 +84,12 @@ class DumpsysTableLogger(
) {

    fun printTableData(pw: PrintWriter) {
        Trace.beginSection("DumpsysTableLogger#printTableData")
        printSectionStart(pw)
        printSchema(pw)
        printData(pw)
        printSectionEnd(pw)
        Trace.endSection()
    }

    private fun printSectionStart(pw: PrintWriter) {
+2 −0
Original line number Diff line number Diff line
@@ -3447,11 +3447,13 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        ipw.print("mIgnoreXTouchSlop="); ipw.println(mIgnoreXTouchSlop);
        ipw.print("mExpandLatencyTracking="); ipw.println(mExpandLatencyTracking);
        ipw.println("gestureExclusionRect:" + calculateGestureExclusionRect());
        Trace.beginSection("Table<DownEvents>");
        new DumpsysTableLogger(
                TAG,
                NPVCDownEventState.TABLE_HEADERS,
                mLastDownEvents.toList()
        ).printTableData(ipw);
        Trace.endSection();
    }

    @Override
+4 −0
Original line number Diff line number Diff line
@@ -840,13 +840,17 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        pw.println("  mDeferWindowLayoutParams=" + mDeferWindowLayoutParams);
        pw.println(mCurrentState);
        if (mWindowRootView != null && mWindowRootView.getViewRootImpl() != null) {
            Trace.beginSection("mWindowRootView.dump()");
            mWindowRootView.getViewRootImpl().dump("  ", pw);
            Trace.endSection();
        }
        Trace.beginSection("Table<State>");
        new DumpsysTableLogger(
                TAG,
                NotificationShadeWindowState.TABLE_HEADERS,
                mStateBuffer.toList()
        ).printTableData(pw);
        Trace.endSection();
    }

    @Override