Commit e52908e4 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Added histogram to track distribution of requested idle notifications.

BUG=397026
LOG=n
R=rmcilroy@chromium.org

Review URL: https://codereview.chromium.org/420753002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3db23c80
...@@ -55,6 +55,11 @@ void HistogramTimer::Stop() { ...@@ -55,6 +55,11 @@ void HistogramTimer::Stop() {
Counters::Counters(Isolate* isolate) { Counters::Counters(Isolate* isolate) {
#define HR(name, caption, min, max, num_buckets) \
name##_ = Histogram(#caption, min, max, num_buckets, isolate);
HISTOGRAM_RANGE_LIST(HR)
#undef HR
#define HT(name, caption) \ #define HT(name, caption) \
name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate); name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate);
HISTOGRAM_TIMER_LIST(HT) HISTOGRAM_TIMER_LIST(HT)
...@@ -142,6 +147,10 @@ void Counters::ResetCounters() { ...@@ -142,6 +147,10 @@ void Counters::ResetCounters() {
void Counters::ResetHistograms() { void Counters::ResetHistograms() {
#define HR(name, caption, min, max, num_buckets) name##_.Reset();
HISTOGRAM_RANGE_LIST(HR)
#undef HR
#define HT(name, caption) name##_.Reset(); #define HT(name, caption) name##_.Reset();
HISTOGRAM_TIMER_LIST(HT) HISTOGRAM_TIMER_LIST(HT)
#undef HT #undef HT
......
...@@ -291,6 +291,9 @@ class HistogramTimerScope BASE_EMBEDDED { ...@@ -291,6 +291,9 @@ class HistogramTimerScope BASE_EMBEDDED {
#endif #endif
}; };
#define HISTOGRAM_RANGE_LIST(HR) \
/* Generic range histograms */ \
HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101)
#define HISTOGRAM_TIMER_LIST(HT) \ #define HISTOGRAM_TIMER_LIST(HT) \
/* Garbage collection timers. */ \ /* Garbage collection timers. */ \
...@@ -552,6 +555,11 @@ class HistogramTimerScope BASE_EMBEDDED { ...@@ -552,6 +555,11 @@ class HistogramTimerScope BASE_EMBEDDED {
// This file contains all the v8 counters that are in use. // This file contains all the v8 counters that are in use.
class Counters { class Counters {
public: public:
#define HR(name, caption, min, max, num_buckets) \
Histogram* name() { return &name##_; }
HISTOGRAM_RANGE_LIST(HR)
#undef HR
#define HT(name, caption) \ #define HT(name, caption) \
HistogramTimer* name() { return &name##_; } HistogramTimer* name() { return &name##_; }
HISTOGRAM_TIMER_LIST(HT) HISTOGRAM_TIMER_LIST(HT)
...@@ -639,6 +647,10 @@ class Counters { ...@@ -639,6 +647,10 @@ class Counters {
void ResetHistograms(); void ResetHistograms();
private: private:
#define HR(name, caption, min, max, num_buckets) Histogram name##_;
HISTOGRAM_RANGE_LIST(HR)
#undef HR
#define HT(name, caption) \ #define HT(name, caption) \
HistogramTimer name##_; HistogramTimer name##_;
HISTOGRAM_TIMER_LIST(HT) HISTOGRAM_TIMER_LIST(HT)
......
...@@ -54,8 +54,7 @@ Heap::Heap() ...@@ -54,8 +54,7 @@ Heap::Heap()
isolate_(NULL), isolate_(NULL),
code_range_size_(0), code_range_size_(0),
// semispace_size_ should be a power of 2 and old_generation_size_ should // semispace_size_ should be a power of 2 and old_generation_size_ should
// be // be a multiple of Page::kPageSize.
// a multiple of Page::kPageSize.
reserved_semispace_size_(8 * (kPointerSize / 4) * MB), reserved_semispace_size_(8 * (kPointerSize / 4) * MB),
max_semi_space_size_(8 * (kPointerSize / 4) * MB), max_semi_space_size_(8 * (kPointerSize / 4) * MB),
initial_semispace_size_(Page::kPageSize), initial_semispace_size_(Page::kPageSize),
...@@ -4268,6 +4267,7 @@ bool Heap::IdleNotification(int hint) { ...@@ -4268,6 +4267,7 @@ bool Heap::IdleNotification(int hint) {
intptr_t step_size = intptr_t step_size =
size_factor * IncrementalMarking::kAllocatedThreshold; size_factor * IncrementalMarking::kAllocatedThreshold;
isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(hint);
HistogramTimerScope idle_notification_scope( HistogramTimerScope idle_notification_scope(
isolate_->counters()->gc_idle_notification()); isolate_->counters()->gc_idle_notification());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment