| 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 #ifndef V8_COUNTERS_H_ | 5 #ifndef V8_COUNTERS_H_ |
| 6 #define V8_COUNTERS_H_ | 6 #define V8_COUNTERS_H_ |
| 7 | 7 |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 #endif | 284 #endif |
| 285 } | 285 } |
| 286 | 286 |
| 287 private: | 287 private: |
| 288 HistogramTimer* timer_; | 288 HistogramTimer* timer_; |
| 289 #ifdef DEBUG | 289 #ifdef DEBUG |
| 290 bool skipped_timer_start_; | 290 bool skipped_timer_start_; |
| 291 #endif | 291 #endif |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 #define HISTOGRAM_RANGE_LIST(HR) \ |
| 295 /* Generic range histograms */ \ |
| 296 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 1000, 1001) |
| 294 | 297 |
| 295 #define HISTOGRAM_TIMER_LIST(HT) \ | 298 #define HISTOGRAM_TIMER_LIST(HT) \ |
| 296 /* Garbage collection timers. */ \ | 299 /* Garbage collection timers. */ \ |
| 297 HT(gc_compactor, V8.GCCompactor) \ | 300 HT(gc_compactor, V8.GCCompactor) \ |
| 298 HT(gc_scavenger, V8.GCScavenger) \ | 301 HT(gc_scavenger, V8.GCScavenger) \ |
| 299 HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ | 302 HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ |
| 300 HT(gc_idle_notification, V8.GCIdleNotification) \ | 303 HT(gc_idle_notification, V8.GCIdleNotification) \ |
| 301 HT(gc_incremental_marking, V8.GCIncrementalMarking) \ | 304 HT(gc_incremental_marking, V8.GCIncrementalMarking) \ |
| 302 /* Parsing timers. */ \ | 305 /* Parsing timers. */ \ |
| 303 HT(parse, V8.Parse) \ | 306 HT(parse, V8.Parse) \ |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 SC(property_cell_space_bytes_used, \ | 547 SC(property_cell_space_bytes_used, \ |
| 545 V8.MemoryPropertyCellSpaceBytesUsed) \ | 548 V8.MemoryPropertyCellSpaceBytesUsed) \ |
| 546 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ | 549 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ |
| 547 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ | 550 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ |
| 548 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) | 551 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) |
| 549 | 552 |
| 550 | 553 |
| 551 // This file contains all the v8 counters that are in use. | 554 // This file contains all the v8 counters that are in use. |
| 552 class Counters { | 555 class Counters { |
| 553 public: | 556 public: |
| 557 #define HR(name, caption, min, max, num_buckets) \ |
| 558 Histogram* name() { return &name##_; } |
| 559 HISTOGRAM_RANGE_LIST(HR) |
| 560 #undef HR |
| 561 |
| 554 #define HT(name, caption) \ | 562 #define HT(name, caption) \ |
| 555 HistogramTimer* name() { return &name##_; } | 563 HistogramTimer* name() { return &name##_; } |
| 556 HISTOGRAM_TIMER_LIST(HT) | 564 HISTOGRAM_TIMER_LIST(HT) |
| 557 #undef HT | 565 #undef HT |
| 558 | 566 |
| 559 #define HP(name, caption) \ | 567 #define HP(name, caption) \ |
| 560 Histogram* name() { return &name##_; } | 568 Histogram* name() { return &name##_; } |
| 561 HISTOGRAM_PERCENTAGE_LIST(HP) | 569 HISTOGRAM_PERCENTAGE_LIST(HP) |
| 562 #undef HP | 570 #undef HP |
| 563 | 571 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 kSizeOfCODE_AGE__##name, | 639 kSizeOfCODE_AGE__##name, |
| 632 CODE_AGE_LIST_COMPLETE(COUNTER_ID) | 640 CODE_AGE_LIST_COMPLETE(COUNTER_ID) |
| 633 #undef COUNTER_ID | 641 #undef COUNTER_ID |
| 634 stats_counter_count | 642 stats_counter_count |
| 635 }; | 643 }; |
| 636 | 644 |
| 637 void ResetCounters(); | 645 void ResetCounters(); |
| 638 void ResetHistograms(); | 646 void ResetHistograms(); |
| 639 | 647 |
| 640 private: | 648 private: |
| 649 #define HR(name, caption, min, max, num_buckets) Histogram name##_; |
| 650 HISTOGRAM_RANGE_LIST(HR) |
| 651 #undef HR |
| 652 |
| 641 #define HT(name, caption) \ | 653 #define HT(name, caption) \ |
| 642 HistogramTimer name##_; | 654 HistogramTimer name##_; |
| 643 HISTOGRAM_TIMER_LIST(HT) | 655 HISTOGRAM_TIMER_LIST(HT) |
| 644 #undef HT | 656 #undef HT |
| 645 | 657 |
| 646 #define HP(name, caption) \ | 658 #define HP(name, caption) \ |
| 647 Histogram name##_; | 659 Histogram name##_; |
| 648 HISTOGRAM_PERCENTAGE_LIST(HP) | 660 HISTOGRAM_PERCENTAGE_LIST(HP) |
| 649 #undef HP | 661 #undef HP |
| 650 | 662 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 friend class Isolate; | 698 friend class Isolate; |
| 687 | 699 |
| 688 explicit Counters(Isolate* isolate); | 700 explicit Counters(Isolate* isolate); |
| 689 | 701 |
| 690 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 702 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
| 691 }; | 703 }; |
| 692 | 704 |
| 693 } } // namespace v8::internal | 705 } } // namespace v8::internal |
| 694 | 706 |
| 695 #endif // V8_COUNTERS_H_ | 707 #endif // V8_COUNTERS_H_ |
| OLD | NEW |