Index: runtime/vm/profiler.cc |
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
index 529e733eccfb25b4a8fbe580a0a2e56313718ba4..cffb023bca763ed8a40e153fea02eef7a16e5931 100644 |
--- a/runtime/vm/profiler.cc |
+++ b/runtime/vm/profiler.cc |
@@ -50,6 +50,7 @@ void Profiler::InitOnce() { |
} else if (FLAG_profile_depth > kMaximumDepth) { |
FLAG_profile_depth = kMaximumDepth; |
} |
+ // We must always initialize the Sample, even when the profiler is disabled. |
Sample::InitOnce(); |
if (!FLAG_profile) { |
return; |
@@ -57,8 +58,8 @@ void Profiler::InitOnce() { |
ASSERT(!initialized_); |
sample_buffer_ = new SampleBuffer(); |
NativeSymbolResolver::InitOnce(); |
- ThreadInterrupter::InitOnce(); |
ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period); |
+ ThreadInterrupter::Startup(); |
initialized_ = true; |
} |