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

Commit c89bb80d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Support dump gfxinfo reset for process' without a Window"

parents a47d3b48 712eae05
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -4578,8 +4578,7 @@ public final class ActivityThread extends ClientTransactionHandler

    private void handleDumpGfxInfo(DumpComponentInfo info) {
        try {
            nDumpGraphicsInfo(info.fd.getFileDescriptor());
            WindowManagerGlobal.getInstance().dumpGfxInfo(info.fd.getFileDescriptor(), info.args);
            ThreadedRenderer.handleDumpGfxInfo(info.fd.getFileDescriptor(), info.args);
        } catch (Exception e) {
            Log.w(TAG, "Caught exception from dumpGfxInfo()", e);
        } finally {
@@ -7905,6 +7904,5 @@ public final class ActivityThread extends ClientTransactionHandler

    // ------------------ Regular JNI ------------------------
    private native void nPurgePendingResources();
    private native void nDumpGraphicsInfo(FileDescriptor fd);
    private native void nInitZygoteChildHeapProfiling();
}
+16 −6
Original line number Diff line number Diff line
@@ -609,11 +609,7 @@ public final class ThreadedRenderer extends HardwareRenderer {
        return mHeight;
    }

    /**
     * Outputs extra debugging information in the specified file descriptor.
     */
    void dumpGfxInfo(PrintWriter pw, FileDescriptor fd, String[] args) {
        pw.flush();
    private static int dumpArgsToFlags(String[] args) {
        // 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
@@ -631,7 +627,21 @@ public final class ThreadedRenderer extends HardwareRenderer {
                    break;
            }
        }
        dumpProfileInfo(fd, flags);
        return flags;
    }

    /** @hide */
    public static void handleDumpGfxInfo(FileDescriptor fd, String[] args) {
        dumpGlobalProfileInfo(fd, dumpArgsToFlags(args));
        WindowManagerGlobal.getInstance().dumpGfxInfo(fd, args);
    }

    /**
     * Outputs extra debugging information in the specified file descriptor.
     */
    void dumpGfxInfo(PrintWriter pw, FileDescriptor fd, String[] args) {
        pw.flush();
        dumpProfileInfo(fd, dumpArgsToFlags(args));
    }

    Picture captureRenderingCommands() {
+0 −9
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
#include <unistd.h>

#include <bionic/malloc.h>
#include <android/graphics/renderthread.h>

namespace android {

@@ -30,12 +29,6 @@ static void android_app_ActivityThread_purgePendingResources(JNIEnv* env, jobjec
    mallopt(M_PURGE, 0);
}

static void
android_app_ActivityThread_dumpGraphics(JNIEnv* env, jobject clazz, jobject javaFileDescriptor) {
    int fd = jniGetFDFromFileDescriptor(env, javaFileDescriptor);
    ARenderThread_dumpGraphicsMemory(fd);
}

static void android_app_ActivityThread_initZygoteChildHeapProfiling(JNIEnv* env, jobject clazz) {
    android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0);
}
@@ -44,8 +37,6 @@ static JNINativeMethod gActivityThreadMethods[] = {
    // ------------ Regular JNI ------------------
    { "nPurgePendingResources",        "()V",
      (void*) android_app_ActivityThread_purgePendingResources },
    { "nDumpGraphicsInfo",        "(Ljava/io/FileDescriptor;)V",
      (void*) android_app_ActivityThread_dumpGraphics },
    { "nInitZygoteChildHeapProfiling",        "()V",
      (void*) android_app_ActivityThread_initZygoteChildHeapProfiling }
};
+9 −0
Original line number Diff line number Diff line
@@ -820,6 +820,13 @@ public class HardwareRenderer {
        return nLoadSystemProperties(mNativeProxy);
    }

    /**
     * @hide
     */
    public static void dumpGlobalProfileInfo(FileDescriptor fd, @DumpFlags int dumpFlags) {
        nDumpGlobalProfileInfo(fd, dumpFlags);
    }

    /**
     * @hide
     */
@@ -1390,6 +1397,8 @@ public class HardwareRenderer {
    private static native void nDumpProfileInfo(long nativeProxy, FileDescriptor fd,
            @DumpFlags int dumpFlags);

    private static native void nDumpGlobalProfileInfo(FileDescriptor fd, @DumpFlags int dumpFlags);

    private static native void nAddRenderNode(long nativeProxy, long rootRenderNode,
            boolean placeFront);

+0 −1
Original line number Diff line number Diff line
@@ -272,7 +272,6 @@ cc_defaults {
                "apex/android_bitmap.cpp",
                "apex/android_canvas.cpp",
                "apex/jni_runtime.cpp",
                "apex/renderthread.cpp",
            ],
        },
        host: {
Loading