Chromium Code Reviews| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/heap/gc-tracer.h" | 7 #include "src/heap/gc-tracer.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 | 382 |
| 383 if (current_.collector_reason != NULL) { | 383 if (current_.collector_reason != NULL) { |
| 384 Output(" [%s]", current_.collector_reason); | 384 Output(" [%s]", current_.collector_reason); |
| 385 } | 385 } |
| 386 | 386 |
| 387 Output(".\n"); | 387 Output(".\n"); |
| 388 } | 388 } |
| 389 | 389 |
| 390 | 390 |
| 391 void GCTracer::PrintNVP() const { | 391 void GCTracer::PrintNVP() const { |
| 392 PrintIsolate(heap_->isolate(), "[I:%p] %8.0f ms: ", heap_->isolate(), | 392 PrintIsolate(heap_->isolate(), "[I:%p] %8.0f gc-trace: ", heap_->isolate(), |
|
Hannes Payer (out of office)
2015/07/20 08:50:24
why did you delete the ms?
Michael Lippautz
2015/07/20 09:34:05
whoops. reverted to "ms".
| |
| 393 heap_->isolate()->time_millis_since_init()); | 393 heap_->isolate()->time_millis_since_init()); |
| 394 | 394 |
| 395 double duration = current_.end_time - current_.start_time; | 395 double duration = current_.end_time - current_.start_time; |
| 396 double spent_in_mutator = current_.start_time - previous_.end_time; | 396 double spent_in_mutator = current_.start_time - previous_.end_time; |
| 397 | 397 |
| 398 PrintF("pause=%.1f ", duration); | 398 PrintF("pause=%.1f ", duration); |
| 399 PrintF("mutator=%.1f ", spent_in_mutator); | 399 PrintF("mutator=%.1f ", spent_in_mutator); |
| 400 PrintF("gc=%s ", current_.TypeName(true)); | 400 PrintF("gc=%s ", current_.TypeName(true)); |
| 401 | 401 |
| 402 PrintF("external=%.1f ", current_.scopes[Scope::EXTERNAL]); | 402 switch (current_.type) { |
| 403 PrintF("mark=%.1f ", current_.scopes[Scope::MC_MARK]); | 403 case Event::SCAVENGER: |
| 404 PrintF("sweep=%.2f ", current_.scopes[Scope::MC_SWEEP]); | 404 PrintF("scavenge=%.2f ", current_.scopes[Scope::SCAVENGER_SCAVENGE]); |
| 405 PrintF("sweepns=%.2f ", current_.scopes[Scope::MC_SWEEP_NEWSPACE]); | 405 PrintF("old_new=%.2f ", |
| 406 PrintF("sweepos=%.2f ", current_.scopes[Scope::MC_SWEEP_OLDSPACE]); | 406 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS]); |
| 407 PrintF("sweepcode=%.2f ", current_.scopes[Scope::MC_SWEEP_CODE]); | 407 PrintF("semispace=%.2f ", current_.scopes[Scope::SCAVENGER_SEMISPACE]); |
| 408 PrintF("sweepcell=%.2f ", current_.scopes[Scope::MC_SWEEP_CELL]); | 408 PrintF("steps_count=%d ", current_.incremental_marking_steps); |
| 409 PrintF("sweepmap=%.2f ", current_.scopes[Scope::MC_SWEEP_MAP]); | 409 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); |
| 410 PrintF("evacuate=%.1f ", current_.scopes[Scope::MC_EVACUATE_PAGES]); | 410 PrintF("scavenge_throughput=%" V8_PTR_PREFIX "d ", |
| 411 PrintF("new_new=%.1f ", | 411 ScavengeSpeedInBytesPerMillisecond()); |
| 412 current_.scopes[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); | 412 break; |
| 413 PrintF("root_new=%.1f ", | 413 case Event::MARK_COMPACTOR: |
|
Hannes Payer (out of office)
2015/07/20 08:50:24
Here we could further distinguish between incremen
Michael Lippautz
2015/07/20 09:34:05
Acknowledged.
| |
| 414 current_.scopes[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); | 414 case Event::INCREMENTAL_MARK_COMPACTOR: |
| 415 PrintF("old_new=%.1f ", | 415 PrintF("external=%.1f ", current_.scopes[Scope::EXTERNAL]); |
| 416 current_.scopes[Scope::MC_UPDATE_OLD_TO_NEW_POINTERS]); | 416 PrintF("mark=%.1f ", current_.scopes[Scope::MC_MARK]); |
| 417 PrintF("compaction_ptrs=%.1f ", | 417 PrintF("sweep=%.2f ", current_.scopes[Scope::MC_SWEEP]); |
| 418 current_.scopes[Scope::MC_UPDATE_POINTERS_TO_EVACUATED]); | 418 PrintF("sweepns=%.2f ", current_.scopes[Scope::MC_SWEEP_NEWSPACE]); |
| 419 PrintF("intracompaction_ptrs=%.1f ", | 419 PrintF("sweepos=%.2f ", current_.scopes[Scope::MC_SWEEP_OLDSPACE]); |
| 420 current_.scopes[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); | 420 PrintF("sweepcode=%.2f ", current_.scopes[Scope::MC_SWEEP_CODE]); |
| 421 PrintF("misc_compaction=%.1f ", | 421 PrintF("sweepcell=%.2f ", current_.scopes[Scope::MC_SWEEP_CELL]); |
| 422 current_.scopes[Scope::MC_UPDATE_MISC_POINTERS]); | 422 PrintF("sweepmap=%.2f ", current_.scopes[Scope::MC_SWEEP_MAP]); |
| 423 PrintF("weak_closure=%.1f ", current_.scopes[Scope::MC_WEAKCLOSURE]); | 423 PrintF("evacuate=%.1f ", current_.scopes[Scope::MC_EVACUATE_PAGES]); |
| 424 PrintF("inc_weak_closure=%.1f ", | 424 PrintF("new_new=%.1f ", |
| 425 current_.scopes[Scope::MC_INCREMENTAL_WEAKCLOSURE]); | 425 current_.scopes[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); |
| 426 PrintF("weakcollection_process=%.1f ", | 426 PrintF("root_new=%.1f ", |
| 427 current_.scopes[Scope::MC_WEAKCOLLECTION_PROCESS]); | 427 current_.scopes[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); |
| 428 PrintF("weakcollection_clear=%.1f ", | 428 PrintF("old_new=%.1f ", |
| 429 current_.scopes[Scope::MC_WEAKCOLLECTION_CLEAR]); | 429 current_.scopes[Scope::MC_UPDATE_OLD_TO_NEW_POINTERS]); |
| 430 PrintF("weakcollection_abort=%.1f ", | 430 PrintF("compaction_ptrs=%.1f ", |
| 431 current_.scopes[Scope::MC_WEAKCOLLECTION_ABORT]); | 431 current_.scopes[Scope::MC_UPDATE_POINTERS_TO_EVACUATED]); |
| 432 PrintF("intracompaction_ptrs=%.1f ", | |
| 433 current_.scopes[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); | |
| 434 PrintF("misc_compaction=%.1f ", | |
| 435 current_.scopes[Scope::MC_UPDATE_MISC_POINTERS]); | |
| 436 PrintF("weak_closure=%.1f ", current_.scopes[Scope::MC_WEAKCLOSURE]); | |
| 437 PrintF("inc_weak_closure=%.1f ", | |
| 438 current_.scopes[Scope::MC_INCREMENTAL_WEAKCLOSURE]); | |
| 439 PrintF("weakcollection_process=%.1f ", | |
| 440 current_.scopes[Scope::MC_WEAKCOLLECTION_PROCESS]); | |
| 441 PrintF("weakcollection_clear=%.1f ", | |
| 442 current_.scopes[Scope::MC_WEAKCOLLECTION_CLEAR]); | |
| 443 PrintF("weakcollection_abort=%.1f ", | |
| 444 current_.scopes[Scope::MC_WEAKCOLLECTION_ABORT]); | |
| 445 | |
| 446 PrintF("steps_count=%d ", current_.incremental_marking_steps); | |
| 447 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); | |
| 448 PrintF("longest_step=%.1f ", current_.longest_incremental_marking_step); | |
| 449 PrintF("incremental_marking_throughput=%" V8_PTR_PREFIX "d ", | |
| 450 IncrementalMarkingSpeedInBytesPerMillisecond()); | |
| 451 break; | |
| 452 case Event::START: | |
| 453 break; | |
| 454 default: | |
| 455 break; | |
|
Hannes Payer (out of office)
2015/07/20 08:50:25
The default case should never happen:
default:
U
Michael Lippautz
2015/07/20 09:34:05
Done.
| |
| 456 } | |
| 457 | |
| 432 | 458 |
| 433 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", current_.start_object_size); | 459 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", current_.start_object_size); |
| 434 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", current_.end_object_size); | 460 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", current_.end_object_size); |
| 435 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", current_.start_holes_size); | 461 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", current_.start_holes_size); |
| 436 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", current_.end_holes_size); | 462 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", current_.end_holes_size); |
| 437 | 463 |
| 438 intptr_t allocated_since_last_gc = | 464 intptr_t allocated_since_last_gc = |
| 439 current_.start_object_size - previous_.end_object_size; | 465 current_.start_object_size - previous_.end_object_size; |
| 440 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc); | 466 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc); |
| 441 PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_); | 467 PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_); |
| 442 PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ", | 468 PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ", |
| 443 heap_->semi_space_copied_object_size_); | 469 heap_->semi_space_copied_object_size_); |
| 444 PrintF("nodes_died_in_new=%d ", heap_->nodes_died_in_new_space_); | 470 PrintF("nodes_died_in_new=%d ", heap_->nodes_died_in_new_space_); |
| 445 PrintF("nodes_copied_in_new=%d ", heap_->nodes_copied_in_new_space_); | 471 PrintF("nodes_copied_in_new=%d ", heap_->nodes_copied_in_new_space_); |
| 446 PrintF("nodes_promoted=%d ", heap_->nodes_promoted_); | 472 PrintF("nodes_promoted=%d ", heap_->nodes_promoted_); |
| 447 PrintF("promotion_ratio=%.1f%% ", heap_->promotion_ratio_); | 473 PrintF("promotion_ratio=%.1f%% ", heap_->promotion_ratio_); |
| 448 PrintF("average_survival_ratio=%.1f%% ", AverageSurvivalRatio()); | 474 PrintF("average_survival_ratio=%.1f%% ", AverageSurvivalRatio()); |
| 449 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); | 475 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); |
| 450 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); | 476 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); |
| 451 PrintF("new_space_allocation_throughput=%" V8_PTR_PREFIX "d ", | 477 PrintF("new_space_allocation_throughput=%" V8_PTR_PREFIX "d ", |
| 452 NewSpaceAllocationThroughputInBytesPerMillisecond()); | 478 NewSpaceAllocationThroughputInBytesPerMillisecond()); |
| 453 PrintF("context_disposal_rate=%.1f ", ContextDisposalRateInMilliseconds()); | 479 PrintF("context_disposal_rate=%.1f ", ContextDisposalRateInMilliseconds()); |
| 454 | 480 |
| 455 if (current_.type == Event::SCAVENGER) { | |
| 456 PrintF("steps_count=%d ", current_.incremental_marking_steps); | |
| 457 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); | |
| 458 PrintF("scavenge_throughput=%" V8_PTR_PREFIX "d ", | |
| 459 ScavengeSpeedInBytesPerMillisecond()); | |
| 460 } else { | |
| 461 PrintF("steps_count=%d ", current_.incremental_marking_steps); | |
| 462 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); | |
| 463 PrintF("longest_step=%.1f ", current_.longest_incremental_marking_step); | |
| 464 PrintF("incremental_marking_throughput=%" V8_PTR_PREFIX "d ", | |
| 465 IncrementalMarkingSpeedInBytesPerMillisecond()); | |
| 466 } | |
| 467 | |
| 468 PrintF("\n"); | 481 PrintF("\n"); |
| 469 } | 482 } |
| 470 | 483 |
| 471 | 484 |
| 472 double GCTracer::MeanDuration(const EventBuffer& events) const { | 485 double GCTracer::MeanDuration(const EventBuffer& events) const { |
| 473 if (events.empty()) return 0.0; | 486 if (events.empty()) return 0.0; |
| 474 | 487 |
| 475 double mean = 0.0; | 488 double mean = 0.0; |
| 476 EventBuffer::const_iterator iter = events.begin(); | 489 EventBuffer::const_iterator iter = events.begin(); |
| 477 while (iter != events.end()) { | 490 while (iter != events.end()) { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 721 | 734 |
| 722 | 735 |
| 723 bool GCTracer::SurvivalEventsRecorded() const { | 736 bool GCTracer::SurvivalEventsRecorded() const { |
| 724 return survival_events_.size() > 0; | 737 return survival_events_.size() > 0; |
| 725 } | 738 } |
| 726 | 739 |
| 727 | 740 |
| 728 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } | 741 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } |
| 729 } // namespace internal | 742 } // namespace internal |
| 730 } // namespace v8 | 743 } // namespace v8 |
| OLD | NEW |