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

Commit a4e62033 authored by Kean Mariotti's avatar Kean Mariotti Committed by Android (Google) Code Review
Browse files

Merge "sysui: configure 512 KB perfetto shmem buffer" into main

parents 0410444a 27709754
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -71,3 +71,11 @@ flag {
    is_fixed_read_only: true
    bug: "410517697"
}

flag {
    name: "sysui_large_perfetto_shmem_buffer"
    namespace: "windowing_tools"
    description: "Large perfetto shmem buffer in sysui"
    is_fixed_read_only: true
    bug: "420587648"
}
+9 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Process;
import android.os.Trace;
import android.tracing.perfetto.InitArguments;
import android.util.Log;
import android.util.TimingsTraceLog;
import android.view.SurfaceControl;
@@ -84,6 +85,14 @@ public class SystemUIApplication extends Application implements
    public SystemUIApplication() {
        super();
        if (!isSubprocess()) {
            if (android.tracing.Flags.sysuiLargePerfettoShmemBuffer()) {
                // Explicitly initialize a 512 KB shmem buffer for Perfetto producers (b/420587648).
                // This increases the Perfetto's shmem buffer from default size (256 KB) to 512 KB,
                // thus avoiding crashes or packet loss caused by shmem chunks exhaustion when too
                // many threads are tracing data.
                android.tracing.perfetto.Producer.init(new InitArguments(
                        InitArguments.PERFETTO_BACKEND_SYSTEM, 512));
            }
            Trace.registerWithPerfetto();
        }
        Log.v(TAG, "SystemUIApplication constructed.");