Index: src/tracing/tracing-category-observer.cc |
diff --git a/src/tracing/tracing-category-observer.cc b/src/tracing/tracing-category-observer.cc |
index 710488a1c300e135cdef661a6ce0949bac8d4928..e6bd06ae17547fa2257152c1fb23eee2d20111c6 100644 |
--- a/src/tracing/tracing-category-observer.cc |
+++ b/src/tracing/tracing-category-observer.cc |
@@ -18,6 +18,8 @@ void TracingCategoryObserver::SetUp() { |
v8::internal::V8::GetCurrentPlatform()->AddTraceStateObserver( |
TracingCategoryObserver::instance_); |
TRACE_EVENT_WARMUP_CATEGORY(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats")); |
+ TRACE_EVENT_WARMUP_CATEGORY( |
+ TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats_sampling")); |
} |
void TracingCategoryObserver::TearDown() { |
@@ -33,10 +35,16 @@ void TracingCategoryObserver::OnTraceEnabled() { |
if (enabled) { |
v8::internal::FLAG_runtime_stats |= ENABLED_BY_TRACING; |
} |
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED( |
+ TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats_sampling"), &enabled); |
+ if (enabled) { |
+ v8::internal::FLAG_runtime_stats |= ENABLED_BY_SAMPLING; |
+ } |
} |
void TracingCategoryObserver::OnTraceDisabled() { |
- v8::internal::FLAG_runtime_stats &= ~ENABLED_BY_TRACING; |
+ v8::internal::FLAG_runtime_stats &= |
+ ~(ENABLED_BY_TRACING | ENABLED_BY_SAMPLING); |
} |
} // namespace tracing |