Suppress LogBox during performance tracing - #55470
Closed
emily8rown wants to merge 1 commit into
Closed
Conversation
|
@emily8rown has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92527815. |
emily8rown
force-pushed
the
export-D92527815
branch
from
February 9, 2026 13:40
a0bcfd2 to
7c0dd2c
Compare
emily8rown
force-pushed
the
export-D92527815
branch
from
February 10, 2026 13:36
7c0dd2c to
a0eacc0
Compare
emily8rown
force-pushed
the
export-D92527815
branch
2 times, most recently
from
February 11, 2026 16:31
76ada30 to
83f7709
Compare
emily8rown
force-pushed
the
export-D92527815
branch
from
February 12, 2026 16:45
83f7709 to
ee7ac8b
Compare
Summary: LogBox errors and warnings can affect performance trace measurements by triggering UI updates during profiling. This change adds a mechanism to suppress LogBox messages when CDP performance tracing is active. It clears the logbox when tracing starts and drops messages during tracing The implementation consists of: 1. **Native observer infrastructure** (`RuntimeTarget.cpp/h`, `RuntimeTargetPerformanceTracerObserver.cpp/h`): `RuntimeTarget` subscribes to the `PerformanceTracer` singleton's state changes and forwards them into JavaScript. It uses helper functions in `RuntimeTargetPerformanceTracerObserver` to install a `__PERFORMANCE_TRACER_OBSERVER__` object on the JavaScript global (a global because it needs to exist before the module system initializes), which tracks tracing state and notifies subscribers via `onTracingStateChange`. 2. **JavaScript observer** (`PerformanceTracerObserver.js`): Provides a clean API to check tracing status (`isTracing()`) and subscribe to state changes. Gracefully handles environments where native support isn't available. 3. **LogBox integration** (`LogBoxData.js`): Subscribes to the performance tracer observer and: - Clears all LogBox messages when tracing starts - Skips logging new errors and exceptions while tracing is active This ensures trace measurements are not impacted by LogBox UI rendering during profiling sessions. Changelog: [GENERAL] [CHANGED] - Suppress LogBox warnings and errors during CDP performance tracing Reviewed By: hoxyq Differential Revision: D92527815
emily8rown
force-pushed
the
export-D92527815
branch
from
February 13, 2026 14:13
ee7ac8b to
ebe6b52
Compare
|
This pull request has been merged in a308014. |
Collaborator
|
This pull request was successfully merged by @emily8rown in a308014 When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
LogBox errors and warnings can affect performance trace measurements by triggering UI updates during profiling. This change adds a mechanism to suppress LogBox messages when performance tracing is active.
The implementation consists of:
Native observer infrastructure (
RuntimeTargetPerformanceTracerObserver.cpp/h): Installs a__PERFORMANCE_TRACER_OBSERVER__object on the JavaScript global, which tracks tracing state and notifies subscribers when tracing starts/stops viaonTracingStateChange.JavaScript observer (
PerformanceTracerObserver.js): Provides a clean API to check tracing status (isTracing()) and subscribe to state changes. Gracefully handles environments where native support isn't available.LogBox integration (
LogBoxData.js): Subscribes to the performance tracer observer and:This ensures trace measurements are not impacted by LogBox UI rendering during profiling sessions.
Changelog: [GENERAL] [ADDED] - Suppress LogBox warnings and errors during performance tracing
Differential Revision: D92527815