OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 | 203 |
204 class CpuProfile { | 204 class CpuProfile { |
205 public: | 205 public: |
206 CpuProfile(const char* title, unsigned uid, bool record_samples); | 206 CpuProfile(const char* title, unsigned uid, bool record_samples); |
207 | 207 |
208 // Add pc -> ... -> main() call path to the profile. | 208 // Add pc -> ... -> main() call path to the profile. |
209 void AddPath(const Vector<CodeEntry*>& path); | 209 void AddPath(const Vector<CodeEntry*>& path); |
210 void CalculateTotalTicksAndSamplingRate(); | 210 void CalculateTotalTicksAndSamplingRate(); |
211 | 211 |
212 const char* title() const { return title_; } | 212 INLINE(const char* title() const) { return title_; } |
213 unsigned uid() const { return uid_; } | 213 INLINE(unsigned uid() const) { return uid_; } |
214 const ProfileTree* top_down() const { return &top_down_; } | 214 INLINE(const ProfileTree* top_down() const) { return &top_down_; } |
215 | 215 |
216 int samples_count() const { return samples_.length(); } | 216 INLINE(int samples_count() const) { return samples_.length(); } |
217 ProfileNode* sample(int index) const { return samples_.at(index); } | 217 INLINE(ProfileNode* sample(int index) const) { return samples_.at(index); } |
218 | |
219 int64_t start_time_us() const { return start_time_us_; } | |
220 int64_t end_time_us() const { return end_time_us_; } | |
221 | 218 |
222 void UpdateTicksScale(); | 219 void UpdateTicksScale(); |
223 | 220 |
224 void ShortPrint(); | 221 void ShortPrint(); |
225 void Print(); | 222 void Print(); |
226 | 223 |
227 private: | 224 private: |
228 const char* title_; | 225 const char* title_; |
229 unsigned uid_; | 226 unsigned uid_; |
230 bool record_samples_; | 227 bool record_samples_; |
231 int64_t start_time_us_; | 228 double start_time_ms_; |
232 int64_t end_time_us_; | 229 double end_time_ms_; |
233 List<ProfileNode*> samples_; | 230 List<ProfileNode*> samples_; |
234 ProfileTree top_down_; | 231 ProfileTree top_down_; |
235 | 232 |
236 DISALLOW_COPY_AND_ASSIGN(CpuProfile); | 233 DISALLOW_COPY_AND_ASSIGN(CpuProfile); |
237 }; | 234 }; |
238 | 235 |
239 | 236 |
240 class CodeMap { | 237 class CodeMap { |
241 public: | 238 public: |
242 CodeMap() : next_shared_id_(1) { } | 239 CodeMap() : next_shared_id_(1) { } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 CodeEntry* gc_entry_; | 353 CodeEntry* gc_entry_; |
357 CodeEntry* unresolved_entry_; | 354 CodeEntry* unresolved_entry_; |
358 | 355 |
359 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 356 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
360 }; | 357 }; |
361 | 358 |
362 | 359 |
363 } } // namespace v8::internal | 360 } } // namespace v8::internal |
364 | 361 |
365 #endif // V8_PROFILE_GENERATOR_H_ | 362 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |