Index: src/gc-tracer.h |
diff --git a/src/gc-tracer.h b/src/gc-tracer.h |
index 0f4f135256ecc6ebd0ca0ea68ba1b68bf299108a..2f4c626cd1cbe06e418e64af03a13d1298a12a1c 100644 |
--- a/src/gc-tracer.h |
+++ b/src/gc-tracer.h |
@@ -220,6 +220,26 @@ class GCTracer BASE_EMBEDDED { |
// Log an incremental marking step. |
void AddIncrementalMarkingStep(double duration, intptr_t bytes); |
+ // Log time spent in marking. |
+ void AddMarkingTime(double duration) { |
+ cumulative_marking_duration_ += duration; |
+ } |
+ |
+ // Time spent in marking. |
+ double cumulative_marking_duration() const { |
+ return cumulative_marking_duration_; |
+ } |
+ |
+ // Log time spent in sweeping on main thread. |
+ void AddSweepingTime(double duration) { |
+ cumulative_sweeping_duration_ += duration; |
+ } |
+ |
+ // Time spent in sweeping on main thread. |
+ double cumulative_sweeping_duration() const { |
+ return cumulative_sweeping_duration_; |
+ } |
+ |
// Compute the mean duration of the last scavenger events. Returns 0 if no |
// events have been recorded. |
double MeanScavengerDuration() const { |
@@ -301,6 +321,19 @@ class GCTracer BASE_EMBEDDED { |
// Longest incremental marking step since start of marking. |
double longest_incremental_marking_step_; |
+ // Total marking time. |
+ // This timer is precise when run with --print-cumulative-gc-stat |
+ double cumulative_marking_duration_; |
+ |
+ // Total sweeping time on the main thread. |
+ // This timer is precise when run with --print-cumulative-gc-stat |
+ // TODO(hpayer): Account for sweeping time on sweeper threads. Add a |
+ // different field for that. |
+ // TODO(hpayer): This timer right now just holds the sweeping time |
+ // of the initial atomic sweeping pause. Make sure that it accumulates |
+ // all sweeping operations performed on the main thread. |
+ double cumulative_sweeping_duration_; |
+ |
DISALLOW_COPY_AND_ASSIGN(GCTracer); |
}; |
} |