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

Unified Diff: runtime/vm/profiler.h

Issue 2989093002: [vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later … (Closed)
Patch Set: . Created 3 years, 5 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: runtime/vm/profiler.h
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index 8ffa4ecd097c0eaff0276e37607f3a4f66b60d7f..05ecedd2b67421943901f911f1e88df63fb8580c 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -54,6 +54,15 @@ class Profiler : public AllStatic {
static void InitAllocationSampleBuffer();
static void Shutdown();
+#if !defined(PRODUCT)
+ static void EnsureEnabled() {
zra 2017/07/31 15:03:11 It looks like this is only used for tests, so thin
rmacnak 2017/07/31 21:12:13 Done.
+ if (!FLAG_profiler) {
+ FLAG_profiler = true;
+ Profiler::InitOnce();
+ }
+ }
+#endif
+
static void SetSampleDepth(intptr_t depth);
static void SetSamplePeriod(intptr_t period);

Powered by Google App Engine
This is Rietveld 408576698