Skip to content

Commit 914cabb

Browse files
javachemeta-codesync[bot]
authored andcommitted
Enable Perfetto by default for Android dev builds
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 opt out of the default via `hz_tracing:perfetto-enable` — the same signal reactperflogger already keys on — because those builds manage Perfetto through their own stack and resolve it at the final binary, so a standalone RN `.so` compiling `WITH_PERFETTO` there fails to link. An explicit `perfetto` constraint still wins there, and reactperflogger then takes that stack's SDK rather than its own copy. 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. `-DWITH_FBSYSTRACE=1` is dropped from the tracing JNI target's own `preprocessor_flags`. No translation unit in that target reads it, and reactperflogger already exports exactly one of `WITH_PERFETTO` / `WITH_FBSYSTRACE`; hardcoding the second one locally would break that mutual exclusion once Perfetto is on by default. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D114210766 fbshipit-source-id: 4092c3e3282d035101f3a35bb8c1da89633f2bc2
1 parent e2a4c68 commit 914cabb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ void JavaNativeModule::invoke(
119119
if (callId != -1) {
120120
fbsystrace_end_async_flow(TRACE_TAG_REACT, "native", callId);
121121
}
122+
#else
123+
(void)callId;
122124
#endif
123125
invokeMethod(
124126
wrapper_,

0 commit comments

Comments
 (0)