Skip to content

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Nov 25, 2025

Summary:

Changelog: [Internal]

Adding a data structure that could be configured to preserve entries that are inside of a specified time window.

At the same time, this data structure could be used as a simple buffer, if no arguments were specified during constructing.

This follows the approach that was added to PerformanceTracer, but it doesn't use pointers to avoid dealing with updates during copies or moves.

Differential Revision: D87776299

Summary:
# Changelog: [Internal]

This introduces a proper lifecycle for a module on Anroid that will emit frames information as part of the trace recording.

Previously we would initialize it on a packager connection, which could be problematic, since there is no guarantee that InspectorTarget exists at  this time.

With the current approach, the lifetime of this object is:
- Bound to lifetime of InspectorTarget, it will never outlive it
- The actual frames listener lifetime will be bound to tracing state. We no longer will be going through `jni` to check if `PerformanceTracer` is enabled.

I've renamed it to `FrameTimingsObserver`and moved to inspector package, since this should be considered as part of the inspector stack. Similarly to `LoadNetworkResource` listeners.

I am keeping the `jni` layer with PerformanceTracer for now, but this is about to be removed in the diffs above. The frames information should be propagated through Host, this would allow us to record Frames even if there is no React Native instance, for example, during reloads.

Differential Revision: D87345177
Summary:
# Changelog: [Internal]

Currently, `HostTraceRecordingState` is used everywhere and it is the final data struct that contains the tracing profile.

At the same time, the original idea for it was to be a global state for Tracing Agents, where they could:
1. Read the tracing configuration, like tracing mode, enabled categories, etc.
2. Stash corresponding target profiles on reloads. For example, if `RuntimeTarget` was reloaded during tracing, `RuntimeTracingAgent` would stop JavaScript sampling profiler, and then stash this profile on a state.

This change should clarify the data structures and when they are used.

Differential Revision: D87830455
Summary:
# Changelog: [Internal]

Adding a data structure that could be configured to preserve entries that are inside of a specified time window.

At the same time, this data structure could be used as a simple buffer, if no arguments were specified during constructing.

This follows the approach that was added to `PerformanceTracer`, but it doesn't use pointers to avoid dealing with updates during copies or moves.

Differential Revision: D87776299
@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 Nov 25, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 25, 2025

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

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. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants