|
v8
9.0.257(node16.0.0)
V8 is Google's open source JavaScript engine
|
Go to the documentation of this file.
5 #ifndef V8_V8_PROFILER_H_
6 #define V8_V8_PROFILER_H_
11 #include <unordered_set>
24 using NativeObject =
void*;
25 using SnapshotObjectId = uint32_t;
39 template class V8_EXPORT std::vector<v8::CpuProfileDeoptFrame>;
53 template class V8_EXPORT std::vector<v8::CpuProfileDeoptInfo>;
269 virtual void Notify() = 0;
297 unsigned max_samples =
kNoSampleLimit,
int sampling_interval_us = 0,
308 unsigned max_samples_;
309 int sampling_interval_us_;
384 bool record_samples =
false);
479 SnapshotObjectId
GetId()
const;
751 virtual ~
Node() =
default;
752 virtual const char*
Name() = 0;
806 virtual void AddEdge(
Node* from,
Node* to,
const char* name =
nullptr) = 0;
842 uint16_t class_id,
void* data);
903 bool treat_global_objects_as_roots =
true);
930 int64_t* timestamp_us =
nullptr);
967 int stack_depth = 16,
1022 #define CODE_EVENTS_LIST(V)
1027 V(InterpretedFunction)
1042 #define V(Name) , k##Name##Type
1110 void* internal_listener_;
static const int kNoColumnInfo
static const char * GetCodeEventTypeName(CodeEventType code_event_type)
CpuProfilingStatus StartProfiling(Local< String > title, CpuProfilingMode mode, bool record_samples=false, unsigned max_samples=CpuProfilingOptions::kNoSampleLimit)
int GetSamplesCount() const
Local< String > GetScriptResourceName() const
virtual Node * GetRootNode()=0
virtual const char * GetName(Local< Object > object)=0
void DeleteAllHeapSnapshots()
const CpuProfileNode * GetSample(int index) const
int64_t GetEndTime() const
static void CollectSample(Isolate *isolate)
unsigned int GetHitLineCount() const
Local< Value > GetName() const
CpuProfile * StopProfiling(Local< String > title)
Node & operator=(const Node &)=delete
int GetChildrenCount() const
virtual size_t SizeInBytes()=0
static const int kNoColumnNumberInfo
size_t GetShallowSize() const
SnapshotObjectId GetObjectId(NativeObject value)
const char * GetBailoutReason() const
virtual void Handle(CodeEvent *code_event)=0
CpuProfilingOptions(CpuProfilingMode mode=kLeafNodeLineNumbers, unsigned max_samples=kNoSampleLimit, int sampling_interval_us=0, MaybeLocal< Context > filter_context=MaybeLocal< Context >())
Node(const Node &)=delete
SourceType GetSourceType() const
virtual int GetChunkSize()
bool IsScriptSharedCrossOrigin() const
virtual ~ActivityControl()=default
unsigned GetHitCount() const
void StopTrackingHeapObjects()
Local< String > GetFunctionName()
const std::vector< CpuProfileDeoptInfo > & GetDeoptInfos() const
void AddBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, void *data)
SnapshotObjectId GetId() const
static CpuProfiler * New(Isolate *isolate, CpuProfilingNamingMode=kDebugNaming, CpuProfilingLoggingMode=kLazyLogging)
virtual Detachedness GetDetachedness()
virtual ~AllocationProfile()=default
virtual ~OutputStream()=default
static const uint16_t kPersistentHandleNoClassId
DiscardedSamplesDelegate()
const CpuProfileNode * GetTopDownRoot() const
virtual ~DiscardedSamplesDelegate()=default
SnapshotObjectId GetObjectId(Local< Value > value)
Local< String > GetScriptName()
unsigned max_samples() const
virtual ControlOption ReportProgressValue(int done, int total)=0
CpuProfilingMode mode() const
int sampling_interval_us() const
virtual ~EmbedderGraph()=default
void SetSamplingInterval(int us)
const HeapSnapshot * TakeHeapSnapshot(ActivityControl *control=nullptr, ObjectNameResolver *global_object_name_resolver=nullptr, bool treat_global_objects_as_roots=true)
Local< String > GetFunctionName() const
static const int kNoLineNumberInfo
virtual const char * NamePrefix()
const char * GetScriptResourceNameStr() const
int GetLineNumber() const
const HeapGraphEdge * GetChild(int index) const
std::vector< Node * > children
void StopSamplingHeapProfiler()
void StartTrackingHeapObjects(bool track_allocations=false)
SnapshotObjectId GetHeapStats(OutputStream *stream, int64_t *timestamp_us=nullptr)
uintptr_t GetCodeStartAddress()
uintptr_t GetPreviousCodeStartAddress()
void RemoveBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, void *data)
int64_t GetStartTime() const
static const int kNoLineNumberInfo
#define CODE_EVENTS_LIST(V)
SnapshotObjectId GetMaxSnapshotJSObjectId() const
Local< Value > FindObjectById(SnapshotObjectId id)
AllocationProfile * GetAllocationProfile()
Local< String > GetTitle() const
const HeapGraphNode * GetRoot() const
static const int kNoColumnNumberInfo
static const unsigned kNoSampleLimit
int64_t GetSampleTimestamp(int index) const
const HeapGraphNode * GetNode(int index) const
virtual void EndOfStream()=0
Local< String > script_name
bool GetLineTicks(LineTick *entries, unsigned int length) const
const char * GetFunctionNameStr() const
HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size)
unsigned GetNodeId() const
void SetGetDetachednessCallback(GetDetachednessCallback callback, void *data)
int GetNodesCount() const
virtual bool IsRootNode()
void(* BuildEmbedderGraphCallback)(v8::Isolate *isolate, v8::EmbedderGraph *graph, void *data)
virtual NativeObject GetNativeObject()
int GetColumnNumber() const
Local< String > GetName() const
virtual const std::vector< Sample > & GetSamples()=0
virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate *data, int count)
int GetChildrenCount() const
const HeapGraphNode * GetFromNode() const
static const int kNoLineNumberInfo
const HeapGraphNode * GetToNode() const
void SetUsePreciseSampling(bool)
const char * deopt_reason
const char * GetComment()
static const SnapshotObjectId kUnknownObjectId
CodeEventHandler(Isolate *isolate)
virtual ~ObjectNameResolver()=default
virtual Node * AddNode(std::unique_ptr< Node > node)=0
std::vector< Allocation > allocations
bool StartSamplingHeapProfiler(uint64_t sample_interval=512 *1024, int stack_depth=16, SamplingFlags flags=kSamplingNoFlags)
CpuProfilingStatus StartProfiling(Local< String > title, bool record_samples=false)
virtual Node * V8Node(const v8::Local< v8::Value > &value)=0
const HeapSnapshot * GetHeapSnapshot(int index)
CpuProfilingStatus StartProfiling(Local< String > title, CpuProfilingOptions options, std::unique_ptr< DiscardedSamplesDelegate > delegate=nullptr)
static void UseDetailedSourcePositionsForProfiling(Isolate *isolate)
virtual Node * WrapperNode()
virtual WriteResult WriteAsciiChunk(char *data, int size)=0
virtual const char * Name()=0
virtual void AddEdge(Node *from, Node *to, const char *name=nullptr)=0
CodeEventType GetCodeType()
virtual bool IsEmbedderNode()
const CpuProfileNode * GetParent() const
std::vector< CpuProfileDeoptFrame > stack
const HeapGraphNode * GetNodeById(SnapshotObjectId id) const
const CpuProfileNode * GetChild(int index) const
virtual ~CodeEventHandler()
void Serialize(OutputStream *stream, SerializationFormat format=kJSON) const