| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index c96ea97f1b026b0079d676112ee24dc51cb0927b..97445a61e69094bb6b2a30c72ba561f704f132d9 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -4290,9 +4290,7 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
|
| // 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 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
|
| 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();
|
|
|