Skip to content

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Nov 20, 2025

Summary:

Changelog: [Internal]

Introduces a TracingDelegate that will receive tracing-related events on the Host side.

We can't give synchronous access to tracing state to Host directly, since there is no guarantee that this call will happen on the inspector thread.

Example:

  • HostTarget::tracingState() call may happen on UI thread, or whatever thread the Host is using, which reads traceRecoding_ value.
  • At the same time, the stopTracing() call that will invalidate traceRecording_ could happen on inspector thread.

This is a pre-requisite for a better threading model, since we are going to be doing much frequent write operations from the Host side to record frame timings or screenshots.

Differential Revision: D86205686

@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 20, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 20, 2025

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

Summary:

# Changelog: [Internal]

There is no implementation for this method and it is unused. This is actually part of `HostAgent`.

Differential Revision: D87220192
Summary:

# Changelog: [Internal]

Introduces a TracingDelegate that will receive tracing-related events on the Host side.

We can't give synchronous access to tracing state to Host directly, since there is no guarantee that this call will happen on the inspector thread.

Example:
- `HostTarget::tracingState()` call may happen on UI thread, or whatever thread the Host is using, which reads `traceRecoding_` value.
- At the same time, the `stopTracing()` call that will invalidate `traceRecording_` could happen on inspector thread.

This is a pre-requisite for a better threading model, since we are going to be doing much frequent write operations from the Host side to record frame timings or screenshots.

Differential Revision: D86205686
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 21, 2025
Summary:

# Changelog: [Internal]

Introduces a TracingDelegate that will receive tracing-related events on the Host side.

We can't give synchronous access to tracing state to Host directly, since there is no guarantee that this call will happen on the inspector thread.

Example:
- `HostTarget::tracingState()` call may happen on UI thread, or whatever thread the Host is using, which reads `traceRecoding_` value.
- At the same time, the `stopTracing()` call that will invalidate `traceRecording_` could happen on inspector thread.

This is a pre-requisite for a better threading model, since we are going to be doing much frequent write operations from the Host side to record frame timings or screenshots.

Differential Revision: D86205686
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 21, 2025
Summary:

# Changelog: [Internal]

Introduces a TracingDelegate that will receive tracing-related events on the Host side.

We can't give synchronous access to tracing state to Host directly, since there is no guarantee that this call will happen on the inspector thread.

Example:
- `HostTarget::tracingState()` call may happen on UI thread, or whatever thread the Host is using, which reads `traceRecoding_` value.
- At the same time, the `stopTracing()` call that will invalidate `traceRecording_` could happen on inspector thread.

This is a pre-requisite for a better threading model, since we are going to be doing much frequent write operations from the Host side to record frame timings or screenshots.

Differential Revision: D86205686
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 21, 2025
Summary:

# Changelog: [Internal]

Introduces a TracingDelegate that will receive tracing-related events on the Host side.

We can't give synchronous access to tracing state to Host directly, since there is no guarantee that this call will happen on the inspector thread.

Example:
- `HostTarget::tracingState()` call may happen on UI thread, or whatever thread the Host is using, which reads `traceRecoding_` value.
- At the same time, the `stopTracing()` call that will invalidate `traceRecording_` could happen on inspector thread.

This is a pre-requisite for a better threading model, since we are going to be doing much frequent write operations from the Host side to record frame timings or screenshots.

Differential Revision: D86205686
hoxyq added a commit to hoxyq/react-native that referenced this pull request Nov 21, 2025
Summary:

# Changelog: [Internal]

Introduces a TracingDelegate that will receive tracing-related events on the Host side.

We can't give synchronous access to tracing state to Host directly, since there is no guarantee that this call will happen on the inspector thread.

Example:
- `HostTarget::tracingState()` call may happen on UI thread, or whatever thread the Host is using, which reads `traceRecoding_` value.
- At the same time, the `stopTracing()` call that will invalidate `traceRecording_` could happen on inspector thread.

This is a pre-requisite for a better threading model, since we are going to be doing much frequent write operations from the Host side to record frame timings or screenshots.

Differential Revision: D86205686
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