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
This commit is contained in:
hpayer@chromium.org 2014-07-28 09:13:33 +00:00
parent 3db23c80c4
commit e52908e428
3 changed files with 23 additions and 2 deletions

View File

@ -55,6 +55,11 @@ void HistogramTimer::Stop() {
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) \
name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate);
HISTOGRAM_TIMER_LIST(HT)
@ -142,6 +147,10 @@ void Counters::ResetCounters() {
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();
HISTOGRAM_TIMER_LIST(HT)
#undef HT

View File

@ -291,6 +291,9 @@ class HistogramTimerScope BASE_EMBEDDED {
#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) \
/* Garbage collection timers. */ \
@ -552,6 +555,11 @@ class HistogramTimerScope BASE_EMBEDDED {
// This file contains all the v8 counters that are in use.
class Counters {
public:
#define HR(name, caption, min, max, num_buckets) \
Histogram* name() { return &name##_; }
HISTOGRAM_RANGE_LIST(HR)
#undef HR
#define HT(name, caption) \
HistogramTimer* name() { return &name##_; }
HISTOGRAM_TIMER_LIST(HT)
@ -639,6 +647,10 @@ class Counters {
void ResetHistograms();
private:
#define HR(name, caption, min, max, num_buckets) Histogram name##_;
HISTOGRAM_RANGE_LIST(HR)
#undef HR
#define HT(name, caption) \
HistogramTimer name##_;
HISTOGRAM_TIMER_LIST(HT)

View File

@ -54,8 +54,7 @@ Heap::Heap()
isolate_(NULL),
code_range_size_(0),
// semispace_size_ should be a power of 2 and old_generation_size_ should
// be
// a multiple of Page::kPageSize.
// be a multiple of Page::kPageSize.
reserved_semispace_size_(8 * (kPointerSize / 4) * MB),
max_semi_space_size_(8 * (kPointerSize / 4) * MB),
initial_semispace_size_(Page::kPageSize),
@ -4268,6 +4267,7 @@ bool Heap::IdleNotification(int hint) {
intptr_t step_size =
size_factor * IncrementalMarking::kAllocatedThreshold;
isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(hint);
HistogramTimerScope idle_notification_scope(
isolate_->counters()->gc_idle_notification());