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

Commit 74479d2c authored by Michael Krehan's avatar Michael Krehan
Browse files

Moved the Perfetto flag check into SurfaceFlinger.

Having the flag check in Perfetto creates a dependency on the flags, which are currently not available in vendor. This prevents systems in vendor (such as Lyric) from using libtracing_perfetto.

The flag has been 100% enabled at this point (b/303199244), so Perfetto users don't have to worry anymore about the API not being enabled. That said, specific users can choose to do the flag check in their own scope to retain the ability to turn it off if needed, like SurfaceFlinger will now do with this CL.

Bug: 373924379
Change-Id: I761c6f0137c0301cfb8fbac942291863053ee1de
Flag: EXEMPT - moves an existing flag check to a different location
parent 19031123
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ cc_library_shared {
        "libbase",
        "libcutils",
        "libperfetto_c",
        "android.os.flags-aconfig-cc-host",
    ],

    host_supported: true,
+0 −5
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@
#include <atomic>
#include <mutex>

#include <android_os.h>
#include <android-base/properties.h>
#include <cutils/trace.h>
#include <inttypes.h>
@@ -228,10 +227,6 @@ struct PerfettoTeCategory* toPerfettoCategory(uint64_t category) {
}

void registerWithPerfetto(bool test) {
  if (!android::os::perfetto_sdk_tracing()) {
    return;
  }

  static std::once_flag registration;
  std::call_once(registration, [test]() {
    struct PerfettoProducerInitArgs args = PERFETTO_PRODUCER_INIT_ARGS_INIT();
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ cc_defaults {
        "android.hardware.graphics.composer@2.2",
        "android.hardware.graphics.composer@2.3",
        "android.hardware.graphics.composer@2.4",
        "android.os.flags-aconfig-cc-host",
        "libbase",
        "libbinder",
        "libbinder_ndk",
+5 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include <android/hardware/configstore/1.1/types.h>
#include <android/native_window.h>
#include <android/os/IInputFlinger.h>
#include <android_os.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/PermissionCache.h>
@@ -741,7 +742,10 @@ void SurfaceFlinger::bootFinished() {
    mBootFinished = true;
    FlagManager::getMutableInstance().markBootCompleted();

    if (android::os::perfetto_sdk_tracing()) {
        ::tracing_perfetto::registerWithPerfetto();
    }

    mInitBootPropsFuture.wait();
    mRenderEnginePrimeCacheFuture.wait();