summaryrefslogtreecommitdiff
path: root/deps/v8/src/profiler/tracing-cpu-profiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/profiler/tracing-cpu-profiler.h')
-rw-r--r--deps/v8/src/profiler/tracing-cpu-profiler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/deps/v8/src/profiler/tracing-cpu-profiler.h b/deps/v8/src/profiler/tracing-cpu-profiler.h
index 3adcaa63d7..0ccf7f0e5d 100644
--- a/deps/v8/src/profiler/tracing-cpu-profiler.h
+++ b/deps/v8/src/profiler/tracing-cpu-profiler.h
@@ -11,6 +11,7 @@
#include "src/base/atomic-utils.h"
#include "src/base/macros.h"
#include "src/base/platform/mutex.h"
+#include "src/tracing/trace-event.h"
namespace v8 {
namespace internal {
@@ -19,16 +20,26 @@ class CpuProfiler;
class Isolate;
class TracingCpuProfilerImpl final
+#if defined(V8_USE_PERFETTO)
+ : public perfetto::TrackEventSessionObserver {
+#else
: private v8::TracingController::TraceStateObserver {
+#endif
public:
explicit TracingCpuProfilerImpl(Isolate*);
~TracingCpuProfilerImpl() override;
TracingCpuProfilerImpl(const TracingCpuProfilerImpl&) = delete;
TracingCpuProfilerImpl& operator=(const TracingCpuProfilerImpl&) = delete;
+#if defined(V8_USE_PERFETTO)
+ // perfetto::TrackEventSessionObserver
+ void OnStart(const perfetto::DataSourceBase::StartArgs&) override;
+ void OnStop(const perfetto::DataSourceBase::StopArgs&) override;
+#else
// v8::TracingController::TraceStateObserver
void OnTraceEnabled() final;
void OnTraceDisabled() final;
+#endif
private:
void StartProfiling();