diff --git a/deps/v8/include/libplatform/v8-tracing.h b/deps/v8/include/libplatform/v8-tracing.h index 45822d00f371d4..79c647e51e8593 100644 --- a/deps/v8/include/libplatform/v8-tracing.h +++ b/deps/v8/include/libplatform/v8-tracing.h @@ -15,9 +15,6 @@ #include "v8-platform.h" // NOLINT(build/include_directory) namespace perfetto { -namespace trace_processor { -class TraceProcessorStorage; -} class TracingSession; } @@ -31,6 +28,7 @@ namespace platform { namespace tracing { class TraceEventListener; +class JSONTraceEventListener; const int kTraceMaxNumArgs = 2; @@ -199,9 +197,6 @@ class V8_PLATFORM_EXPORT TraceConfig { TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {} TraceRecordMode GetTraceRecordMode() const { return record_mode_; } - const StringList& GetEnabledCategories() const { - return included_categories_; - } bool IsSystraceEnabled() const { return enable_systrace_; } bool IsArgumentFilterEnabled() const { return enable_argument_filter_; } @@ -234,17 +229,6 @@ class V8_PLATFORM_EXPORT TraceConfig { class V8_PLATFORM_EXPORT TracingController : public V8_PLATFORM_NON_EXPORTED_BASE(v8::TracingController) { public: - TracingController(); - ~TracingController() override; - -#if defined(V8_USE_PERFETTO) - // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides - // the output stream for the JSON trace data. - void InitializeForPerfetto(std::ostream* output_stream); - // Provide an optional listener for testing that will receive trace events. - // Must be called before StartTracing(). - void SetTraceEventListenerForTesting(TraceEventListener* listener); -#else // defined(V8_USE_PERFETTO) // The pointer returned from GetCategoryGroupEnabled() points to a value with // zero or more of the following bits. Used in this class only. The // TRACE_EVENT macros should only use the value as a bool. These values must @@ -258,8 +242,19 @@ class V8_PLATFORM_EXPORT TracingController ENABLED_FOR_ETW_EXPORT = 1 << 3 }; + TracingController(); + ~TracingController() override; + // Takes ownership of |trace_buffer|. void Initialize(TraceBuffer* trace_buffer); +#ifdef V8_USE_PERFETTO + // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides + // the output stream for the JSON trace data. + void InitializeForPerfetto(std::ostream* output_stream); + // Provide an optional listener for testing that will receive trace events. + // Must be called before StartTracing(). + void SetTraceEventListenerForTesting(TraceEventListener* listener); +#endif // v8::TracingController implementation. const uint8_t* GetCategoryGroupEnabled(const char* category_group) override; @@ -279,10 +274,6 @@ class V8_PLATFORM_EXPORT TracingController unsigned int flags, int64_t timestamp) override; void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, const char* name, uint64_t handle) override; - - static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); -#endif // !defined(V8_USE_PERFETTO) - void AddTraceStateObserver( v8::TracingController::TraceStateObserver* observer) override; void RemoveTraceStateObserver( @@ -291,32 +282,27 @@ class V8_PLATFORM_EXPORT TracingController void StartTracing(TraceConfig* trace_config); void StopTracing(); + static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); + protected: -#if !defined(V8_USE_PERFETTO) virtual int64_t CurrentTimestampMicroseconds(); virtual int64_t CurrentCpuTimestampMicroseconds(); -#endif // !defined(V8_USE_PERFETTO) private: -#if !defined(V8_USE_PERFETTO) void UpdateCategoryGroupEnabledFlag(size_t category_index); void UpdateCategoryGroupEnabledFlags(); -#endif // !defined(V8_USE_PERFETTO) - std::unique_ptr mutex_; + std::unique_ptr trace_buffer_; std::unique_ptr trace_config_; - std::atomic_bool recording_{false}; + std::unique_ptr mutex_; std::unordered_set observers_; - -#if defined(V8_USE_PERFETTO) + std::atomic_bool recording_{false}; +#ifdef V8_USE_PERFETTO std::ostream* output_stream_ = nullptr; - std::unique_ptr - trace_processor_; + std::unique_ptr json_listener_; TraceEventListener* listener_for_testing_ = nullptr; std::unique_ptr tracing_session_; -#else // !defined(V8_USE_PERFETTO) - std::unique_ptr trace_buffer_; -#endif // !defined(V8_USE_PERFETTO) +#endif // Disallow copy and assign TracingController(const TracingController&) = delete; diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 7cfd18b5708d57..6bf5a0929f6482 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -236,10 +236,6 @@ class TracingController { public: virtual ~TracingController() = default; - // In Perfetto mode, trace events are written using Perfetto's Track Event - // API directly without going through the embedder. However, it is still - // possible to observe tracing being enabled and disabled. -#if !defined(V8_USE_PERFETTO) /** * Called by TRACE_EVENT* macros, don't call this directly. * The name parameter is a category group for example: @@ -285,7 +281,6 @@ class TracingController { **/ virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, const char* name, uint64_t handle) {} -#endif // !defined(V8_USE_PERFETTO) class TraceStateObserver { public: