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
"
11
#include "
src/base/atomic-utils.h
"
12
#include "
src/base/macros.h
"
13
#include "
src/base/platform/mutex.h
"
14
#include "
src/tracing/trace-event.h
"
15
16
namespace
v8
{
17
namespace
internal
{
18
19
class
CpuProfiler;
20
class
Isolate;
21
22
class
TracingCpuProfilerImpl
final
23
#if
defined
(V8_USE_PERFETTO)
24
:
public
perfetto::TrackEventSessionObserver {
25
#else
26
:
private
v8::TracingController::TraceStateObserver
{
27
#endif
28
public
:
29
explicit
TracingCpuProfilerImpl
(
Isolate
*);
30
~TracingCpuProfilerImpl
()
override
;
31
TracingCpuProfilerImpl
(
const
TracingCpuProfilerImpl
&) =
delete
;
32
TracingCpuProfilerImpl
&
operator=
(
const
TracingCpuProfilerImpl
&) =
delete
;
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
48
Isolate
*
isolate_
;
49
std::unique_ptr<CpuProfiler>
profiler_
;
50
bool
profiling_enabled_
;
51
base::Mutex
mutex_
;
52
};
53
54
}
// namespace internal
55
}
// namespace v8
56
57
#endif
// V8_PROFILER_TRACING_CPU_PROFILER_H_
atomic-utils.h
v8::TracingController::TraceStateObserver
Definition
v8-platform.h:430
v8::base::Mutex
Definition
mutex.h:36
v8::internal::Isolate
Definition
isolate.h:586
v8::internal::TracingCpuProfilerImpl
Definition
tracing-cpu-profiler.h:26
v8::internal::TracingCpuProfilerImpl::mutex_
base::Mutex mutex_
Definition
tracing-cpu-profiler.h:51
v8::internal::TracingCpuProfilerImpl::isolate_
Isolate * isolate_
Definition
tracing-cpu-profiler.h:48
v8::internal::TracingCpuProfilerImpl::operator=
TracingCpuProfilerImpl & operator=(const TracingCpuProfilerImpl &)=delete
v8::internal::TracingCpuProfilerImpl::profiling_enabled_
bool profiling_enabled_
Definition
tracing-cpu-profiler.h:50
v8::internal::TracingCpuProfilerImpl::TracingCpuProfilerImpl
TracingCpuProfilerImpl(Isolate *)
Definition
tracing-cpu-profiler.cc:15
v8::internal::TracingCpuProfilerImpl::OnTraceDisabled
void OnTraceDisabled() final
Definition
tracing-cpu-profiler.cc:69
v8::internal::TracingCpuProfilerImpl::StartProfiling
void StartProfiling()
Definition
tracing-cpu-profiler.cc:87
v8::internal::TracingCpuProfilerImpl::~TracingCpuProfilerImpl
~TracingCpuProfilerImpl() override
Definition
tracing-cpu-profiler.cc:26
v8::internal::TracingCpuProfilerImpl::TracingCpuProfilerImpl
TracingCpuProfilerImpl(const TracingCpuProfilerImpl &)=delete
v8::internal::TracingCpuProfilerImpl::OnTraceEnabled
void OnTraceEnabled() final
Definition
tracing-cpu-profiler.cc:40
v8::internal::TracingCpuProfilerImpl::StopProfiling
void StopProfiling()
Definition
tracing-cpu-profiler.cc:97
v8::internal::TracingCpuProfilerImpl::profiler_
std::unique_ptr< CpuProfiler > profiler_
Definition
tracing-cpu-profiler.h:49
defined
bool defined
Definition
js-temporal-objects.cc:7418
mutex.h
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
macros.h
trace-event.h
v8-platform.h
src
profiler
tracing-cpu-profiler.h
Generated on Sun Apr 6 2025 21:08:56 for v8 by
1.12.0