OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/counters.h" | 5 #include "src/counters.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/builtins/builtins-definitions.h" | 10 #include "src/builtins/builtins-definitions.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 #define AHT(name, caption) name##_.Reset(); | 245 #define AHT(name, caption) name##_.Reset(); |
246 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) | 246 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) |
247 #undef AHT | 247 #undef AHT |
248 | 248 |
249 #define HP(name, caption) name##_.Reset(); | 249 #define HP(name, caption) name##_.Reset(); |
250 HISTOGRAM_PERCENTAGE_LIST(HP) | 250 HISTOGRAM_PERCENTAGE_LIST(HP) |
251 #undef HP | 251 #undef HP |
252 | 252 |
253 #define HM(name, caption) name##_.Reset(); | 253 #define HM(name, caption) name##_.Reset(); |
254 HISTOGRAM_LEGACY_MEMORY_LIST(HM) | 254 HISTOGRAM_LEGACY_MEMORY_LIST(HM) |
| 255 HISTOGRAM_MEMORY_LIST(HM) |
255 #undef HM | 256 #undef HM |
256 } | 257 } |
257 | 258 |
| 259 void Counters::InitializeHistograms() { |
| 260 #define HR(name, caption, min, max, num_buckets) name##_.Enabled(); |
| 261 HISTOGRAM_RANGE_LIST(HR) |
| 262 #undef HR |
| 263 |
| 264 #define HT(name, caption, max, res) name##_.Enabled(); |
| 265 HISTOGRAM_TIMER_LIST(HT) |
| 266 #undef HT |
| 267 |
| 268 #define AHT(name, caption) name##_.Enabled(); |
| 269 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) |
| 270 #undef AHT |
| 271 |
| 272 #define HP(name, caption) name##_.Enabled(); |
| 273 HISTOGRAM_PERCENTAGE_LIST(HP) |
| 274 #undef HP |
| 275 |
| 276 #define HM(name, caption) name##_.Enabled(); |
| 277 HISTOGRAM_LEGACY_MEMORY_LIST(HM) |
| 278 HISTOGRAM_MEMORY_LIST(HM) |
| 279 #undef HM |
| 280 } |
| 281 |
258 class RuntimeCallStatEntries { | 282 class RuntimeCallStatEntries { |
259 public: | 283 public: |
260 void Print(std::ostream& os) { | 284 void Print(std::ostream& os) { |
261 if (total_call_count == 0) return; | 285 if (total_call_count == 0) return; |
262 std::sort(entries.rbegin(), entries.rend()); | 286 std::sort(entries.rbegin(), entries.rend()); |
263 os << std::setw(50) << "Runtime Function/C++ Builtin" << std::setw(12) | 287 os << std::setw(50) << "Runtime Function/C++ Builtin" << std::setw(12) |
264 << "Time" << std::setw(18) << "Count" << std::endl | 288 << "Time" << std::setw(18) << "Count" << std::endl |
265 << std::string(88, '=') << std::endl; | 289 << std::string(88, '=') << std::endl; |
266 for (Entry& entry : entries) { | 290 for (Entry& entry : entries) { |
267 entry.SetTotal(total_time, total_call_count); | 291 entry.SetTotal(total_time, total_call_count); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 RuntimeCallStats::counters) { | 525 RuntimeCallStats::counters) { |
502 RuntimeCallCounter* counter = &(this->*counter_id); | 526 RuntimeCallCounter* counter = &(this->*counter_id); |
503 if (counter->count() > 0) counter->Dump(value); | 527 if (counter->count() > 0) counter->Dump(value); |
504 } | 528 } |
505 | 529 |
506 in_use_ = false; | 530 in_use_ = false; |
507 } | 531 } |
508 | 532 |
509 } // namespace internal | 533 } // namespace internal |
510 } // namespace v8 | 534 } // namespace v8 |
OLD | NEW |