Skip to content

Enable Perfetto by default for Android dev builds - #57779

Open
javache wants to merge 1 commit into
react:mainfrom
javache:export-D114210766
Open

Enable Perfetto by default for Android dev builds#57779
javache wants to merge 1 commit into
react:mainfrom
javache:export-D114210766

Conversation

@javache

@javache javache commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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

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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 31, 2026
@meta-codesync

meta-codesync Bot commented Jul 31, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114210766.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant