From 62f22772e0b11abf03585ef27b19c2188ad810c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Fri, 2 Oct 2026 04:13:37 -0700 Subject: [PATCH] Make select jsinspector tracing implementation headers private Summary: Mark the following tracing headers as private instead of for-frameworks. All of them are implementation details of React Native's tracing infrastructure, and no for-frameworks header includes them: - `EventLoopReporter` is an RAII helper the runtime scheduler uses to report event loop task and microtask phases to the performance tracer. It is only used by `EventLoopReporter.cpp` and `RuntimeScheduler_Modern.cpp`. - `RuntimeSamplingProfileTraceEventSerializer` turns a runtime sampling profile into trace events. It is only used by tracing sources, `TracingAgent.cpp` and its own unit test. - `TraceEventSerializer` serializes trace events to `folly::dynamic`. It is only used by tracing sources and `TracingAgent.cpp`. - `TraceEventGenerator` builds trace events for the performance tracer and the host profile serializer. It is only used by tracing sources and was already not exported in Buck. - `ProfileTreeNode` is an auxiliary tree used to build the profile and deduplicate identical frames. It is only used by `RuntimeSamplingProfileTraceEventSerializer.cpp` and its own unit test. - `Timing.h` defines the tracing clock origin and the conversions from `HighResTimeStamp` and `HighResDuration` to trace event microseconds. It is only used by tracing sources and a tracing unit test. `TracingAgent.h` included `Timing.h` without using it; that include is removed. React Native's own targets define `RN_BUILDING`, so the private guard does not affect them. Changelog: [Internal] Differential Revision: D122780825 --- .../react-native/ReactCommon/jsinspector-modern/TracingAgent.h | 1 - .../ReactCommon/jsinspector-modern/tracing/EventLoopReporter.h | 2 +- .../ReactCommon/jsinspector-modern/tracing/ProfileTreeNode.h | 2 +- .../tracing/RuntimeSamplingProfileTraceEventSerializer.h | 2 +- .../ReactCommon/jsinspector-modern/tracing/Timing.h | 2 +- .../jsinspector-modern/tracing/TraceEventGenerator.h | 2 +- .../jsinspector-modern/tracing/TraceEventSerializer.h | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h index c58c6cf48e5a..ba3631d742d5 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h @@ -15,7 +15,6 @@ #include #include #include -#include namespace facebook::react::jsinspector_modern { diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/EventLoopReporter.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/EventLoopReporter.h index 4531200f4f00..bb8ebdb97c5b 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/EventLoopReporter.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/EventLoopReporter.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #if defined(REACT_NATIVE_DEBUGGER_ENABLED) #include diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/ProfileTreeNode.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/ProfileTreeNode.h index 5efd0d022784..9439e0e83fb0 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/ProfileTreeNode.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/ProfileTreeNode.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.h index a1b0b6198e5a..e4019bb29431 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include "RuntimeSamplingProfile.h" diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/Timing.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/Timing.h index 5406602bdfcd..1fef1c0d2916 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/Timing.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/Timing.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h index a46e7c2ba7f0..c5580bcbb60d 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include "TraceEvent.h" diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h index 8b83f24be2f7..b1f99195443f 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include "TraceEvent.h" #include "TraceEventProfile.h"