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
75 unsigned int hit_count;
76 };
77
78 // An annotation hinting at the source of a CpuProfileNode.
80 // User-supplied script with associated resource information.
81 kScript = 0,
82 // Native scripts and provided builtins.
83 kBuiltin = 1,
84 // Callbacks into native code.
85 kCallback = 2,
86 // VM-internal functions or state.
87 kInternal = 3,
88 // A node that failed to symbolize.
89 kUnresolved = 4,
90 };
91
94
100 const char* GetFunctionNameStr() const;
101
103 int GetScriptId() const;
104
107
113 const char* GetScriptResourceNameStr() const;
114
120
125 int GetLineNumber() const;
126
131 int GetColumnNumber() const;
132
136 unsigned int GetHitLineCount() const;
137
143 bool GetLineTicks(LineTick* entries, unsigned int length) const;
144
148 const char* GetBailoutReason() const;
149
153 unsigned GetHitCount() const;
154
156 unsigned GetNodeId() const;
157
162
164 int GetChildrenCount() const;
165
167 const CpuProfileNode* GetChild(int index) const;
168
170 const CpuProfileNode* GetParent() const;
171
173 const std::vector<CpuProfileDeoptInfo>& GetDeoptInfos() const;
174
175 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo;
176 static const int kNoColumnNumberInfo = Message::kNoColumnInfo;
177};
178
183 public:
184 enum WriteResult { kContinue = 0, kAbort = 1 };
185 virtual ~OutputStream() = default;
187 virtual void EndOfStream() = 0;
189 virtual int GetChunkSize() { return 1024; }
195 virtual WriteResult WriteAsciiChunk(char* data, int size) = 0;
202 return kAbort;
203 }
204};
205
211 public:
213 kJSON = 0 // See format description near 'Serialize' method.
214 };
217
220
225 int GetSamplesCount() const;
226
231 const CpuProfileNode* GetSample(int index) const;
232
238 int64_t GetSampleTimestamp(int index) const;
239
244 int64_t GetStartTime() const;
245
249 StateTag GetSampleState(int index) const;
250
255
261 int64_t GetEndTime() const;
262
267 void Delete();
268
286 SerializationFormat format = kJSON) const;
287};
288
290 // In the resulting CpuProfile tree, intermediate nodes in a stack trace
291 // (from the root to a leaf) will have line numbers that point to the start
292 // line of the function, rather than the line of the callsite of the child.
294 // In the resulting CpuProfile tree, nodes are separated based on the line
295 // number of their callsite in their parent.
297};
298
299// Determines how names are derived for functions sampled.
301 // Use the immediate name of functions at compilation time.
303 // Use more verbose naming for functions without names, inferred from scope
304 // where possible.
306};
307
309 // Enables logging when a profile is active, and disables logging when all
310 // profiles are detached.
312 // Enables logging for the lifetime of the CpuProfiler. Calls to
313 // StartRecording are faster, at the expense of runtime overhead.
315};
316
317// Enum for returning profiling status. Once StartProfiling is called,
318// we want to return to clients whether the profiling was able to start
319// correctly, or return a descriptive error.
321 kStarted,
324};
325
333};
334
339 public:
341
342 virtual ~DiscardedSamplesDelegate() = default;
343 virtual void Notify() = 0;
344
345 ProfilerId GetId() const { return profiler_id_; }
346
347 private:
348 friend internal::CpuProfile;
349
350 void SetId(ProfilerId id) { profiler_id_ = id; }
351
352 ProfilerId profiler_id_;
353};
354
359 public:
360 // Indicates that the sample buffer size should not be explicitly limited.
361 static const unsigned kNoSampleLimit = UINT_MAX;
362
379 CpuProfilingMode mode = kLeafNodeLineNumbers,
380 unsigned max_samples = kNoSampleLimit, int sampling_interval_us = 0,
381 MaybeLocal<Context> filter_context = MaybeLocal<Context>());
382
385
386 CpuProfilingMode mode() const { return mode_; }
387 unsigned max_samples() const { return max_samples_; }
388 int sampling_interval_us() const { return sampling_interval_us_; }
389
390 private:
391 friend class internal::CpuProfile;
392
393 bool has_filter_context() const { return !filter_context_.IsEmpty(); }
394 void* raw_filter_context() const;
395
396 CpuProfilingMode mode_;
397 unsigned max_samples_;
398 int sampling_interval_us_;
399 Global<Context> filter_context_;
400};
401
407 public:
413 static CpuProfiler* New(Isolate* isolate,
414 CpuProfilingNamingMode = kDebugNaming,
415 CpuProfilingLoggingMode = kLazyLogging);
416
422 static void CollectSample(Isolate* isolate);
423
427 void Dispose();
428
435
444
450 CpuProfilingOptions options,
451 std::unique_ptr<DiscardedSamplesDelegate> delegate = nullptr);
452
459 Local<String> title, CpuProfilingOptions options,
460 std::unique_ptr<DiscardedSamplesDelegate> delegate = nullptr);
461
474 Local<String> title, CpuProfilingMode mode, bool record_samples = false,
475 unsigned max_samples = CpuProfilingOptions::kNoSampleLimit);
476
482 CpuProfilingResult Start(Local<String> title, bool record_samples = false);
483
490 Local<String> title, CpuProfilingOptions options,
491 std::unique_ptr<DiscardedSamplesDelegate> delegate = nullptr);
492
505 Local<String> title, CpuProfilingMode mode, bool record_samples = false,
506 unsigned max_samples = CpuProfilingOptions::kNoSampleLimit);
507
514 bool record_samples = false);
515
520
526
532
533 private:
534 CpuProfiler();
535 ~CpuProfiler();
536 CpuProfiler(const CpuProfiler&);
537 CpuProfiler& operator=(const CpuProfiler&);
538};
539
545 public:
546 enum Type {
547 kContextVariable = 0, // A variable from a function context.
548 kElement = 1, // An element of an array.
549 kProperty = 2, // A named object property.
550 kInternal = 3, // A link that can't be accessed from JS,
551 // thus, its name isn't a real property name
552 // (e.g. parts of a ConsString).
553 kHidden = 4, // A link that is needed for proper sizes
554 // calculation, but may be hidden from user.
555 kShortcut = 5, // A link that must not be followed during
556 // sizes calculation.
557 kWeak = 6 // A weak reference (ignored by the GC).
558 };
559
561 Type GetType() const;
562
568
571
573 const HeapGraphNode* GetToNode() const;
574};
575
576
581 public:
582 enum Type {
583 kHidden = 0, // Hidden node, may be filtered when shown to user.
584 kArray = 1, // An array of elements.
585 kString = 2, // A string.
586 kObject = 3, // A JS object (except for arrays and strings).
587 kCode = 4, // Compiled code.
588 kClosure = 5, // Function closure.
589 kRegExp = 6, // RegExp.
590 kHeapNumber = 7, // Number stored in the heap.
591 kNative = 8, // Native object (not from V8 heap).
592 kSynthetic = 9, // Synthetic object, usually used for grouping
593 // snapshot items together.
594 kConsString = 10, // Concatenated string. A pair of pointers to strings.
595 kSlicedString = 11, // Sliced string. A fragment of another string.
596 kSymbol = 12, // A Symbol (ES6).
597 kBigInt = 13, // BigInt.
598 kObjectShape = 14, // Internal data used for tracking the shapes (or
599 // "hidden classes") of JS objects.
600 };
601
603 Type GetType() const;
604
611
617
619 size_t GetShallowSize() const;
620
622 int GetChildrenCount() const;
623
625 const HeapGraphEdge* GetChild(int index) const;
626};
627
632 public:
634 kJSON = 0 // See format description near 'Serialize' method.
635 };
636
638 const HeapGraphNode* GetRoot() const;
639
642
644 int GetNodesCount() const;
645
647 const HeapGraphNode* GetNode(int index) const;
648
651
657 void Delete();
658
686 SerializationFormat format = kJSON) const;
687};
688
689
695 public:
697 kContinue = 0,
698 kAbort = 1
699 };
700 virtual ~ActivityControl() = default;
705 virtual ControlOption ReportProgressValue(uint32_t done, uint32_t total) = 0;
706};
707
713 public:
714 struct Allocation {
718 size_t size;
719
723 unsigned int count;
724 };
725
729 struct Node {
735
741
747
752
758
764
768 uint32_t node_id;
769
775 std::vector<Node*> children;
776
780 std::vector<Allocation> allocations;
781 };
782
786 struct Sample {
790 uint32_t node_id;
791
795 size_t size;
796
800 unsigned int count;
801
806 uint64_t sample_id;
807 };
808
814 virtual Node* GetRootNode() = 0;
815 virtual const std::vector<Sample>& GetSamples() = 0;
816
817 virtual ~AllocationProfile() = default;
818
819 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo;
820 static const int kNoColumnNumberInfo = Message::kNoColumnInfo;
821};
822
838 public:
839 class Node {
840 public:
848 enum class Detachedness : uint8_t {
849 kUnknown = 0,
850 kAttached = 1,
851 kDetached = 2,
852 };
853
854 Node() = default;
855 virtual ~Node() = default;
856 virtual const char* Name() = 0;
857 virtual size_t SizeInBytes() = 0;
863 virtual Node* WrapperNode() { return nullptr; }
864 virtual bool IsRootNode() { return false; }
866 virtual bool IsEmbedderNode() { return true; }
870 virtual const char* NamePrefix() { return nullptr; }
871
876 virtual NativeObject GetNativeObject() { return nullptr; }
877
884 virtual Detachedness GetDetachedness() { return Detachedness::kUnknown; }
885
893 virtual const void* GetAddress() { return nullptr; }
894
895 Node(const Node&) = delete;
896 Node& operator=(const Node&) = delete;
897 };
898
909 virtual Node* V8Node(const v8::Local<v8::Value>& value) = 0;
910
922 virtual Node* V8Node(const v8::Local<v8::Data>& value);
923
928 virtual Node* AddNode(std::unique_ptr<Node> node) = 0;
929
938 virtual void AddEdge(Node* from, Node* to, const char* name = nullptr) = 0;
939
940 virtual ~EmbedderGraph() = default;
941};
942
944 public:
945 virtual ~QueryObjectPredicate() = default;
946 virtual bool Filter(v8::Local<v8::Object> object) = 0;
947};
948
954 public:
956 QueryObjectPredicate* predicate,
957 std::vector<v8::Global<v8::Object>>* objects);
958
960 kSamplingNoFlags = 0,
961 kSamplingForceGC = 1 << 0,
962 kSamplingIncludeObjectsCollectedByMajorGC = 1 << 1,
963 kSamplingIncludeObjectsCollectedByMinorGC = 1 << 2,
964 };
965
972 typedef void (*BuildEmbedderGraphCallback)(v8::Isolate* isolate,
973 v8::EmbedderGraph* graph,
974 void* data);
975
985 v8::Isolate* isolate, const v8::Local<v8::Value>& v8_value,
986 uint16_t class_id, void* data);
987
990
992 const HeapSnapshot* GetHeapSnapshot(int index);
993
999
1005
1011
1018
1024 static const SnapshotObjectId kUnknownObjectId = 0;
1025
1030 public:
1035 virtual const char* GetName(Local<Object> object) = 0;
1036
1037 protected:
1038 virtual ~ObjectNameResolver() = default;
1039 };
1040
1041 enum class HeapSnapshotMode {
1045 kRegular,
1049 kExposeInternals,
1050 };
1051
1052 enum class NumericsMode {
1057 kHideNumericValues,
1061 kExposeNumericValues
1062 };
1063
1064 struct HeapSnapshotOptions final {
1065 // Manually define default constructor here to be able to use it in
1066 // `TakeSnapshot()` below.
1067 // NOLINTNEXTLINE
1069
1073 ActivityControl* control = nullptr;
1077 ObjectNameResolver* global_object_name_resolver = nullptr;
1081 HeapSnapshotMode snapshot_mode = HeapSnapshotMode::kRegular;
1085 NumericsMode numerics_mode = NumericsMode::kHideNumericValues;
1091 };
1092
1099 const HeapSnapshotOptions& options = HeapSnapshotOptions());
1100
1108 ActivityControl* control,
1109 ObjectNameResolver* global_object_name_resolver = nullptr,
1110 bool hide_internals = true, bool capture_numeric_value = false);
1111
1116 std::vector<v8::Local<v8::Value>> GetDetachedJSWrapperObjects();
1117
1127 void StartTrackingHeapObjects(bool track_allocations = false);
1128
1143 int64_t* timestamp_us = nullptr);
1144
1151
1177 bool StartSamplingHeapProfiler(uint64_t sample_interval = 512 * 1024,
1178 int stack_depth = 16,
1179 SamplingFlags flags = kSamplingNoFlags);
1180
1185
1193
1199
1200 void AddBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback,
1201 void* data);
1202 void RemoveBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback,
1203 void* data);
1204
1206
1211
1217 const char* CopyNameForHeapSnapshot(const char* name);
1218
1224 static const uint16_t kPersistentHandleNoClassId = 0;
1225
1226 private:
1227 HeapProfiler();
1228 ~HeapProfiler();
1229 HeapProfiler(const HeapProfiler&);
1230 HeapProfiler& operator=(const HeapProfiler&);
1231};
1232
1238 HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size)
1239 : index(index), count(count), size(size) { }
1240 uint32_t index; // Index of the time interval that was changed.
1241 uint32_t count; // New value of count field for the interval with this index.
1242 uint32_t size; // New value of size field for the interval with this index.
1243};
1244
1245#define CODE_EVENTS_LIST(V) \
1246 V(Builtin) \
1247 V(Callback) \
1248 V(Eval) \
1249 V(Function) \
1250 V(InterpretedFunction) \
1251 V(Handler) \
1252 V(BytecodeHandler) \
1253 V(LazyCompile) /* Unused, use kFunction instead */ \
1254 V(RegExp) \
1255 V(Script) \
1256 V(Stub) \
1257 V(Relocation)
1258
1264 kUnknownType = 0
1265#define V(Name) , k##Name##Type
1267#undef V
1268};
1269
1273class V8_EXPORT CodeEvent {
1274 public:
1275 uintptr_t GetCodeStartAddress();
1276 size_t GetCodeSize();
1277 Local<String> GetFunctionName();
1278 Local<String> GetScriptName();
1279 int GetScriptLine();
1280 int GetScriptColumn();
1286 CodeEventType GetCodeType();
1287 const char* GetComment();
1289 static const char* GetCodeEventTypeName(CodeEventType code_event_type);
1291 uintptr_t GetPreviousCodeStartAddress();
1292};
1293
1298 public:
1304 explicit CodeEventHandler(Isolate* isolate);
1305 virtual ~CodeEventHandler();
1306
1315 virtual void Handle(CodeEvent* code_event) = 0;
1316
1321 void Enable();
1322
1327 void Disable();
1328
1329 private:
1332 CodeEventHandler& operator=(const CodeEventHandler&);
1333 void* internal_listener_;
1334};
1335
1336} // namespace v8
1337
1338
1339#endif // V8_V8_PROFILER_H_
Definition: v8-profiler.h:694
ControlOption
Definition: v8-profiler.h:696
virtual ControlOption ReportProgressValue(uint32_t done, uint32_t total)=0
virtual ~ActivityControl()=default
Definition: v8-profiler.h:712
virtual const std::vector< Sample > & GetSamples()=0
virtual Node * GetRootNode()=0
virtual ~AllocationProfile()=default
Definition: v8-profiler.h:1296
Definition: v8-profiler.h:1272
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:79
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:210
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:212
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:406
CpuProfilingResult Start(CpuProfilingOptions options, std::unique_ptr< DiscardedSamplesDelegate > delegate=nullptr)
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)
static void CollectSample(Isolate *isolate)
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:358
CpuProfilingOptions & operator=(CpuProfilingOptions &&)=default
int sampling_interval_us() const
Definition: v8-profiler.h:388
CpuProfilingMode mode() const
Definition: v8-profiler.h:386
unsigned max_samples() const
Definition: v8-profiler.h:387
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:338
ProfilerId GetId() const
Definition: v8-profiler.h:345
virtual ~DiscardedSamplesDelegate()=default
Definition: v8-profiler.h:839
virtual Detachedness GetDetachedness()
Definition: v8-profiler.h:884
Detachedness
Definition: v8-profiler.h:848
Node & operator=(const Node &)=delete
virtual size_t SizeInBytes()=0
virtual bool IsEmbedderNode()
Definition: v8-profiler.h:866
virtual const char * Name()=0
virtual NativeObject GetNativeObject()
Definition: v8-profiler.h:876
virtual ~Node()=default
virtual Node * WrapperNode()
Definition: v8-profiler.h:863
Node(const Node &)=delete
virtual const char * NamePrefix()
Definition: v8-profiler.h:870
virtual const void * GetAddress()
Definition: v8-profiler.h:893
virtual bool IsRootNode()
Definition: v8-profiler.h:864
Definition: v8-profiler.h:837
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:347
Definition: v8-profiler.h:544
Type
Definition: v8-profiler.h:546
const HeapGraphNode * GetToNode() const
const HeapGraphNode * GetFromNode() const
Type GetType() const
Local< Value > GetName() const
Definition: v8-profiler.h:580
Local< String > GetName() const
SnapshotObjectId GetId() const
Type GetType() const
Type
Definition: v8-profiler.h:582
const HeapGraphEdge * GetChild(int index) const
size_t GetShallowSize() const
int GetChildrenCount() const
Definition: v8-profiler.h:1029
virtual const char * GetName(Local< Object > object)=0
Definition: v8-profiler.h:953
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:1041
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:959
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:986
NumericsMode
Definition: v8-profiler.h:1052
Definition: v8-profiler.h:631
const HeapGraphNode * GetNodeById(SnapshotObjectId id) const
int GetNodesCount() const
SerializationFormat
Definition: v8-profiler.h:633
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:261
Definition: v8-local-handle.h:266
Definition: v8-local-handle.h:632
Definition: v8-profiler.h:182
virtual ~OutputStream()=default
virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate *data, int count)
Definition: v8-profiler.h:201
WriteResult
Definition: v8-profiler.h:184
virtual WriteResult WriteAsciiChunk(char *data, int size)=0
virtual void EndOfStream()=0
virtual int GetChunkSize()
Definition: v8-profiler.h:189
Definition: v8-profiler.h:943
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:320
uint32_t ProfilerId
Definition: v8-profiler.h:32
CpuProfilingLoggingMode
Definition: v8-profiler.h:308
@ kEagerLogging
Definition: v8-profiler.h:314
@ kLazyLogging
Definition: v8-profiler.h:311
EmbedderStateTag
Definition: v8-embedder-state-scope.h:22
CpuProfilingMode
Definition: v8-profiler.h:289
@ kLeafNodeLineNumbers
Definition: v8-profiler.h:293
@ kCallerLineNumbers
Definition: v8-profiler.h:296
void * NativeObject
Definition: v8-profiler.h:30
CpuProfilingNamingMode
Definition: v8-profiler.h:300
@ kStandardNaming
Definition: v8-profiler.h:302
@ kDebugNaming
Definition: v8-profiler.h:305
CodeEventType
Definition: v8-profiler.h:1263
@ kUnknownType
Definition: v8-profiler.h:1264
StateTag
Definition: v8-unwinder.h:36
Definition: v8-profiler.h:714
unsigned int count
Definition: v8-profiler.h:723
size_t size
Definition: v8-profiler.h:718
Definition: v8-profiler.h:729
std::vector< Node * > children
Definition: v8-profiler.h:775
int script_id
Definition: v8-profiler.h:746
int start_position
Definition: v8-profiler.h:751
std::vector< Allocation > allocations
Definition: v8-profiler.h:780
int column_number
Definition: v8-profiler.h:763
uint32_t node_id
Definition: v8-profiler.h:768
int line_number
Definition: v8-profiler.h:757
Local< String > script_name
Definition: v8-profiler.h:740
Local< String > name
Definition: v8-profiler.h:734
Definition: v8-profiler.h:786
unsigned int count
Definition: v8-profiler.h:800
size_t size
Definition: v8-profiler.h:795
uint32_t node_id
Definition: v8-profiler.h:790
uint64_t sample_id
Definition: v8-profiler.h:806
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:75
int line
Definition: v8-profiler.h:72
Definition: v8-profiler.h:330
const ProfilerId id
Definition: v8-profiler.h:331
const CpuProfilingStatus status
Definition: v8-profiler.h:332
Definition: v8-profiler.h:1064
HeapSnapshotOptions()
Definition: v8-profiler.h:1068
Definition: v8-profiler.h:1237
uint32_t size
Definition: v8-profiler.h:1242
uint32_t index
Definition: v8-profiler.h:1240
uint32_t count
Definition: v8-profiler.h:1241
HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size)
Definition: v8-profiler.h:1238
#define V(Name)
#define CODE_EVENTS_LIST(V)
Definition: v8-profiler.h:1245
#define V8_EXPORT
Definition: v8config.h:793