Revision: 23981
Author:   [email protected]
Date:     Tue Sep 16 16:18:02 2014 UTC
Log:      Track how much we miss the idle notification limit

We can't report negative values using histograms, so we split the data
up into two histograms

BUG=chromium:397026
LOG=n
[email protected]

Review URL: https://codereview.chromium.org/572293002
https://code.google.com/p/v8/source/detail?r=23981

Modified:
 /branches/bleeding_edge/src/counters.h
 /branches/bleeding_edge/src/heap/heap.cc

=======================================
--- /branches/bleeding_edge/src/counters.h      Tue Sep 16 13:16:02 2014 UTC
+++ /branches/bleeding_edge/src/counters.h      Tue Sep 16 16:18:02 2014 UTC
@@ -291,9 +291,11 @@
 #endif
 };

-#define HISTOGRAM_RANGE_LIST(HR) \
-  /* Generic range histograms */ \
-  HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101)
+#define HISTOGRAM_RANGE_LIST(HR) \ + /* Generic range histograms */ \ + HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \ + HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \ + HR(gc_idle_time_limit_undershot, V8.GCIdleTimeLimi.Undershot, 0, 10000, 101)

 #define HISTOGRAM_TIMER_LIST(HT)                             \
   /* Garbage collection timers. */                           \
=======================================
--- /branches/bleeding_edge/src/heap/heap.cc    Tue Sep 16 13:00:05 2014 UTC
+++ /branches/bleeding_edge/src/heap/heap.cc    Tue Sep 16 16:18:02 2014 UTC
@@ -4290,9 +4290,7 @@
   // If incremental marking is off, we do not perform idle notification.
   if (!FLAG_incremental_marking) return true;
   base::ElapsedTimer timer;
-  if (FLAG_trace_idle_notification) {
-    timer.Start();
-  }
+  timer.Start();
   isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
       idle_time_in_ms);
   HistogramTimerScope idle_notification_scope(
@@ -4348,8 +4346,17 @@
     case DO_NOTHING:
       break;
   }
+
+  int actual_time_ms = static_cast<int>(timer.Elapsed().InMilliseconds());
+  if (actual_time_ms <= idle_time_in_ms) {
+    isolate()->counters()->gc_idle_time_limit_undershot()->AddSample(
+        idle_time_in_ms - actual_time_ms);
+  } else {
+    isolate()->counters()->gc_idle_time_limit_overshot()->AddSample(
+        actual_time_ms - idle_time_in_ms);
+  }
+
   if (FLAG_trace_idle_notification) {
- int actual_time_ms = static_cast<int>(timer.Elapsed().InMilliseconds()); PrintF("Idle notification: requested idle time %d ms, actual time %d ms [",
            idle_time_in_ms, actual_time_ms);
     action.Print();

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to