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

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..799e4a7f0f9f03627b8ed7cac59c4f13ff8ad869 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -69,6 +69,7 @@ void Profiler::InitOnce() {
SetSamplePeriod(FLAG_profile_period);
SetSampleDepth(FLAG_max_profile_depth);
Sample::InitOnce();
+#if !defined(TARGET_ARCH_DBC)
zra 2017/07/31 15:03:11 I thought the profiler was kind of working somewha
rmacnak 2017/07/31 21:12:12 Removed; this was a bad merge. I was working from
if (!FLAG_profiler) {
return;
}
@@ -78,9 +79,11 @@ void Profiler::InitOnce() {
// Zero counters.
memset(&counters_, 0, sizeof(counters_));
NativeSymbolResolver::InitOnce();
+ ThreadInterrupter::InitOnce();
ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period);
ThreadInterrupter::Startup();
initialized_ = true;
+#endif // !DBC
}
void Profiler::InitAllocationSampleBuffer() {
@@ -91,12 +94,16 @@ void Profiler::InitAllocationSampleBuffer() {
}
void Profiler::Shutdown() {
+#if !defined(TARGET_ARCH_DBC)
if (!FLAG_profiler) {
return;
}
ASSERT(initialized_);
ThreadInterrupter::Shutdown();
NativeSymbolResolver::ShutdownOnce();
+// Note we do not free the sample buffer because there may be SIGPROFs
zra 2017/07/31 15:03:11 Can you set a "shutting down" bit somewhere that t
rmacnak 2017/07/31 21:12:12 The signal handler could be between that check and
zra 2017/07/31 21:59:28 Maybe some thing like: Signal handler: AtomicInc(
rmacnak 2017/08/01 19:58:58 Added TODO(30309)
+// in flight.
+#endif // !DBC
}
void Profiler::SetSampleDepth(intptr_t depth) {

Powered by Google App Engine
This is Rietveld 408576698