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

Commit 184264d0 authored by John Reck's avatar John Reck
Browse files

Dump frame history for bugreports

Can provide more insights into ANR reports that end in nSyncAndDrawFrame

Test: verified 'dumpsys gfxinfo <package>' didn't change, but that
bugreports did

Change-Id: I4e0e4b071f761e35bb6d6c9d8174b5bde3220d92
parent d3905e65
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -331,6 +331,7 @@ public final class ThreadedRenderer {

    private static final int FLAG_DUMP_FRAMESTATS   = 1 << 0;
    private static final int FLAG_DUMP_RESET        = 1 << 1;
    private static final int FLAG_DUMP_ALL          = FLAG_DUMP_FRAMESTATS;

    @IntDef(flag = true, prefix = { "FLAG_DUMP_" }, value = {
            FLAG_DUMP_FRAMESTATS,
@@ -636,7 +637,10 @@ public final class ThreadedRenderer {
     */
    void dumpGfxInfo(PrintWriter pw, FileDescriptor fd, String[] args) {
        pw.flush();
        int flags = 0;
        // If there's no arguments, eg 'dumpsys gfxinfo', then dump everything.
        // If there's a targetted package, eg 'dumpsys gfxinfo com.android.systemui', then only
        // dump the summary information
        int flags = (args == null || args.length == 0) ? FLAG_DUMP_ALL : 0;
        for (int i = 0; i < args.length; i++) {
            switch (args[i]) {
                case "framestats":
@@ -645,6 +649,9 @@ public final class ThreadedRenderer {
                case "reset":
                    flags |= FLAG_DUMP_RESET;
                    break;
                case "-a": // magic option passed when dumping a bugreport.
                    flags = FLAG_DUMP_ALL;
                    break;
            }
        }
        nDumpProfileInfo(mNativeProxy, fd, flags);