mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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>
This commit is contained in:
1 parent
1af8943622
commit
2079fefacf
2 files changed
+20
-39
No files matched your search
+20
-34
@@ -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;
|
||||
|
||||
Vendored
-5
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user