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_HEAP_GC_TRACER_H_ | 5 #ifndef V8_HEAP_GC_TRACER_H_ |
6 #define V8_HEAP_GC_TRACER_H_ | 6 #define V8_HEAP_GC_TRACER_H_ |
7 | 7 |
8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 void AddContextDisposalTime(double time); | 288 void AddContextDisposalTime(double time); |
289 | 289 |
290 void AddCompactionEvent(double duration, intptr_t live_bytes_compacted); | 290 void AddCompactionEvent(double duration, intptr_t live_bytes_compacted); |
291 | 291 |
292 void AddSurvivalRatio(double survival_ratio); | 292 void AddSurvivalRatio(double survival_ratio); |
293 | 293 |
294 // Log an incremental marking step. | 294 // Log an incremental marking step. |
295 void AddIncrementalMarkingStep(double duration, intptr_t bytes); | 295 void AddIncrementalMarkingStep(double duration, intptr_t bytes); |
296 | 296 |
297 // Log time spent in marking. | |
298 void AddMarkingTime(double duration) { | |
299 cumulative_marking_duration_ += duration; | |
300 } | |
301 | |
302 // Time spent in marking. | |
303 double cumulative_marking_duration() const { | |
304 return cumulative_marking_duration_; | |
305 } | |
306 | |
307 // Log time spent in sweeping on main thread. | |
308 void AddSweepingTime(double duration) { | |
309 cumulative_sweeping_duration_ += duration; | |
310 } | |
311 | |
312 // Time spent in sweeping on main thread. | |
313 double cumulative_sweeping_duration() const { | |
314 return cumulative_sweeping_duration_; | |
315 } | |
316 | |
317 // Compute the average incremental marking speed in bytes/millisecond. | 297 // Compute the average incremental marking speed in bytes/millisecond. |
318 // Returns 0 if no events have been recorded. | 298 // Returns 0 if no events have been recorded. |
319 double IncrementalMarkingSpeedInBytesPerMillisecond() const; | 299 double IncrementalMarkingSpeedInBytesPerMillisecond() const; |
320 | 300 |
321 // Compute the average scavenge speed in bytes/millisecond. | 301 // Compute the average scavenge speed in bytes/millisecond. |
322 // Returns 0 if no events have been recorded. | 302 // Returns 0 if no events have been recorded. |
323 double ScavengeSpeedInBytesPerMillisecond( | 303 double ScavengeSpeedInBytesPerMillisecond( |
324 ScavengeSpeedMode mode = kForAllObjects) const; | 304 ScavengeSpeedMode mode = kForAllObjects) const; |
325 | 305 |
326 // Compute the average compaction speed in bytes/millisecond. | 306 // Compute the average compaction speed in bytes/millisecond. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 // tracer. | 435 // tracer. |
456 intptr_t cumulative_incremental_marking_bytes_; | 436 intptr_t cumulative_incremental_marking_bytes_; |
457 | 437 |
458 // Cumulative duration of incremental marking steps since creation of tracer. | 438 // Cumulative duration of incremental marking steps since creation of tracer. |
459 double cumulative_incremental_marking_duration_; | 439 double cumulative_incremental_marking_duration_; |
460 | 440 |
461 // Cumulative duration of pure incremental marking steps since creation of | 441 // Cumulative duration of pure incremental marking steps since creation of |
462 // tracer. | 442 // tracer. |
463 double cumulative_pure_incremental_marking_duration_; | 443 double cumulative_pure_incremental_marking_duration_; |
464 | 444 |
465 // Total marking time. | |
466 // This timer is precise when run with --print-cumulative-gc-stat | |
467 double cumulative_marking_duration_; | |
468 | |
469 // Incremental scopes carry more information than just the duration. The infos | 445 // Incremental scopes carry more information than just the duration. The infos |
470 // here are merged back upon starting/stopping the GC tracer. | 446 // here are merged back upon starting/stopping the GC tracer. |
471 IncrementalMarkingInfos | 447 IncrementalMarkingInfos |
472 incremental_marking_scopes_[Scope::NUMBER_OF_INCREMENTAL_SCOPES]; | 448 incremental_marking_scopes_[Scope::NUMBER_OF_INCREMENTAL_SCOPES]; |
473 | 449 |
474 // Total sweeping time on the main thread. | |
475 // This timer is precise when run with --print-cumulative-gc-stat | |
476 // TODO(hpayer): Account for sweeping time on sweeper threads. Add a | |
477 // different field for that. | |
478 // TODO(hpayer): This timer right now just holds the sweeping time | |
479 // of the initial atomic sweeping pause. Make sure that it accumulates | |
480 // all sweeping operations performed on the main thread. | |
481 double cumulative_sweeping_duration_; | |
482 | |
483 double incremental_marking_start_time_; | 450 double incremental_marking_start_time_; |
484 | 451 |
485 // Timestamp and allocation counter at the last sampled allocation event. | 452 // Timestamp and allocation counter at the last sampled allocation event. |
486 double allocation_time_ms_; | 453 double allocation_time_ms_; |
487 size_t new_space_allocation_counter_bytes_; | 454 size_t new_space_allocation_counter_bytes_; |
488 size_t old_generation_allocation_counter_bytes_; | 455 size_t old_generation_allocation_counter_bytes_; |
489 | 456 |
490 // Accumulated duration and allocated bytes since the last GC. | 457 // Accumulated duration and allocated bytes since the last GC. |
491 double allocation_duration_since_gc_; | 458 double allocation_duration_since_gc_; |
492 size_t new_space_allocation_in_bytes_since_gc_; | 459 size_t new_space_allocation_in_bytes_since_gc_; |
(...skipping 17 matching lines...) Expand all Loading... |
510 RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; | 477 RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; |
511 RingBuffer<double> recorded_context_disposal_times_; | 478 RingBuffer<double> recorded_context_disposal_times_; |
512 RingBuffer<double> recorded_survival_ratios_; | 479 RingBuffer<double> recorded_survival_ratios_; |
513 | 480 |
514 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 481 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
515 }; | 482 }; |
516 } // namespace internal | 483 } // namespace internal |
517 } // namespace v8 | 484 } // namespace v8 |
518 | 485 |
519 #endif // V8_HEAP_GC_TRACER_H_ | 486 #endif // V8_HEAP_GC_TRACER_H_ |
OLD | NEW |