V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
v8::CpuProfiler Class Reference

#include <v8-profiler.h>

Public Member Functions

void Dispose ()
 
void SetSamplingInterval (int us)
 
void StartProfiling (Local< String > title, CpuProfilingMode mode, bool record_samples=false)
 
void StartProfiling (Local< String > title, bool record_samples=false)
 
CpuProfileStopProfiling (Local< String > title)
 
 V8_DEPRECATED ("Use static CollectSample(Isolate*) instead.", void CollectSample())
 
 V8_DEPRECATED ("Use Isolate::SetIdle(bool) instead.", void SetIdle(bool is_idle))
 

Static Public Member Functions

static CpuProfilerNew (Isolate *isolate)
 
static void CollectSample (Isolate *isolate)
 
static void UseDetailedSourcePositionsForProfiling (Isolate *isolate)
 

Detailed Description

Interface for controlling CPU profiling. Instance of the profiler can be created using v8::CpuProfiler::New method.

Definition at line 276 of file v8-profiler.h.

Member Function Documentation

◆ CollectSample()

void v8::CpuProfiler::CollectSample ( Isolate *  isolate)
static

Synchronously collect current stack sample in all profilers attached to the |isolate|. The call does not affect number of ticks recorded for the current top node.

Definition at line 10126 of file api.cc.

◆ Dispose()

void v8::CpuProfiler::Dispose ( )

Disposes the CPU profiler object.

Definition at line 10123 of file api.cc.

◆ New()

CpuProfiler * v8::CpuProfiler::New ( Isolate *  isolate)
static

Creates a new CPU profiler for the |isolate|. The isolate must be initialized. The profiler object must be disposed after use by calling |Dispose| method.

Definition at line 10118 of file api.cc.

◆ SetSamplingInterval()

void v8::CpuProfiler::SetSamplingInterval ( int  us)

Changes default CPU profiler sampling interval to the specified number of microseconds. Default interval is 1000us. This method must be called when there are no profiles being recorded.

Definition at line 10130 of file api.cc.

◆ StartProfiling() [1/2]

void v8::CpuProfiler::StartProfiling ( Local< String title,
CpuProfilingMode  mode,
bool  record_samples = false 
)

Starts collecting CPU profile. Title may be an empty string. It is allowed to have several profiles being collected at once. Attempts to start collecting several profiles with the same title are silently ignored. While collecting a profile, functions from all security contexts are included in it. The token-based filtering is only performed when querying for a profile.

|record_samples| parameter controls whether individual samples should be recorded in addition to the aggregated tree.

Definition at line 10145 of file api.cc.

◆ StartProfiling() [2/2]

void v8::CpuProfiler::StartProfiling ( Local< String title,
bool  record_samples = false 
)

The same as StartProfiling above, but the CpuProfilingMode defaults to kLeafNodeLineNumbers mode, which was the previous default behavior of the profiler.

Definition at line 10140 of file api.cc.

◆ StopProfiling()

CpuProfile * v8::CpuProfiler::StopProfiling ( Local< String title)

Stops collecting CPU profile with a given title and returns it. If the title given is empty, finishes the last profile started.

Definition at line 10151 of file api.cc.

◆ UseDetailedSourcePositionsForProfiling()

void v8::CpuProfiler::UseDetailedSourcePositionsForProfiling ( Isolate *  isolate)
static

Generate more detailed source positions to code objects. This results in better results when mapping profiling samples to script source.

Definition at line 10164 of file api.cc.

◆ V8_DEPRECATED() [1/2]

v8::CpuProfiler::V8_DEPRECATED ( "Use static CollectSample(Isolate*) instead."  ,
void   CollectSample() 
)

Force collection of a sample. Must be called on the VM thread. Recording the forced sample does not contribute to the aggregated profile statistics.

◆ V8_DEPRECATED() [2/2]

v8::CpuProfiler::V8_DEPRECATED ( "Use Isolate::SetIdle(bool) instead."  ,
void   SetIdlebool is_idle 
)

Tells the profiler whether the embedder is idle.


The documentation for this class was generated from the following files: