diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp index af8ee1ffcd27..06a404547acc 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp @@ -379,6 +379,15 @@ void PerformanceTracer::reportFrameTiming( int frameSeqId, HighResTimeStamp start, HighResTimeStamp end) { + if (!tracingAtomic_) { + return; + } + + std::lock_guard lock(mutex_); + if (!tracingAtomic_) { + return; + } + ThreadId threadId = getCurrentThreadId(); enqueueEvent( PerformanceTracerFrameBeginDrawEvent{