| 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 #include "src/heap/gc-tracer.h" | 5 #include "src/heap/gc-tracer.h" |
| 6 | 6 |
| 7 #include "src/counters.h" | 7 #include "src/counters.h" |
| 8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 | 10 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 va_start(arguments2, format); | 404 va_start(arguments2, format); |
| 405 VSNPrintF(buffer, format, arguments2); | 405 VSNPrintF(buffer, format, arguments2); |
| 406 va_end(arguments2); | 406 va_end(arguments2); |
| 407 | 407 |
| 408 heap_->AddToRingBuffer(buffer.start()); | 408 heap_->AddToRingBuffer(buffer.start()); |
| 409 } | 409 } |
| 410 | 410 |
| 411 | 411 |
| 412 void GCTracer::Print() const { | 412 void GCTracer::Print() const { |
| 413 if (FLAG_trace_gc) { | 413 if (FLAG_trace_gc) { |
| 414 PrintIsolate(heap_->isolate(), "%s", ""); | 414 PrintIsolate(heap_->isolate(), ""); |
| 415 } | 415 } |
| 416 Output("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); | 416 Output("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); |
| 417 | 417 |
| 418 Output("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", current_.TypeName(false), | 418 Output("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", current_.TypeName(false), |
| 419 static_cast<double>(current_.start_object_size) / MB, | 419 static_cast<double>(current_.start_object_size) / MB, |
| 420 static_cast<double>(current_.start_memory_size) / MB, | 420 static_cast<double>(current_.start_memory_size) / MB, |
| 421 static_cast<double>(current_.end_object_size) / MB, | 421 static_cast<double>(current_.end_object_size) / MB, |
| 422 static_cast<double>(current_.end_memory_size) / MB); | 422 static_cast<double>(current_.end_memory_size) / MB); |
| 423 | 423 |
| 424 double duration = current_.end_time - current_.start_time; | 424 double duration = current_.end_time - current_.start_time; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 "roots=%.2f " | 473 "roots=%.2f " |
| 474 "code=%.2f " | 474 "code=%.2f " |
| 475 "semispace=%.2f " | 475 "semispace=%.2f " |
| 476 "object_groups=%.2f " | 476 "object_groups=%.2f " |
| 477 "external_prologue=%.2f " | 477 "external_prologue=%.2f " |
| 478 "external_epilogue=%.2f " | 478 "external_epilogue=%.2f " |
| 479 "external_weak_global_handles=%.2f " | 479 "external_weak_global_handles=%.2f " |
| 480 "steps_count=%d " | 480 "steps_count=%d " |
| 481 "steps_took=%.1f " | 481 "steps_took=%.1f " |
| 482 "scavenge_throughput=%.f " | 482 "scavenge_throughput=%.f " |
| 483 "total_size_before=%" V8PRIdPTR | 483 "total_size_before=%" V8_PTR_PREFIX |
| 484 " " | 484 "d " |
| 485 "total_size_after=%" V8PRIdPTR | 485 "total_size_after=%" V8_PTR_PREFIX |
| 486 " " | 486 "d " |
| 487 "holes_size_before=%" V8PRIdPTR | 487 "holes_size_before=%" V8_PTR_PREFIX |
| 488 " " | 488 "d " |
| 489 "holes_size_after=%" V8PRIdPTR | 489 "holes_size_after=%" V8_PTR_PREFIX |
| 490 " " | 490 "d " |
| 491 "allocated=%" V8PRIdPTR | 491 "allocated=%" V8_PTR_PREFIX |
| 492 " " | 492 "d " |
| 493 "promoted=%" V8PRIdPTR | 493 "promoted=%" V8_PTR_PREFIX |
| 494 " " | 494 "d " |
| 495 "semi_space_copied=%" V8PRIdPTR | 495 "semi_space_copied=%" V8_PTR_PREFIX |
| 496 " " | 496 "d " |
| 497 "nodes_died_in_new=%d " | 497 "nodes_died_in_new=%d " |
| 498 "nodes_copied_in_new=%d " | 498 "nodes_copied_in_new=%d " |
| 499 "nodes_promoted=%d " | 499 "nodes_promoted=%d " |
| 500 "promotion_ratio=%.1f%% " | 500 "promotion_ratio=%.1f%% " |
| 501 "average_survival_ratio=%.1f%% " | 501 "average_survival_ratio=%.1f%% " |
| 502 "promotion_rate=%.1f%% " | 502 "promotion_rate=%.1f%% " |
| 503 "semi_space_copy_rate=%.1f%% " | 503 "semi_space_copy_rate=%.1f%% " |
| 504 "new_space_allocation_throughput=%.1f " | 504 "new_space_allocation_throughput=%.1f " |
| 505 "context_disposal_rate=%.1f\n", | 505 "context_disposal_rate=%.1f\n", |
| 506 heap_->isolate()->time_millis_since_init(), duration, | 506 heap_->isolate()->time_millis_since_init(), duration, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 "sweep.map=%.1f " | 579 "sweep.map=%.1f " |
| 580 "sweep.old=%.1f " | 580 "sweep.old=%.1f " |
| 581 "incremental_finalize=%.1f " | 581 "incremental_finalize=%.1f " |
| 582 "steps_count=%d " | 582 "steps_count=%d " |
| 583 "steps_took=%.1f " | 583 "steps_took=%.1f " |
| 584 "longest_step=%.1f " | 584 "longest_step=%.1f " |
| 585 "finalization_steps_count=%d " | 585 "finalization_steps_count=%d " |
| 586 "finalization_steps_took=%.1f " | 586 "finalization_steps_took=%.1f " |
| 587 "finalization_longest_step=%.1f " | 587 "finalization_longest_step=%.1f " |
| 588 "incremental_marking_throughput=%.f " | 588 "incremental_marking_throughput=%.f " |
| 589 "total_size_before=%" V8PRIdPTR | 589 "total_size_before=%" V8_PTR_PREFIX |
| 590 " " | 590 "d " |
| 591 "total_size_after=%" V8PRIdPTR | 591 "total_size_after=%" V8_PTR_PREFIX |
| 592 " " | 592 "d " |
| 593 "holes_size_before=%" V8PRIdPTR | 593 "holes_size_before=%" V8_PTR_PREFIX |
| 594 " " | 594 "d " |
| 595 "holes_size_after=%" V8PRIdPTR | 595 "holes_size_after=%" V8_PTR_PREFIX |
| 596 " " | 596 "d " |
| 597 "allocated=%" V8PRIdPTR | 597 "allocated=%" V8_PTR_PREFIX |
| 598 " " | 598 "d " |
| 599 "promoted=%" V8PRIdPTR | 599 "promoted=%" V8_PTR_PREFIX |
| 600 " " | 600 "d " |
| 601 "semi_space_copied=%" V8PRIdPTR | 601 "semi_space_copied=%" V8_PTR_PREFIX |
| 602 " " | 602 "d " |
| 603 "nodes_died_in_new=%d " | 603 "nodes_died_in_new=%d " |
| 604 "nodes_copied_in_new=%d " | 604 "nodes_copied_in_new=%d " |
| 605 "nodes_promoted=%d " | 605 "nodes_promoted=%d " |
| 606 "promotion_ratio=%.1f%% " | 606 "promotion_ratio=%.1f%% " |
| 607 "average_survival_ratio=%.1f%% " | 607 "average_survival_ratio=%.1f%% " |
| 608 "promotion_rate=%.1f%% " | 608 "promotion_rate=%.1f%% " |
| 609 "semi_space_copy_rate=%.1f%% " | 609 "semi_space_copy_rate=%.1f%% " |
| 610 "new_space_allocation_throughput=%.1f " | 610 "new_space_allocation_throughput=%.1f " |
| 611 "context_disposal_rate=%.1f " | 611 "context_disposal_rate=%.1f " |
| 612 "compaction_speed=%.f\n", | 612 "compaction_speed=%.f\n", |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 return sum / recorded_survival_ratios_.Count(); | 800 return sum / recorded_survival_ratios_.Count(); |
| 801 } | 801 } |
| 802 | 802 |
| 803 bool GCTracer::SurvivalEventsRecorded() const { | 803 bool GCTracer::SurvivalEventsRecorded() const { |
| 804 return recorded_survival_ratios_.Count() > 0; | 804 return recorded_survival_ratios_.Count() > 0; |
| 805 } | 805 } |
| 806 | 806 |
| 807 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } | 807 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } |
| 808 } // namespace internal | 808 } // namespace internal |
| 809 } // namespace v8 | 809 } // namespace v8 |
| OLD | NEW |