v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
tracing-cpu-profiler.h
Go to the documentation of this file.
1// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_PROFILER_TRACING_CPU_PROFILER_H_
6#define V8_PROFILER_TRACING_CPU_PROFILER_H_
7
8#include <memory>
9
10#include "include/v8-platform.h"
12#include "src/base/macros.h"
15
16namespace v8 {
17namespace internal {
18
19class CpuProfiler;
20class Isolate;
21
23#if defined(V8_USE_PERFETTO)
24 : public perfetto::TrackEventSessionObserver {
25#else
27#endif
28 public:
30 ~TracingCpuProfilerImpl() override;
33
34#if defined(V8_USE_PERFETTO)
35 // perfetto::TrackEventSessionObserver
36 void OnStart(const perfetto::DataSourceBase::StartArgs&) override;
37 void OnStop(const perfetto::DataSourceBase::StopArgs&) override;
38#else
39 // v8::TracingController::TraceStateObserver
40 void OnTraceEnabled() final;
41 void OnTraceDisabled() final;
42#endif
43
44 private:
45 void StartProfiling();
46 void StopProfiling();
47
49 std::unique_ptr<CpuProfiler> profiler_;
52};
53
54} // namespace internal
55} // namespace v8
56
57#endif // V8_PROFILER_TRACING_CPU_PROFILER_H_
TracingCpuProfilerImpl & operator=(const TracingCpuProfilerImpl &)=delete
TracingCpuProfilerImpl(const TracingCpuProfilerImpl &)=delete
std::unique_ptr< CpuProfiler > profiler_
bool defined