V8 Project
v8::CpuProfile Class Reference

CpuProfile contains a CPU profile in a form of top-down call tree (from main() down to functions that do all the work). More...

#include <v8-profiler.h>

+ Collaboration diagram for v8::CpuProfile:

Public Member Functions

Handle< StringGetTitle () const
 Returns CPU profile title. More...
 
const CpuProfileNodeGetTopDownRoot () const
 Returns the root node of the top down call tree. More...
 
int GetSamplesCount () const
 Returns number of samples recorded. More...
 
const CpuProfileNodeGetSample (int index) const
 Returns profile node corresponding to the top frame the sample at the given index. More...
 
int64_t GetSampleTimestamp (int index) const
 Returns the timestamp of the sample. More...
 
int64_t GetStartTime () const
 Returns time when the profile recording was started (in microseconds) since some unspecified starting point. More...
 
int64_t GetEndTime () const
 Returns time when the profile recording was stopped (in microseconds) since some unspecified starting point. More...
 
void Delete ()
 Deletes the profile and removes it from CpuProfiler's list. More...
 

Detailed Description

CpuProfile contains a CPU profile in a form of top-down call tree (from main() down to functions that do all the work).

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

Member Function Documentation

◆ Delete()

void v8::CpuProfile::Delete ( )

Deletes the profile and removes it from CpuProfiler's list.

All pointers to nodes previously returned become invalid.

Definition at line 7118 of file api.cc.

7118  {
7119  i::Isolate* isolate = i::Isolate::Current();
7120  i::CpuProfiler* profiler = isolate->cpu_profiler();
7121  DCHECK(profiler != NULL);
7122  profiler->DeleteProfile(reinterpret_cast<i::CpuProfile*>(this));
7123 }
CpuProfiler * cpu_profiler() const
Definition: isolate.h:971
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes A file to write the raw context snapshot bytes Write V8 startup blob Print the time it takes to lazily compile hydrogen code stubs dump only objects containing this substring stress the GC compactor to flush out pretty print source code for builtins print C code to recreate TurboFan graphs report heap spill statistics along with enable possessive quantifier syntax for testing Minimal Log code events to the log file without profiling log positions Log statistical profiling Used with turns on browser compatible mode for profiling Enable perf linux profiler(experimental annotate support).") DEFINE_STRING(gc_fake_mmap
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::Isolate::cpu_profiler(), DCHECK, NULL, and profiler().

+ Here is the call graph for this function:

◆ GetEndTime()

int64_t v8::CpuProfile::GetEndTime ( ) const

Returns time when the profile recording was stopped (in microseconds) since some unspecified starting point.

The point is equal to the starting point used by GetStartTime.

Definition at line 7159 of file api.cc.

7159  {
7160  const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7161  return (profile->end_time() - base::TimeTicks()).InMicroseconds();
7162 }
base::TimeTicks end_time() const

References v8::internal::CpuProfile::end_time().

+ Here is the call graph for this function:

◆ GetSample()

const CpuProfileNode * v8::CpuProfile::GetSample ( int  index) const

Returns profile node corresponding to the top frame the sample at the given index.

Definition at line 7140 of file api.cc.

7140  {
7141  const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7142  return reinterpret_cast<const CpuProfileNode*>(profile->sample(index));
7143 }
ProfileNode * sample(int index) const

References v8::internal::CpuProfile::sample().

+ Here is the call graph for this function:

◆ GetSamplesCount()

int v8::CpuProfile::GetSamplesCount ( ) const

Returns number of samples recorded.

The samples are not recorded unless |record_samples| parameter of CpuProfiler::StartCpuProfiling is true.

Definition at line 7165 of file api.cc.

7165  {
7166  return reinterpret_cast<const i::CpuProfile*>(this)->samples_count();
7167 }

◆ GetSampleTimestamp()

int64_t v8::CpuProfile::GetSampleTimestamp ( int  index) const

Returns the timestamp of the sample.

The timestamp is the number of microseconds since some unspecified starting point. The point is equal to the starting point used by GetStartTime.

Definition at line 7146 of file api.cc.

7146  {
7147  const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7148  return (profile->sample_timestamp(index) - base::TimeTicks())
7149  .InMicroseconds();
7150 }
base::TimeTicks sample_timestamp(int index) const

References v8::internal::CpuProfile::sample_timestamp().

+ Here is the call graph for this function:

◆ GetStartTime()

int64_t v8::CpuProfile::GetStartTime ( ) const

Returns time when the profile recording was started (in microseconds) since some unspecified starting point.

Definition at line 7153 of file api.cc.

7153  {
7154  const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7155  return (profile->start_time() - base::TimeTicks()).InMicroseconds();
7156 }
base::TimeTicks start_time() const

References v8::internal::CpuProfile::start_time().

+ Here is the call graph for this function:

◆ GetTitle()

Handle< String > v8::CpuProfile::GetTitle ( ) const

Returns CPU profile title.

Definition at line 7126 of file api.cc.

7126  {
7127  i::Isolate* isolate = i::Isolate::Current();
7128  const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7129  return ToApiHandle<String>(isolate->factory()->InternalizeUtf8String(
7130  profile->title()));
7131 }
const char * title() const
Factory * factory()
Definition: isolate.h:982

References v8::internal::Isolate::factory(), and v8::internal::CpuProfile::title().

+ Here is the call graph for this function:

◆ GetTopDownRoot()

const CpuProfileNode * v8::CpuProfile::GetTopDownRoot ( ) const

Returns the root node of the top down call tree.

Definition at line 7134 of file api.cc.

7134  {
7135  const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7136  return reinterpret_cast<const CpuProfileNode*>(profile->top_down()->root());
7137 }
const ProfileTree * top_down() const
ProfileNode * root() const

References v8::internal::ProfileTree::root(), and v8::internal::CpuProfile::top_down().

+ Here is the call graph for this function:

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