OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_GC_TRACER_H_ | 5 #ifndef V8_GC_TRACER_H_ |
6 #define V8_GC_TRACER_H_ | 6 #define V8_GC_TRACER_H_ |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 // Start collecting data. | 213 // Start collecting data. |
214 void Start(GarbageCollector collector, const char* gc_reason, | 214 void Start(GarbageCollector collector, const char* gc_reason, |
215 const char* collector_reason); | 215 const char* collector_reason); |
216 | 216 |
217 // Stop collecting data and print results. | 217 // Stop collecting data and print results. |
218 void Stop(); | 218 void Stop(); |
219 | 219 |
220 // Log an incremental marking step. | 220 // Log an incremental marking step. |
221 void AddIncrementalMarkingStep(double duration, intptr_t bytes); | 221 void AddIncrementalMarkingStep(double duration, intptr_t bytes); |
222 | 222 |
| 223 // Log time spent in marking. |
| 224 void AddMarkingTime(double duration) { |
| 225 cumulative_marking_duration_ += duration; |
| 226 } |
| 227 |
| 228 // Time spent in marking. |
| 229 double cumulative_marking_duration() const { |
| 230 return cumulative_marking_duration_; |
| 231 } |
| 232 |
| 233 // Log time spent in sweeping on main thread. |
| 234 void AddSweepingTime(double duration) { |
| 235 cumulative_sweeping_duration_ += duration; |
| 236 } |
| 237 |
| 238 // Time spent in sweeping on main thread. |
| 239 double cumulative_sweeping_duration() const { |
| 240 return cumulative_sweeping_duration_; |
| 241 } |
| 242 |
223 // Compute the mean duration of the last scavenger events. Returns 0 if no | 243 // Compute the mean duration of the last scavenger events. Returns 0 if no |
224 // events have been recorded. | 244 // events have been recorded. |
225 double MeanScavengerDuration() const { | 245 double MeanScavengerDuration() const { |
226 return MeanDuration(scavenger_events_); | 246 return MeanDuration(scavenger_events_); |
227 } | 247 } |
228 | 248 |
229 // Compute the max duration of the last scavenger events. Returns 0 if no | 249 // Compute the max duration of the last scavenger events. Returns 0 if no |
230 // events have been recorded. | 250 // events have been recorded. |
231 double MaxScavengerDuration() const { return MaxDuration(scavenger_events_); } | 251 double MaxScavengerDuration() const { return MaxDuration(scavenger_events_); } |
232 | 252 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // Cumulative size of incremental marking steps (in bytes) since creation of | 314 // Cumulative size of incremental marking steps (in bytes) since creation of |
295 // tracer. | 315 // tracer. |
296 intptr_t cumulative_incremental_marking_bytes_; | 316 intptr_t cumulative_incremental_marking_bytes_; |
297 | 317 |
298 // Cumulative duration of incremental marking steps since creation of tracer. | 318 // Cumulative duration of incremental marking steps since creation of tracer. |
299 double cumulative_incremental_marking_duration_; | 319 double cumulative_incremental_marking_duration_; |
300 | 320 |
301 // Longest incremental marking step since start of marking. | 321 // Longest incremental marking step since start of marking. |
302 double longest_incremental_marking_step_; | 322 double longest_incremental_marking_step_; |
303 | 323 |
| 324 // Total marking time. |
| 325 // This timer is precise when run with --print-cumulative-gc-stat |
| 326 double cumulative_marking_duration_; |
| 327 |
| 328 // Total sweeping time on the main thread. |
| 329 // This timer is precise when run with --print-cumulative-gc-stat |
| 330 // TODO(hpayer): Account for sweeping time on sweeper threads. Add a |
| 331 // different field for that. |
| 332 // TODO(hpayer): This timer right now just holds the sweeping time |
| 333 // of the initial atomic sweeping pause. Make sure that it accumulates |
| 334 // all sweeping operations performed on the main thread. |
| 335 double cumulative_sweeping_duration_; |
| 336 |
304 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 337 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
305 }; | 338 }; |
306 } | 339 } |
307 } // namespace v8::internal | 340 } // namespace v8::internal |
308 | 341 |
309 #endif // V8_GC_TRACER_H_ | 342 #endif // V8_GC_TRACER_H_ |
OLD | NEW |