v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CpuProfiler Class Reference

#include <v8-profiler.h>

Static Public Member Functions

static int GetProfilesCount ()
 
static const CpuProfileGetProfile (int index, Handle< Value > security_token=Handle< Value >())
 
static const CpuProfileFindProfile (unsigned uid, Handle< Value > security_token=Handle< Value >())
 
static void StartProfiling (Handle< String > title)
 
static const CpuProfileStopProfiling (Handle< String > title, Handle< Value > security_token=Handle< Value >())
 
static void DeleteAllProfiles ()
 

Detailed Description

Interface for controlling CPU profiling.

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

Member Function Documentation

void DeleteAllProfiles ( )
static

Deletes all existing profiles, also cancelling all profiling activity. All previously returned pointers to profiles and their contents become invalid after this call.

Definition at line 6127 of file api.cc.

References CpuProfiler::DeleteAllProfiles().

const CpuProfile * FindProfile ( unsigned  uid,
Handle< Value security_token = Handle<Value>() 
)
static

Returns a profile by uid.

Definition at line 6098 of file api.cc.

References CpuProfiler::FindProfile(), Handle< T >::IsEmpty(), and NULL.

Referenced by TEST().

const CpuProfile * GetProfile ( int  index,
Handle< Value security_token = Handle<Value>() 
)
static

Returns a profile by index.

Definition at line 6087 of file api.cc.

References CpuProfiler::GetProfile(), Handle< T >::IsEmpty(), and NULL.

int GetProfilesCount ( )
static

A note on security tokens usage. As scripts from different origins can run inside a single V8 instance, it is possible to have functions from different security contexts intermixed in a single CPU profile. To avoid exposing function names belonging to other contexts, filtering by security token is performed while obtaining profiling results. Returns the number of profiles collected (doesn't include profiles that are being collected at the moment of call.)

Definition at line 6080 of file api.cc.

References CpuProfiler::GetProfilesCount().

Referenced by TEST().

void StartProfiling ( Handle< String title)
static

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.

Definition at line 6109 of file api.cc.

References CpuProfiler::StartProfiling().

Referenced by ProfilerExtension::StartProfiling(), and TEST().

const CpuProfile * StopProfiling ( Handle< String title,
Handle< Value security_token = Handle<Value>() 
)
static

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 6116 of file api.cc.

References Handle< T >::IsEmpty(), NULL, and CpuProfiler::StopProfiling().

Referenced by ProfilerExtension::StopProfiling(), and TEST().


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