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

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
« no previous file with comments | « runtime/vm/malloc_hooks_test.cc ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index a99b48ee84b38090e31fdc1e74dc7b6e2eef88a3..12b31d01f1a32731b7b46d34203c4a52939f6afd 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,13 @@ void Profiler::Shutdown() {
ASSERT(initialized_);
ThreadInterrupter::Shutdown();
NativeSymbolResolver::ShutdownOnce();
+#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID)
+ // TODO(30309): Free the sample buffer on platforms that use a signal-based
+ // thread interrupter.
+#else
+ delete sample_buffer_;
+ sample_buffer_ = NULL;
+#endif
}
void Profiler::SetSampleDepth(intptr_t depth) {
« no previous file with comments | « runtime/vm/malloc_hooks_test.cc ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698