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

Unified Diff: src/counters.h

Issue 2472193002: [profiler] Introduce lightweight mode for Rutime Call Stats collection. (Closed)
Patch Set: . Created 4 years, 1 month 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
« no previous file with comments | « no previous file | src/tracing/tracing-category-observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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++;
« no previous file with comments | « no previous file | src/tracing/tracing-category-observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698