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

Unified Diff: runtime/vm/profiler.cc

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.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index a99b48ee84b38090e31fdc1e74dc7b6e2eef88a3..50eab00071fbf7d11ecd6ab109415e9d9859aa4d 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -78,6 +78,7 @@ void Profiler::InitOnce() {
// Zero counters.
memset(&counters_, 0, sizeof(counters_));
NativeSymbolResolver::InitOnce();
+ ThreadInterrupter::InitOnce();
ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period);
ThreadInterrupter::Startup();
initialized_ = true;
@@ -97,6 +98,8 @@ void Profiler::Shutdown() {
ASSERT(initialized_);
ThreadInterrupter::Shutdown();
NativeSymbolResolver::ShutdownOnce();
+ // Note we do not free the sample buffer because there may be SIGPROFs
+ // in flight.
}
void Profiler::SetSampleDepth(intptr_t depth) {

Powered by Google App Engine
This is Rietveld 408576698