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

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

Issue 2313193002: [Tracing] Fix runtime call stats tracing for GC. (Closed)
Patch Set: Created 4 years, 3 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
« src/counters.h ('K') | « src/counters-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index 98be41d3693be9e79c2faf20e077f7d13093668f..c58aa9b5ea9738a69f1e57a73aad065c06503235 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -24,24 +24,30 @@ 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) {
+ if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
+ RuntimeCallStats::Enter(
+ tracer_->heap_->isolate()->counters()->tracing_runtime_call_stats(),
+ &timer_, &RuntimeCallStats::GC);
+ } else if (FLAG_runtime_call_stats) {
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
RuntimeCallStats::Enter(
tracer_->heap_->isolate()->counters()->runtime_call_stats(), &timer_,
&RuntimeCallStats::GC);
}
- // TODO(lpy): Add a tracing equivalent for the runtime call stats.
}
GCTracer::Scope::~Scope() {
tracer_->AddScopeSample(
scope_, tracer_->heap_->MonotonicallyIncreasingTimeInMs() - start_time_);
- // TODO(cbruni): remove once we fully moved to a trace-based system.
- if (FLAG_runtime_call_stats) {
+ if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
+ RuntimeCallStats::Leave(
+ tracer_->heap_->isolate()->counters()->tracing_runtime_call_stats(),
+ &timer_);
+ } else if (FLAG_runtime_call_stats) {
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
RuntimeCallStats::Leave(
tracer_->heap_->isolate()->counters()->runtime_call_stats(), &timer_);
}
- // TODO(lpy): Add a tracing equivalent for the runtime call stats.
}
const char* GCTracer::Scope::Name(ScopeId id) {
@@ -208,12 +214,15 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
start_time, committed_memory);
heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample(
start_time, used_memory);
- // TODO(cbruni): remove once we fully moved to a trace-based system.
- if (FLAG_runtime_call_stats) {
+ if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
+ RuntimeCallStats::Enter(
+ heap_->isolate()->counters()->tracing_runtime_call_stats(), &timer_,
+ &RuntimeCallStats::GC);
+ } else if (FLAG_runtime_call_stats) {
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
RuntimeCallStats::Enter(heap_->isolate()->counters()->runtime_call_stats(),
&timer_, &RuntimeCallStats::GC);
}
- // TODO(lpy): Add a tracing equivalent for the runtime call stats.
}
void GCTracer::MergeBaseline(const Event& baseline) {
@@ -314,12 +323,14 @@ void GCTracer::Stop(GarbageCollector collector) {
heap_->PrintShortHeapStatistics();
}
- // TODO(cbruni): remove once we fully moved to a trace-based system.
- if (FLAG_runtime_call_stats) {
+ if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
+ RuntimeCallStats::Leave(
+ heap_->isolate()->counters()->tracing_runtime_call_stats(), &timer_);
+ } else if (FLAG_runtime_call_stats) {
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
RuntimeCallStats::Leave(heap_->isolate()->counters()->runtime_call_stats(),
&timer_);
}
- // TODO(lpy): Add a tracing equivalent for the runtime call stats.
}
« src/counters.h ('K') | « src/counters-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698