Loading...
Searching...
No Matches
v8-profiler.h
Go to the documentation of this file.
1// Copyright 2010 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_V8_PROFILER_H_
6#define V8_V8_PROFILER_H_
7
8#include <limits.h>
9
10#include <memory>
11#include <unordered_set>
12#include <vector>
13
14#include "cppgc/common.h" // NOLINT(build/include_directory)
15#include "v8-local-handle.h" // NOLINT(build/include_directory)
16#include "v8-message.h" // NOLINT(build/include_directory)
17#include "v8-persistent-handle.h" // NOLINT(build/include_directory)
18
22namespace v8 {
23
24enum class EmbedderStateTag : uint8_t;
25class HeapGraphNode;
26struct HeapStatsUpdate;
27class Object;
28enum StateTag : uint16_t;
29
30using NativeObject = void*;
31using SnapshotObjectId = uint32_t;
32using ProfilerId = uint32_t;
33
36 size_t position;
37};
38
39namespace internal {
40class CpuProfile;
41} // namespace internal
42
43} // namespace v8
44
45#ifdef V8_OS_WIN
46template class V8_EXPORT std::vector<v8::CpuProfileDeoptFrame>;
47#endif
48
49namespace v8 {
50
53 const char* deopt_reason;
54 std::vector<CpuProfileDeoptFrame> stack;
55};
56
57} // namespace v8
58
59#ifdef V8_OS_WIN
60template class V8_EXPORT std::vector<v8::CpuProfileDeoptInfo>;
61#endif
62
63namespace v8 {
64
69 public:
70 struct LineTick {
72 int line;
73
76 int column;
77
79 unsigned int hit_count;
80 };
81
82 // An annotation hinting at the source of a CpuProfileNode.
84 // User-supplied script with associated resource information.
85 kScript = 0,
86 // Native scripts and provided builtins.
87 kBuiltin = 1,
88 // Callbacks into native code.
89 kCallback = 2,
90 // VM-internal functions or state.
91 kInternal = 3,
92 // A node that failed to symbolize.
93 kUnresolved = 4,
94 };
95
98
104 const char* GetFunctionNameStr() const;
105
107 int GetScriptId() const;
108
111
117 const char* GetScriptResourceNameStr() const;
118
124
129 int GetLineNumber() const;
130
135 int GetColumnNumber() const;
136
140 unsigned int GetHitLineCount() const;
141
147 bool GetLineTicks(LineTick* entries, unsigned int length) const;
148
152 const char* GetBailoutReason() const;
153
157 unsigned GetHitCount() const;
158
160 unsigned GetNodeId() const;
161
166
168 int GetChildrenCount() const;
169
171 const CpuProfileNode* GetChild(int index) const;
172
174 const CpuProfileNode* GetParent() const;
175
177 const std::vector<CpuProfileDeoptInfo>& GetDeoptInfos() const;
178
179 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo;
180 static const int kNoColumnNumberInfo = Message::kNoColumnInfo;
181};
182
187 public:
188 enum WriteResult { kContinue = 0, kAbort = 1 };
189 virtual ~OutputStream() = default;
191 virtual void EndOfStream() = 0;
193 virtual int GetChunkSize() { return 1024; }
199 virtual WriteResult WriteAsciiChunk(char* data, int size) = 0;
206 return kAbort;
207 }
208};
209
215 public:
217 kJSON = 0 // See format description near 'Serialize' method.
218 };
221
224
229 int GetSamplesCount() const;
230
235 const CpuProfileNode* GetSample(int index) const;
236
242 int64_t GetSampleTimestamp(int index) const;
243
248 int64_t GetStartTime() const;
249
253 StateTag GetSampleState(int index) const;
254
259
265 int64_t GetEndTime() const;
266
271 void Delete();
272
290 SerializationFormat format = kJSON) const;
291};
292
294 // In the resulting CpuProfile tree, intermediate nodes in a stack trace
295 // (from the root to a leaf) will have line numbers that point to the start
296 // line of the function, rather than the line of the callsite of the child.
298 // In the resulting CpuProfile tree, nodes are separated based on the line
299 // number of their callsite in their parent.
301};
302
303// Determines how names are derived for functions sampled.
305 // Use the immediate name of functions at compilation time.
307 // Use more verbose naming for functions without names, inferred from scope
308 // where possible.
310};
311
313 // Enables logging when a profile is active, and disables logging when all
314 // profiles are detached.
316 // Enables logging for the lifetime of the CpuProfiler. Calls to
317 // StartRecording are faster, at the expense of runtime overhead.
319};
320
321// Enum for returning profiling status. Once StartProfiling is called,
322// we want to return to clients whether the profiling was able to start
323// correctly, or return a descriptive error.
325 kStarted,
328};
329
337};
338
343 public:
345
346 virtual ~DiscardedSamplesDelegate() = default;
347 virtual void Notify() = 0;
348
349 ProfilerId GetId() const { return profiler_id_; }
350
351 private:
352 friend internal::CpuProfile;
353
354 void SetId(ProfilerId id) { profiler_id_ = id; }
355
356 ProfilerId profiler_id_;
357};
358
363 public:
364 // Indicates that the sample buffer size should not be explicitly limited.
365 static const unsigned kNoSampleLimit = UINT_MAX;
366
383 CpuProfilingMode mode = kLeafNodeLineNumbers,
384 unsigned max_samples = kNoSampleLimit, int sampling_interval_us = 0,
385 MaybeLocal<Context> filter_context = MaybeLocal<Context>());
386
389
390 CpuProfilingMode mode() const { return mode_; }
391 unsigned max_samples() const { return max_samples_; }
392 int sampling_interval_us() const { return sampling_interval_us_; }
393
394 private:
395 friend class internal::CpuProfile;
396
397 bool has_filter_context() const { return !filter_context_.IsEmpty(); }
398 void* raw_filter_context() const;
399
400 CpuProfilingMode mode_;
401 unsigned max_samples_;
402 int sampling_interval_us_;
403 Global<Context> filter_context_;
404};
405
411 public:
417 static CpuProfiler* New(Isolate* isolate,
418 CpuProfilingNamingMode = kDebugNaming,
419 CpuProfilingLoggingMode = kLazyLogging);
420
428 static void CollectSample(
429 Isolate* isolate, const std::optional<uint64_t> trace_id = std::nullopt);
430
434 void Dispose();
435
442
451
457 CpuProfilingOptions options,
458 std::unique_ptr<DiscardedSamplesDelegate> delegate = nullptr);
459
466 Local<String> title, CpuProfilingOptions options,
467 std::unique_ptr<DiscardedSamplesDelegate> delegate = nullptr);
468
481 Local<String> title, CpuProfilingMode mode, bool record_samples = false,
482 unsigned max_samples = CpuProfilingOptions::kNoSampleLimit);
483
489 CpuProfilingResult Start(Local<String> title, bool record_samples = false);
490
497 Local<String> title, CpuProfilingOptions options,
498 std::unique_ptr<DiscardedSamplesDelegate> delegate = nullptr);
499
512 Local<String> title, CpuProfilingMode mode, bool record_samples = false,
513 unsigned max_samples = CpuProfilingOptions::kNoSampleLimit);
514
521 bool record_samples = false);
522
527
533
539
540 private:
541 CpuProfiler();
542 ~CpuProfiler();
543 CpuProfiler(const CpuProfiler&);
544 CpuProfiler& operator=(const CpuProfiler&);
545};
546
552 public:
553 enum Type {
554 kContextVariable = 0, // A variable from a function context.
555 kElement = 1, // An element of an array.
556 kProperty = 2, // A named object property.
557 kInternal = 3, // A link that can't be accessed from JS,
558 // thus, its name isn't a real property name
559 // (e.g. parts of a ConsString).
560 kHidden = 4, // A link that is needed for proper sizes
561 // calculation, but may be hidden from user.
562 kShortcut = 5, // A link that must not be followed during
563 // sizes calculation.
564 kWeak = 6 // A weak reference (ignored by the GC).
565 };
566
568 Type GetType() const;
569
575
578
580 const HeapGraphNode* GetToNode() const;
581};
582
583
588 public:
589 enum Type {
590 kHidden = 0, // Hidden node, may be filtered when shown to user.
591 kArray = 1, // An array of elements.
592 kString = 2, // A string.
593 kObject = 3, // A JS object (except for arrays and strings).
594 kCode = 4, // Compiled code.
595 kClosure = 5, // Function closure.
596 kRegExp = 6, // RegExp.
597 kHeapNumber = 7, // Number stored in the heap.
598 kNative = 8, // Native object (not from V8 heap).
599 kSynthetic = 9, // Synthetic object, usually used for grouping
600 // snapshot items together.
601 kConsString = 10, // Concatenated string. A pair of pointers to strings.
602 kSlicedString = 11, // Sliced string. A fragment of another string.
603 kSymbol = 12, // A Symbol (ES6).
604 kBigInt = 13, // BigInt.
605 kObjectShape = 14, // Internal data used for tracking the shapes (or
606 // "hidden classes") of JS objects.
607 };
608
610 Type GetType() const;
611
618
624
626 size_t GetShallowSize() const;
627
629 int GetChildrenCount() const;
630
632 const HeapGraphEdge* GetChild(int index) const;
633};
634
639 public:
641 kJSON = 0 // See format description near 'Serialize' method.
642 };
643
645 const HeapGraphNode* GetRoot() const;
646
649
651 int GetNodesCount() const;
652
654 const HeapGraphNode* GetNode(int index) const;
655
658
664 void Delete();
665
693 SerializationFormat format = kJSON) const;
694};
695
696
702 public:
704 kContinue = 0,
705 kAbort = 1
706 };
707 virtual ~ActivityControl() = default;
712 virtual ControlOption ReportProgressValue(uint32_t done, uint32_t total) = 0;
713};
714
720 public:
721 struct Allocation {
725 size_t size;
726
730 unsigned int count;
731 };
732
736 struct Node {
742
748
754
759
765
771
775 uint32_t node_id;
776
782 std::vector<Node*> children;
783
787 std::vector<Allocation> allocations;
788 };
789
793 struct Sample {
797 uint32_t node_id;
798
802 size_t size;
803
807 unsigned int count;
808
813 uint64_t sample_id;
814 };
815
821 virtual Node* GetRootNode() = 0;
822 virtual const std::vector<Sample>& GetSamples() = 0;
823
824 virtual ~AllocationProfile() = default;
825
826 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo;
827 static const int kNoColumnNumberInfo = Message::kNoColumnInfo;
828};
829
845 public:
846 class Node {
847 public:
855 enum class Detachedness : uint8_t {
856 kUnknown = 0,
857 kAttached = 1,
858 kDetached = 2,
859 };
860
861 Node() = default;
862 virtual ~Node() = default;
863 virtual const char* Name() = 0;
864 virtual size_t SizeInBytes() = 0;
870 virtual Node* WrapperNode() { return nullptr; }
871 virtual bool IsRootNode() { return false; }
873 virtual bool IsEmbedderNode() { return true; }
877 virtual const char* NamePrefix() { return nullptr; }
878
883 virtual NativeObject GetNativeObject() { return nullptr; }
884
891 virtual Detachedness GetDetachedness() { return Detachedness::kUnknown; }
892
900 virtual const void* GetAddress() { return nullptr; }
901
902 Node(const Node&) = delete;
903 Node& operator=(const Node&) = delete;
904 };
905
916 virtual Node* V8Node(const v8::Local<v8::Value>& value) = 0;
917
929 virtual Node* V8Node(const v8::Local<v8::Data>& value);
930
935 virtual Node* AddNode(std::unique_ptr<Node> node) = 0;
936
945 virtual void AddEdge(Node* from, Node* to, const char* name = nullptr) = 0;
946
954 virtual void AddNativeSize(size_t size) {}
955
956 virtual ~EmbedderGraph() = default;
957};
958
960 public:
961 virtual ~QueryObjectPredicate() = default;
962 virtual bool Filter(v8::Local<v8::Object> object) = 0;
963};
964
970 public:
972 QueryObjectPredicate* predicate,
973 std::vector<v8::Global<v8::Object>>* objects);
974
976 kSamplingNoFlags = 0,
977 kSamplingForceGC = 1 << 0,
978 kSamplingIncludeObjectsCollectedByMajorGC = 1 << 1,
979 kSamplingIncludeObjectsCollectedByMinorGC = 1 << 2,
980 };
981
988 typedef void (*BuildEmbedderGraphCallback)(v8::Isolate* isolate,
989 v8::EmbedderGraph* graph,
990 void* data);
991
1001 v8::Isolate* isolate, const v8::Local<v8::Value>& v8_value,
1002 uint16_t class_id, void* data);
1003
1006
1009
1015
1021
1027
1034
1040 static const SnapshotObjectId kUnknownObjectId = 0;
1041
1046 public:
1051 virtual const char* GetName(Local<Object> object) = 0;
1052
1053 protected:
1054 virtual ~ObjectNameResolver() = default;
1055 };
1056
1057 enum class HeapSnapshotMode {
1061 kRegular,
1065 kExposeInternals,
1066 };
1067
1068 enum class NumericsMode {
1073 kHideNumericValues,
1077 kExposeNumericValues
1078 };
1079
1080 struct HeapSnapshotOptions final {
1081 // Manually define default constructor here to be able to use it in
1082 // `TakeSnapshot()` below.
1083 // NOLINTNEXTLINE
1085
1089 ActivityControl* control = nullptr;
1093 ObjectNameResolver* global_object_name_resolver = nullptr;
1097 HeapSnapshotMode snapshot_mode = HeapSnapshotMode::kRegular;
1101 NumericsMode numerics_mode = NumericsMode::kHideNumericValues;
1107 };
1108
1115 const HeapSnapshotOptions& options = HeapSnapshotOptions());
1116
1124 ActivityControl* control,
1125 ObjectNameResolver* global_object_name_resolver = nullptr,
1126 bool hide_internals = true, bool capture_numeric_value = false);
1127
1132 std::vector<v8::Local<v8::Value>> GetDetachedJSWrapperObjects();
1133
1143 void StartTrackingHeapObjects(bool track_allocations = false);
1144
1159 int64_t* timestamp_us = nullptr);
1160
1167
1193 bool StartSamplingHeapProfiler(uint64_t sample_interval = 512 * 1024,
1194 int stack_depth = 16,
1195 SamplingFlags flags = kSamplingNoFlags);
1196
1201
1209
1215
1216 void AddBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback,
1217 void* data);
1218 void RemoveBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback,
1219 void* data);
1220
1222
1227
1233 const char* CopyNameForHeapSnapshot(const char* name);
1234
1240 static const uint16_t kPersistentHandleNoClassId = 0;
1241
1242 private:
1243 HeapProfiler();
1244 ~HeapProfiler();
1245 HeapProfiler(const HeapProfiler&);
1246 HeapProfiler& operator=(const HeapProfiler&);
1247};
1248
1254 HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size)
1255 : index(index), count(count), size(size) { }
1256 uint32_t index; // Index of the time interval that was changed.
1257 uint32_t count; // New value of count field for the interval with this index.
1258 uint32_t size; // New value of size field for the interval with this index.
1259};
1260
1261#define CODE_EVENTS_LIST(V) \
1262 V(Builtin) \
1263 V(Callback) \
1264 V(Eval) \
1265 V(Function) \
1266 V(InterpretedFunction) \
1267 V(Handler) \
1268 V(BytecodeHandler) \
1269 V(LazyCompile) /* Unused, use kFunction instead */ \
1270 V(RegExp) \
1271 V(Script) \
1272 V(Stub) \
1273 V(Relocation)
1274
1280 kUnknownType = 0
1281#define V(Name) , k##Name##Type
1283#undef V
1284};
1285
1289class V8_EXPORT CodeEvent {
1290 public:
1291 uintptr_t GetCodeStartAddress();
1292 size_t GetCodeSize();
1293 Local<String> GetFunctionName();
1294 Local<String> GetScriptName();
1295 int GetScriptLine();
1296 int GetScriptColumn();
1302 CodeEventType GetCodeType();
1303 const char* GetComment();
1305 static const char* GetCodeEventTypeName(CodeEventType code_event_type);
1307 uintptr_t GetPreviousCodeStartAddress();
1308};
1309
1314 public:
1320 explicit CodeEventHandler(Isolate* isolate);
1321 virtual ~CodeEventHandler();
1322
1331 virtual void Handle(CodeEvent* code_event) = 0;
1332
1337 void Enable();
1338
1343 void Disable();
1344
1345 private:
1348 CodeEventHandler& operator=(const CodeEventHandler&);
1349 void* internal_listener_;
1350};
1351
1352} // namespace v8
1353
1354
1355#endif // V8_V8_PROFILER_H_
Definition: v8-profiler.h:701
ControlOption
Definition: v8-profiler.h:703
virtual ControlOption ReportProgressValue(uint32_t done, uint32_t total)=0
virtual ~ActivityControl()=default
Definition: v8-profiler.h:719
virtual const std::vector< Sample > & GetSamples()=0
virtual Node * GetRootNode()=0
virtual ~AllocationProfile()=default
Definition: v8-profiler.h:1312
Definition: v8-profiler.h:1288
Definition: v8-profiler.h:68
const CpuProfileNode * GetChild(int index) const
bool GetLineTicks(LineTick *entries, unsigned int length) const
const CpuProfileNode * GetParent() const
unsigned GetHitCount() const
unsigned int GetHitLineCount() const
int GetLineNumber() const
unsigned GetNodeId() const
const char * GetScriptResourceNameStr() const
const char * GetFunctionNameStr() const
const std::vector< CpuProfileDeoptInfo > & GetDeoptInfos() const
SourceType
Definition: v8-profiler.h:83
int GetColumnNumber() const
Local< String > GetFunctionName() const
Local< String > GetScriptResourceName() const
SourceType GetSourceType() const
const char * GetBailoutReason() const
int GetScriptId() const
bool IsScriptSharedCrossOrigin() const
int GetChildrenCount() const
Definition: v8-profiler.h:214
const CpuProfileNode * GetTopDownRoot() const
int GetSamplesCount() const
StateTag GetSampleState(int index) const
Local< String > GetTitle() const
int64_t GetEndTime() const
const CpuProfileNode * GetSample(int index) const
SerializationFormat
Definition: v8-profiler.h:216
int64_t GetSampleTimestamp(int index) const
int64_t GetStartTime() const
EmbedderStateTag GetSampleEmbedderState(int index) const
void Serialize(OutputStream *stream, SerializationFormat format=kJSON) const
Definition: v8-profiler.h:410
CpuProfilingResult Start(CpuProfilingOptions options, std::unique_ptr< DiscardedSamplesDelegate > delegate=nullptr)
static void CollectSample(Isolate *isolate, const std::optional< uint64_t > trace_id=std::nullopt)
CpuProfilingStatus StartProfiling(Local< String > title, CpuProfilingOptions options, std::unique_ptr< DiscardedSamplesDelegate > delegate=nullptr)
void SetUsePreciseSampling(bool)
static CpuProfiler * New(Isolate *isolate, CpuProfilingNamingMode=kDebugNaming, CpuProfilingLoggingMode=kLazyLogging)
CpuProfilingResult Start(Local< String > title, CpuProfilingMode mode, bool record_samples=false, unsigned max_samples=CpuProfilingOptions::kNoSampleLimit)
CpuProfilingStatus StartProfiling(Local< String > title, CpuProfilingMode mode, bool record_samples=false, unsigned max_samples=CpuProfilingOptions::kNoSampleLimit)
CpuProfile * StopProfiling(Local< String > title)
CpuProfilingResult Start(Local< String > title, CpuProfilingOptions options, std::unique_ptr< DiscardedSamplesDelegate > delegate=nullptr)
void SetSamplingInterval(int us)
CpuProfile * Stop(ProfilerId id)
static void UseDetailedSourcePositionsForProfiling(Isolate *isolate)
CpuProfilingStatus StartProfiling(Local< String > title, bool record_samples=false)
CpuProfilingResult Start(Local< String > title, bool record_samples=false)
Definition: v8-profiler.h:362
CpuProfilingOptions & operator=(CpuProfilingOptions &&)=default
int sampling_interval_us() const
Definition: v8-profiler.h:392
CpuProfilingMode mode() const
Definition: v8-profiler.h:390
unsigned max_samples() const
Definition: v8-profiler.h:391
CpuProfilingOptions(CpuProfilingOptions &&)=default
CpuProfilingOptions(CpuProfilingMode mode=kLeafNodeLineNumbers, unsigned max_samples=kNoSampleLimit, int sampling_interval_us=0, MaybeLocal< Context > filter_context=MaybeLocal< Context >())
Definition: v8-profiler.h:342
ProfilerId GetId() const
Definition: v8-profiler.h:349
virtual ~DiscardedSamplesDelegate()=default
Definition: v8-profiler.h:846
virtual Detachedness GetDetachedness()
Definition: v8-profiler.h:891
Detachedness
Definition: v8-profiler.h:855
Node & operator=(const Node &)=delete
virtual size_t SizeInBytes()=0
virtual bool IsEmbedderNode()
Definition: v8-profiler.h:873
virtual const char * Name()=0
virtual NativeObject GetNativeObject()
Definition: v8-profiler.h:883
virtual ~Node()=default
virtual Node * WrapperNode()
Definition: v8-profiler.h:870
Node(const Node &)=delete
virtual const char * NamePrefix()
Definition: v8-profiler.h:877
virtual const void * GetAddress()
Definition: v8-profiler.h:900
virtual bool IsRootNode()
Definition: v8-profiler.h:871
Definition: v8-profiler.h:844
virtual void AddNativeSize(size_t size)
Definition: v8-profiler.h:954
virtual ~EmbedderGraph()=default
virtual void AddEdge(Node *from, Node *to, const char *name=nullptr)=0
virtual Node * AddNode(std::unique_ptr< Node > node)=0
virtual Node * V8Node(const v8::Local< v8::Data > &value)
virtual Node * V8Node(const v8::Local< v8::Value > &value)=0
Definition: v8-persistent-handle.h:349
Definition: v8-profiler.h:551
Type
Definition: v8-profiler.h:553
const HeapGraphNode * GetToNode() const
const HeapGraphNode * GetFromNode() const
Type GetType() const
Local< Value > GetName() const
Definition: v8-profiler.h:587
Local< String > GetName() const
SnapshotObjectId GetId() const
Type GetType() const
Type
Definition: v8-profiler.h:589
const HeapGraphEdge * GetChild(int index) const
size_t GetShallowSize() const
int GetChildrenCount() const
Definition: v8-profiler.h:1045
virtual const char * GetName(Local< Object > object)=0
Definition: v8-profiler.h:969
void StartTrackingHeapObjects(bool track_allocations=false)
void SetGetDetachednessCallback(GetDetachednessCallback callback, void *data)
bool IsTakingSnapshot()
Local< Value > FindObjectById(SnapshotObjectId id)
AllocationProfile * GetAllocationProfile()
void RemoveBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, void *data)
void AddBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, void *data)
std::vector< v8::Local< v8::Value > > GetDetachedJSWrapperObjects()
void DeleteAllHeapSnapshots()
bool StartSamplingHeapProfiler(uint64_t sample_interval=512 *1024, int stack_depth=16, SamplingFlags flags=kSamplingNoFlags)
const char * CopyNameForHeapSnapshot(const char *name)
HeapSnapshotMode
Definition: v8-profiler.h:1057
const HeapSnapshot * TakeHeapSnapshot(ActivityControl *control, ObjectNameResolver *global_object_name_resolver=nullptr, bool hide_internals=true, bool capture_numeric_value=false)
SamplingFlags
Definition: v8-profiler.h:975
void QueryObjects(v8::Local< v8::Context > context, QueryObjectPredicate *predicate, std::vector< v8::Global< v8::Object > > *objects)
SnapshotObjectId GetObjectId(NativeObject value)
SnapshotObjectId GetObjectId(Local< Value > value)
void StopSamplingHeapProfiler()
const HeapSnapshot * TakeHeapSnapshot(const HeapSnapshotOptions &options=HeapSnapshotOptions())
const HeapSnapshot * GetHeapSnapshot(int index)
SnapshotObjectId GetHeapStats(OutputStream *stream, int64_t *timestamp_us=nullptr)
void StopTrackingHeapObjects()
EmbedderGraph::Node::Detachedness(*)(v8::Isolate *isolate, const v8::Local< v8::Value > &v8_value, uint16_t class_id, void *data) GetDetachednessCallback
Definition: v8-profiler.h:1002
NumericsMode
Definition: v8-profiler.h:1068
Definition: v8-profiler.h:638
const HeapGraphNode * GetNodeById(SnapshotObjectId id) const
int GetNodesCount() const
SerializationFormat
Definition: v8-profiler.h:640
const HeapGraphNode * GetRoot() const
SnapshotObjectId GetMaxSnapshotJSObjectId() const
const HeapGraphNode * GetNode(int index) const
void Serialize(OutputStream *stream, SerializationFormat format=kJSON) const
Definition: v8-isolate.h:274
Definition: v8-local-handle.h:267
Definition: v8-local-handle.h:635
Definition: v8-profiler.h:186
virtual ~OutputStream()=default
virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate *data, int count)
Definition: v8-profiler.h:205
WriteResult
Definition: v8-profiler.h:188
virtual WriteResult WriteAsciiChunk(char *data, int size)=0
virtual void EndOfStream()=0
virtual int GetChunkSize()
Definition: v8-profiler.h:193
Definition: v8-profiler.h:959
virtual bool Filter(v8::Local< v8::Object > object)=0
virtual ~QueryObjectPredicate()=default
EmbedderStackState
Definition: common.h:15
Definition: libplatform.h:15
uint32_t SnapshotObjectId
Definition: v8-profiler.h:31
CpuProfilingStatus
Definition: v8-profiler.h:324
uint32_t ProfilerId
Definition: v8-profiler.h:32
CpuProfilingLoggingMode
Definition: v8-profiler.h:312
@ kEagerLogging
Definition: v8-profiler.h:318
@ kLazyLogging
Definition: v8-profiler.h:315
EmbedderStateTag
Definition: v8-embedder-state-scope.h:22
CpuProfilingMode
Definition: v8-profiler.h:293
@ kLeafNodeLineNumbers
Definition: v8-profiler.h:297
@ kCallerLineNumbers
Definition: v8-profiler.h:300
void * NativeObject
Definition: v8-profiler.h:30
CpuProfilingNamingMode
Definition: v8-profiler.h:304
@ kStandardNaming
Definition: v8-profiler.h:306
@ kDebugNaming
Definition: v8-profiler.h:309
CodeEventType
Definition: v8-profiler.h:1279
@ kUnknownType
Definition: v8-profiler.h:1280
StateTag
Definition: v8-unwinder.h:36
Definition: v8-profiler.h:721
unsigned int count
Definition: v8-profiler.h:730
size_t size
Definition: v8-profiler.h:725
Definition: v8-profiler.h:736
std::vector< Node * > children
Definition: v8-profiler.h:782
int script_id
Definition: v8-profiler.h:753
int start_position
Definition: v8-profiler.h:758
std::vector< Allocation > allocations
Definition: v8-profiler.h:787
int column_number
Definition: v8-profiler.h:770
uint32_t node_id
Definition: v8-profiler.h:775
int line_number
Definition: v8-profiler.h:764
Local< String > script_name
Definition: v8-profiler.h:747
Local< String > name
Definition: v8-profiler.h:741
Definition: v8-profiler.h:793
unsigned int count
Definition: v8-profiler.h:807
size_t size
Definition: v8-profiler.h:802
uint32_t node_id
Definition: v8-profiler.h:797
uint64_t sample_id
Definition: v8-profiler.h:813
Definition: v8-profiler.h:34
size_t position
Definition: v8-profiler.h:36
int script_id
Definition: v8-profiler.h:35
Definition: v8-profiler.h:51
const char * deopt_reason
Definition: v8-profiler.h:53
std::vector< CpuProfileDeoptFrame > stack
Definition: v8-profiler.h:54
Definition: v8-profiler.h:70
unsigned int hit_count
Definition: v8-profiler.h:79
int column
Definition: v8-profiler.h:76
int line
Definition: v8-profiler.h:72
Definition: v8-profiler.h:334
const ProfilerId id
Definition: v8-profiler.h:335
const CpuProfilingStatus status
Definition: v8-profiler.h:336
Definition: v8-profiler.h:1080
HeapSnapshotOptions()
Definition: v8-profiler.h:1084
Definition: v8-profiler.h:1253
uint32_t size
Definition: v8-profiler.h:1258
uint32_t index
Definition: v8-profiler.h:1256
uint32_t count
Definition: v8-profiler.h:1257
HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size)
Definition: v8-profiler.h:1254
#define V(Name)
#define CODE_EVENTS_LIST(V)
Definition: v8-profiler.h:1261
#define V8_EXPORT
Definition: v8config.h:800