From 4083e7f3d1c89d5ae1201a503e0c1051c11214ff Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 31 Jul 2026 05:20:07 -0700 Subject: [PATCH] Enable Perfetto by default for Android dev builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Perfetto tracing in `reactperflogger` previously required an explicit build modifier to turn on, so ordinary Android development builds never had it. Introduce a shared `if_perfetto(on, off)` helper (`reactperflogger/DEFS.bzl`) that derives the Perfetto decision from build configuration: on by default for non-optimized Android builds, while optimized builds still require the explicit `perfetto` constraint so tracing stays out of release binaries. arvr/Horizon builds are excluded via `hz_tracing:perfetto-enable` — the same signal reactperflogger already keys on — because those builds manage Perfetto through their own `hz_tracing` stack (resolved at the final binary), so a standalone RN `.so` compiling `WITH_PERFETTO` there fails to link. The Android `BuildConfig.ENABLE_PERFETTO` runtime gate and the other native Perfetto consumers are routed through the same helper so the default is consistent end-to-end. The now-orphaned `enable_perfetto` config_setting is removed. Changelog: [Internal] Differential Revision: D114210766 --- .../ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp index f0f96c77aac3..fd3d05082217 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp @@ -119,6 +119,8 @@ void JavaNativeModule::invoke( if (callId != -1) { fbsystrace_end_async_flow(TRACE_TAG_REACT, "native", callId); } +#else + (void)callId; #endif invokeMethod( wrapper_,