v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
profiler-stats.h
Go to the documentation of this file.
1
// Copyright 2020 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_PROFILER_STATS_H_
6
#define V8_PROFILER_PROFILER_STATS_H_
7
8
#include <atomic>
9
10
namespace
v8
{
11
namespace
internal
{
12
13
// Stats are used to diagnose the reasons for dropped or unnattributed frames.
14
class
ProfilerStats
{
15
public
:
16
enum
Reason
{
17
// Reasons we fail to record a TickSample.
18
kTickBufferFull
,
19
kIsolateNotLocked
,
20
// These all generate a TickSample.
21
kSimulatorFillRegistersFailed
,
22
kNoFrameRegion
,
23
kInCallOrApply
,
24
kNoSymbolizedFrames
,
25
kNullPC
,
26
27
kNumberOfReasons
,
28
};
29
30
static
ProfilerStats
*
Instance
() {
31
static
ProfilerStats
stats;
32
return
&stats;
33
}
34
35
void
AddReason
(
Reason
reason);
36
void
Clear
();
37
void
Print
()
const
;
38
39
private
:
40
ProfilerStats
() =
default
;
41
static
const
char
*
ReasonToString
(
Reason
reason);
42
43
std::atomic_int
counts_
[
Reason::kNumberOfReasons
] = {};
44
};
45
46
}
// namespace internal
47
}
// namespace v8
48
49
#endif
// V8_PROFILER_PROFILER_STATS_H_
v8::internal::ProfilerStats
Definition
profiler-stats.h:14
v8::internal::ProfilerStats::Instance
static ProfilerStats * Instance()
Definition
profiler-stats.h:30
v8::internal::ProfilerStats::Reason
Reason
Definition
profiler-stats.h:16
v8::internal::ProfilerStats::kTickBufferFull
@ kTickBufferFull
Definition
profiler-stats.h:18
v8::internal::ProfilerStats::kIsolateNotLocked
@ kIsolateNotLocked
Definition
profiler-stats.h:19
v8::internal::ProfilerStats::kNoFrameRegion
@ kNoFrameRegion
Definition
profiler-stats.h:22
v8::internal::ProfilerStats::kNumberOfReasons
@ kNumberOfReasons
Definition
profiler-stats.h:27
v8::internal::ProfilerStats::kInCallOrApply
@ kInCallOrApply
Definition
profiler-stats.h:23
v8::internal::ProfilerStats::kSimulatorFillRegistersFailed
@ kSimulatorFillRegistersFailed
Definition
profiler-stats.h:21
v8::internal::ProfilerStats::kNullPC
@ kNullPC
Definition
profiler-stats.h:25
v8::internal::ProfilerStats::kNoSymbolizedFrames
@ kNoSymbolizedFrames
Definition
profiler-stats.h:24
v8::internal::ProfilerStats::ReasonToString
static const char * ReasonToString(Reason reason)
Definition
profiler-stats.cc:33
v8::internal::ProfilerStats::Clear
void Clear()
Definition
profiler-stats.cc:18
v8::internal::ProfilerStats::counts_
std::atomic_int counts_[Reason::kNumberOfReasons]
Definition
profiler-stats.h:43
v8::internal::ProfilerStats::Print
void Print() const
Definition
profiler-stats.cc:24
v8::internal::ProfilerStats::AddReason
void AddReason(Reason reason)
Definition
profiler-stats.cc:14
v8::internal::ProfilerStats::ProfilerStats
ProfilerStats()=default
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
src
profiler
profiler-stats.h
Generated on Sun Apr 6 2025 21:08:56 for v8 by
1.12.0