Index: src/counters.h |
diff --git a/src/counters.h b/src/counters.h |
index eb92a90ea743e815d15b7f77153f94913e7ab560..e380fda207c7ea8f7b00091e7272d209efb06b8f 100644 |
--- a/src/counters.h |
+++ b/src/counters.h |
@@ -17,6 +17,7 @@ |
#include "src/runtime/runtime.h" |
#include "src/tracing/trace-event.h" |
#include "src/tracing/traced-value.h" |
+#include "src/tracing/tracing-category-observer.h" |
namespace v8 { |
namespace internal { |
@@ -507,10 +508,14 @@ class RuntimeCallTimer { |
inline void Start(RuntimeCallCounter* counter, RuntimeCallTimer* parent) { |
counter_ = counter; |
parent_.SetValue(parent); |
- timer_.Start(); |
+ if (FLAG_runtime_stats != |
+ v8::tracing::TracingCategoryObserver::ENABLED_BY_SAMPLING) { |
+ timer_.Start(); |
+ } |
} |
inline RuntimeCallTimer* Stop() { |
+ if (!timer_.IsStarted()) return parent(); |
base::TimeDelta delta = timer_.Elapsed(); |
timer_.Stop(); |
counter_->count++; |