Commit f52e1872 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Measure time-to-safepoint

Now that --concurrent-inlining is already using LocalHeaps and requires
a global safepoint, let's measure how long it takes to stop-the-world.

Bug: v8:10315
Change-Id: I90f451448199fd43b9991849f4343f77e4aa3813
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2300544Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68886}
parent 09580ccf
...@@ -566,6 +566,7 @@ void GCTracer::PrintNVP() const { ...@@ -566,6 +566,7 @@ void GCTracer::PrintNVP() const {
"mutator=%.1f " "mutator=%.1f "
"gc=%s " "gc=%s "
"reduce_memory=%d " "reduce_memory=%d "
"stop_the_world=%.2f "
"heap.prologue=%.2f " "heap.prologue=%.2f "
"heap.epilogue=%.2f " "heap.epilogue=%.2f "
"heap.epilogue.reduce_new_space=%.2f " "heap.epilogue.reduce_new_space=%.2f "
...@@ -609,7 +610,8 @@ void GCTracer::PrintNVP() const { ...@@ -609,7 +610,8 @@ void GCTracer::PrintNVP() const {
"unmapper_chunks=%d " "unmapper_chunks=%d "
"context_disposal_rate=%.1f\n", "context_disposal_rate=%.1f\n",
duration, spent_in_mutator, current_.TypeName(true), duration, spent_in_mutator, current_.TypeName(true),
current_.reduce_memory, current_.scopes[Scope::HEAP_PROLOGUE], current_.reduce_memory, current_.scopes[Scope::STOP_THE_WORLD],
current_.scopes[Scope::HEAP_PROLOGUE],
current_.scopes[Scope::HEAP_EPILOGUE], current_.scopes[Scope::HEAP_EPILOGUE],
current_.scopes[Scope::HEAP_EPILOGUE_REDUCE_NEW_SPACE], current_.scopes[Scope::HEAP_EPILOGUE_REDUCE_NEW_SPACE],
current_.scopes[Scope::HEAP_EXTERNAL_PROLOGUE], current_.scopes[Scope::HEAP_EXTERNAL_PROLOGUE],
...@@ -657,6 +659,7 @@ void GCTracer::PrintNVP() const { ...@@ -657,6 +659,7 @@ void GCTracer::PrintNVP() const {
"reduce_memory=%d " "reduce_memory=%d "
"minor_mc=%.2f " "minor_mc=%.2f "
"finish_sweeping=%.2f " "finish_sweeping=%.2f "
"stop_the_world=%.2f "
"mark=%.2f " "mark=%.2f "
"mark.seed=%.2f " "mark.seed=%.2f "
"mark.roots=%.2f " "mark.roots=%.2f "
...@@ -681,6 +684,7 @@ void GCTracer::PrintNVP() const { ...@@ -681,6 +684,7 @@ void GCTracer::PrintNVP() const {
duration, spent_in_mutator, "mmc", current_.reduce_memory, duration, spent_in_mutator, "mmc", current_.reduce_memory,
current_.scopes[Scope::MINOR_MC], current_.scopes[Scope::MINOR_MC],
current_.scopes[Scope::MINOR_MC_SWEEPING], current_.scopes[Scope::MINOR_MC_SWEEPING],
current_.scopes[Scope::STOP_THE_WORLD],
current_.scopes[Scope::MINOR_MC_MARK], current_.scopes[Scope::MINOR_MC_MARK],
current_.scopes[Scope::MINOR_MC_MARK_SEED], current_.scopes[Scope::MINOR_MC_MARK_SEED],
current_.scopes[Scope::MINOR_MC_MARK_ROOTS], current_.scopes[Scope::MINOR_MC_MARK_ROOTS],
...@@ -711,6 +715,7 @@ void GCTracer::PrintNVP() const { ...@@ -711,6 +715,7 @@ void GCTracer::PrintNVP() const {
"mutator=%.1f " "mutator=%.1f "
"gc=%s " "gc=%s "
"reduce_memory=%d " "reduce_memory=%d "
"stop_the_world=%.2f "
"heap.prologue=%.2f " "heap.prologue=%.2f "
"heap.embedder_tracing_epilogue=%.2f " "heap.embedder_tracing_epilogue=%.2f "
"heap.epilogue=%.2f " "heap.epilogue=%.2f "
...@@ -805,7 +810,8 @@ void GCTracer::PrintNVP() const { ...@@ -805,7 +810,8 @@ void GCTracer::PrintNVP() const {
"context_disposal_rate=%.1f " "context_disposal_rate=%.1f "
"compaction_speed=%.f\n", "compaction_speed=%.f\n",
duration, spent_in_mutator, current_.TypeName(true), duration, spent_in_mutator, current_.TypeName(true),
current_.reduce_memory, current_.scopes[Scope::HEAP_PROLOGUE], current_.reduce_memory, current_.scopes[Scope::STOP_THE_WORLD],
current_.scopes[Scope::HEAP_PROLOGUE],
current_.scopes[Scope::HEAP_EMBEDDER_TRACING_EPILOGUE], current_.scopes[Scope::HEAP_EMBEDDER_TRACING_EPILOGUE],
current_.scopes[Scope::HEAP_EPILOGUE], current_.scopes[Scope::HEAP_EPILOGUE],
current_.scopes[Scope::HEAP_EPILOGUE_REDUCE_NEW_SPACE], current_.scopes[Scope::HEAP_EPILOGUE_REDUCE_NEW_SPACE],
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "src/handles/local-handles.h" #include "src/handles/local-handles.h"
#include "src/handles/persistent-handles.h" #include "src/handles/persistent-handles.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/heap.h" #include "src/heap/heap.h"
#include "src/heap/local-heap.h" #include "src/heap/local-heap.h"
...@@ -24,6 +25,8 @@ void GlobalSafepoint::EnterSafepointScope() { ...@@ -24,6 +25,8 @@ void GlobalSafepoint::EnterSafepointScope() {
if (++active_safepoint_scopes_ > 1) return; if (++active_safepoint_scopes_ > 1) return;
TRACE_GC(heap_->tracer(), GCTracer::Scope::STOP_THE_WORLD);
local_heaps_mutex_.Lock(); local_heaps_mutex_.Lock();
local_heap_of_this_thread_ = LocalHeap::Current(); local_heap_of_this_thread_ = LocalHeap::Current();
......
...@@ -499,7 +499,8 @@ ...@@ -499,7 +499,8 @@
F(SCAVENGER_SCAVENGE_UPDATE_REFS) \ F(SCAVENGER_SCAVENGE_UPDATE_REFS) \
F(SCAVENGER_SCAVENGE_WEAK) \ F(SCAVENGER_SCAVENGE_WEAK) \
F(SCAVENGER_SCAVENGE_FINALIZE) \ F(SCAVENGER_SCAVENGE_FINALIZE) \
F(SCAVENGER_SWEEP_ARRAY_BUFFERS) F(SCAVENGER_SWEEP_ARRAY_BUFFERS) \
F(STOP_THE_WORLD)
#define TRACER_BACKGROUND_SCOPES(F) \ #define TRACER_BACKGROUND_SCOPES(F) \
F(BACKGROUND_ARRAY_BUFFER_FREE) \ F(BACKGROUND_ARRAY_BUFFER_FREE) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment