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

Commit fd18053d authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Adds Trace section for WM tracing

To trace the performance of WM tracing calls.

Flag: EXEMPT adding tracing
Change-Id: I2a4958fe73c5c033e27533b41e883a20fe4b9e0e
parent 061fa553
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,8 @@ import android.view.Choreographer;


import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;


import android.os.Trace;

import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicInteger;


@@ -106,6 +108,7 @@ class WindowTracingPerfetto extends WindowTracing {
    @Override
    @Override
    protected void log(String where) {
    protected void log(String where) {
        try {
        try {
            Trace.beginSection("window_tracing_log");
            boolean isStartLogEvent = where == WHERE_START_TRACING;
            boolean isStartLogEvent = where == WHERE_START_TRACING;
            boolean isOnFrameLogEvent = where == WHERE_ON_FRAME;
            boolean isOnFrameLogEvent = where == WHERE_ON_FRAME;


@@ -144,6 +147,8 @@ class WindowTracingPerfetto extends WindowTracing {
            });
            });
        } catch (Exception e) {
        } catch (Exception e) {
            Log.wtf(TAG, "Exception while tracing state", e);
            Log.wtf(TAG, "Exception while tracing state", e);
        } finally {
            Trace.endSection();
        }
        }
    }
    }