Skip to content

Make host target tracing implementation headers private - #58797

Open
coado wants to merge 1 commit into
react:mainfrom
coado:export-D122791607
Open

coado wants to merge 1 commit into
react:mainfrom
coado:export-D122791607

Conversation

@coado

@coado coado commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
Mark the following headers as private instead of for-frameworks. All of them are implementation details of how the host target records and serializes a trace, and no for-frameworks header includes them:

  • HostTracingProfileSerializer transforms a HostTracingProfile into serialized trace events. It is only used by its own source and HostTargetTracing.h.
  • HostTargetTracing.h provides emitNotificationsForTracingProfile, which uses the serializer to send a captured profile to frontend channels as Tracing.dataCollected events followed by Tracing.tracingComplete. It is only used by HostTarget.cpp and TracingAgent.cpp, and was already not exported in Buck.
  • HostTargetTraceRecording holds the state of an in-progress host trace recording. HostTarget.h only forward-declares it, and it is only used by HostTarget.cpp, HostTargetTraceRecording.cpp and HostTargetTracing.cpp.
  • TimeWindowedBuffer is a generic buffer that keeps only elements inside a time window. It is only used by HostTargetTraceRecording and its own unit test.
  • TracingAgent handles the CDP Tracing.start and Tracing.stop requests for the host agent. It is only used by HostAgent.cpp and TracingAgent.cpp, and was already not exported in Buck.

Headers that include one another change together: HostTargetTracing.h includes HostTracingProfileSerializer.h, and HostTargetTraceRecording.h stores a TimeWindowedBuffer by value, so keeping either includer for-frameworks would expose a private header. HostTracingProfile.h, FrameTimingSequence.h, TraceRecordingState.h and TracingCategory.h stay for-frameworks because other for-frameworks headers include them.

React Native's own targets define RN_BUILDING, so the private guard does not affect them.

Changelog: [Internal]

Differential Revision: D122791607

@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 Oct 1, 2026
@meta-codesync

meta-codesync Bot commented Oct 1, 2026

Copy link
Copy Markdown

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

@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner labels Oct 1, 2026
@facebook-github-tools facebook-github-tools Bot added the p: Facebook Partner: Facebook label Oct 1, 2026
Summary:
Mark the following headers as private instead of for-frameworks. All of them are implementation details of how the host target records and serializes a trace, and no for-frameworks header includes them:

- `HostTracingProfileSerializer` transforms a `HostTracingProfile` into serialized trace events. It is only used by its own source and `HostTargetTracing.h`.
- `HostTargetTracing.h` provides `emitNotificationsForTracingProfile`, which uses the serializer to send a captured profile to frontend channels as `Tracing.dataCollected` events followed by `Tracing.tracingComplete`. It is only used by `HostTarget.cpp` and `TracingAgent.cpp`, and was already not exported in Buck.
- `HostTargetTraceRecording` holds the state of an in-progress host trace recording. `HostTarget.h` only forward-declares it, and it is only used by `HostTarget.cpp`, `HostTargetTraceRecording.cpp` and `HostTargetTracing.cpp`.
- `TimeWindowedBuffer` is a generic buffer that keeps only elements inside a time window. It is only used by `HostTargetTraceRecording` and its own unit test.
- `TracingAgent` handles the CDP `Tracing.start` and `Tracing.stop` requests for the host agent. It is only used by `HostAgent.cpp` and `TracingAgent.cpp`, and was already not exported in Buck.

Headers that include one another change together: `HostTargetTracing.h` includes `HostTracingProfileSerializer.h`, and `HostTargetTraceRecording.h` stores a `TimeWindowedBuffer` by value, so keeping either includer for-frameworks would expose a private header. `HostTracingProfile.h`, `FrameTimingSequence.h`, `TraceRecordingState.h` and `TracingCategory.h` stay for-frameworks because other for-frameworks headers include them.

React Native's own targets define `RN_BUILDING`, so the private guard does not affect them.

Changelog: [Internal]

Differential Revision: D122791607
@meta-codesync meta-codesync Bot changed the title Make host tracing profile serialization headers private Make host target tracing implementation headers private Oct 2, 2026
@coado
coado force-pushed the export-D122791607 branch from 274f250 to 05fa935 Compare October 2, 2026 10:55

This branch has not been deployed

No deployments
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 p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant