diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-07-14 16:22:00 +0200 |
---|---|---|
committer | Myles Borins <mylesborins@github.com> | 2020-07-16 17:09:17 -0400 |
commit | 2079fefacf38389aba11fdb792c2e1b383f93d56 (patch) | |
tree | 37dcfb50c09760f6b23f79d61571ec02bee362c6 | |
parent | 1af89436225b9242ef12e995045d3db7d5335c43 (diff) | |
download | node-new-2079fefacf38389aba11fdb792c2e1b383f93d56.tar.gz |
deps: V8: undo header change of 9dbab9bbdb979
Refs: https://github.com/v8/v8/commit/9dbab9bbdb979af4366b2ace6fc2e31cbf7f8324
PR-URL: https://github.com/nodejs/node/pull/34356
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
-rw-r--r-- | deps/v8/include/libplatform/v8-tracing.h | 54 | ||||
-rw-r--r-- | deps/v8/include/v8-platform.h | 5 |
2 files changed, 20 insertions, 39 deletions
diff --git a/deps/v8/include/libplatform/v8-tracing.h b/deps/v8/include/libplatform/v8-tracing.h index 45822d00f3..79c647e51e 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<base::Mutex> mutex_; + std::unique_ptr<TraceBuffer> trace_buffer_; std::unique_ptr<TraceConfig> trace_config_; - std::atomic_bool recording_{false}; + std::unique_ptr<base::Mutex> mutex_; std::unordered_set<v8::TracingController::TraceStateObserver*> observers_; - -#if defined(V8_USE_PERFETTO) + std::atomic_bool recording_{false}; +#ifdef V8_USE_PERFETTO std::ostream* output_stream_ = nullptr; - std::unique_ptr<perfetto::trace_processor::TraceProcessorStorage> - trace_processor_; + std::unique_ptr<JSONTraceEventListener> json_listener_; TraceEventListener* listener_for_testing_ = nullptr; std::unique_ptr<perfetto::TracingSession> tracing_session_; -#else // !defined(V8_USE_PERFETTO) - std::unique_ptr<TraceBuffer> 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 7cfd18b570..6bf5a0929f 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: |