Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Unified Diff: src/heap/gc-tracer.cc

Issue 1825093002: [counters] adding runtime call timers for GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: adding gc timer Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index 4d02fdeff57071ef61ec73ca3feb90653ca27eb2..5166b6e62be6da6bfe56caa72a360ec287fac02c 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -24,6 +24,13 @@ static intptr_t CountTotalHolesSize(Heap* heap) {
GCTracer::Scope::Scope(GCTracer* tracer, ScopeId scope)
: tracer_(tracer), scope_(scope) {
start_time_ = tracer_->heap_->MonotonicallyIncreasingTimeInMs();
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
+ if (FLAG_runtime_call_stats) {
+ RuntimeCallStats* stats =
+ tracer_->heap_->isolate()->counters()->runtime_call_stats();
+ timer_.Initialize(&stats->GC, stats->current_timer());
+ stats->Enter(&timer_);
+ }
}
@@ -31,6 +38,10 @@ GCTracer::Scope::~Scope() {
DCHECK(scope_ < NUMBER_OF_SCOPES); // scope_ is unsigned.
tracer_->current_.scopes[scope_] +=
tracer_->heap_->MonotonicallyIncreasingTimeInMs() - start_time_;
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
+ if (FLAG_runtime_call_stats) {
+ tracer_->heap_->isolate()->counters()->runtime_call_stats()->Leave(&timer_);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698