V8 Project
v8::internal::CpuProfile Class Reference

#include <profile-generator.h>

+ Collaboration diagram for v8::internal::CpuProfile:

Public Member Functions

 CpuProfile (const char *title, bool record_samples)
 
void AddPath (base::TimeTicks timestamp, const Vector< CodeEntry * > &path)
 
void CalculateTotalTicksAndSamplingRate ()
 
const char * title () const
 
const ProfileTreetop_down () const
 
int samples_count () const
 
ProfileNodesample (int index) const
 
base::TimeTicks sample_timestamp (int index) const
 
base::TimeTicks start_time () const
 
base::TimeTicks end_time () const
 
void UpdateTicksScale ()
 
void Print ()
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (CpuProfile)
 

Private Attributes

const char * title_
 
bool record_samples_
 
base::TimeTicks start_time_
 
base::TimeTicks end_time_
 
List< ProfileNode * > samples_
 
List< base::TimeTicks > timestamps_
 
ProfileTree top_down_
 

Detailed Description

Definition at line 173 of file profile-generator.h.

Constructor & Destructor Documentation

◆ CpuProfile()

v8::internal::CpuProfile::CpuProfile ( const char *  title,
bool  record_samples 
)

Definition at line 322 of file profile-generator.cc.

323  : title_(title),
324  record_samples_(record_samples),
325  start_time_(base::TimeTicks::HighResolutionNow()) {
326 }
const char * title() const

Member Function Documentation

◆ AddPath()

void v8::internal::CpuProfile::AddPath ( base::TimeTicks  timestamp,
const Vector< CodeEntry * > &  path 
)

Definition at line 329 of file profile-generator.cc.

330  {
331  ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path);
332  if (record_samples_) {
333  timestamps_.Add(timestamp);
334  samples_.Add(top_frame_node);
335  }
336 }
List< ProfileNode * > samples_
List< base::TimeTicks > timestamps_
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:17
ProfileNode * AddPathFromEnd(const Vector< CodeEntry * > &path)

References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::ProfileTree::AddPathFromEnd(), record_samples_, samples_, timestamps_, and top_down_.

+ Here is the call graph for this function:

◆ CalculateTotalTicksAndSamplingRate()

void v8::internal::CpuProfile::CalculateTotalTicksAndSamplingRate ( )

Definition at line 339 of file profile-generator.cc.

339  {
340  end_time_ = base::TimeTicks::HighResolutionNow();
341 }

References end_time_.

Referenced by v8::internal::CpuProfilesCollection::StopProfiling().

+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::CpuProfile::DISALLOW_COPY_AND_ASSIGN ( CpuProfile  )
private

◆ end_time()

base::TimeTicks v8::internal::CpuProfile::end_time ( ) const
inline

Definition at line 191 of file profile-generator.h.

191 { return end_time_; }

References end_time_.

Referenced by v8::CpuProfile::GetEndTime().

+ Here is the caller graph for this function:

◆ Print()

void v8::internal::CpuProfile::Print ( )

Definition at line 344 of file profile-generator.cc.

344  {
345  base::OS::Print("[Top down]:\n");
346  top_down_.Print();
347 }
static void Print(const char *format,...)

References v8::internal::ProfileTree::Print(), v8::base::OS::Print(), and top_down_.

Referenced by v8::internal::CpuProfiler::StopProfiling().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sample()

ProfileNode* v8::internal::CpuProfile::sample ( int  index) const
inline

Definition at line 185 of file profile-generator.h.

185 { return samples_.at(index); }

References samples_.

Referenced by v8::CpuProfile::GetSample().

+ Here is the caller graph for this function:

◆ sample_timestamp()

base::TimeTicks v8::internal::CpuProfile::sample_timestamp ( int  index) const
inline

Definition at line 186 of file profile-generator.h.

186  {
187  return timestamps_.at(index);
188  }
T & at(int i) const
Definition: list.h:69

References v8::internal::List< T, AllocationPolicy >::at(), and timestamps_.

Referenced by v8::CpuProfile::GetSampleTimestamp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ samples_count()

int v8::internal::CpuProfile::samples_count ( ) const
inline

Definition at line 184 of file profile-generator.h.

184 { return samples_.length(); }

References samples_.

◆ start_time()

base::TimeTicks v8::internal::CpuProfile::start_time ( ) const
inline

Definition at line 190 of file profile-generator.h.

190 { return start_time_; }

References start_time_.

Referenced by v8::CpuProfile::GetStartTime().

+ Here is the caller graph for this function:

◆ title()

const char* v8::internal::CpuProfile::title ( ) const
inline

Definition at line 181 of file profile-generator.h.

181 { return title_; }

References title_.

Referenced by v8::CpuProfile::GetTitle().

+ Here is the caller graph for this function:

◆ top_down()

const ProfileTree* v8::internal::CpuProfile::top_down ( ) const
inline

Definition at line 182 of file profile-generator.h.

182 { return &top_down_; }

References top_down_.

Referenced by v8::CpuProfile::GetTopDownRoot().

+ Here is the caller graph for this function:

◆ UpdateTicksScale()

void v8::internal::CpuProfile::UpdateTicksScale ( )

Member Data Documentation

◆ end_time_

base::TimeTicks v8::internal::CpuProfile::end_time_
private

Definition at line 201 of file profile-generator.h.

Referenced by CalculateTotalTicksAndSamplingRate(), and end_time().

◆ record_samples_

bool v8::internal::CpuProfile::record_samples_
private

Definition at line 199 of file profile-generator.h.

Referenced by AddPath().

◆ samples_

List<ProfileNode*> v8::internal::CpuProfile::samples_
private

Definition at line 202 of file profile-generator.h.

Referenced by AddPath(), sample(), and samples_count().

◆ start_time_

base::TimeTicks v8::internal::CpuProfile::start_time_
private

Definition at line 200 of file profile-generator.h.

Referenced by start_time().

◆ timestamps_

List<base::TimeTicks> v8::internal::CpuProfile::timestamps_
private

Definition at line 203 of file profile-generator.h.

Referenced by AddPath(), and sample_timestamp().

◆ title_

const char* v8::internal::CpuProfile::title_
private

Definition at line 198 of file profile-generator.h.

Referenced by title().

◆ top_down_

ProfileTree v8::internal::CpuProfile::top_down_
private

Definition at line 204 of file profile-generator.h.

Referenced by AddPath(), Print(), and top_down().


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