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

Unified Diff: runtime/vm/service.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/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index be4bd31e197364af831d05df3b095d19ff40f326..32e22d59dfbaab26818e90fd369911d122eab361 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -29,6 +29,7 @@
#include "vm/object_store.h"
#include "vm/parser.h"
#include "vm/port.h"
+#include "vm/profiler.h"
#include "vm/profiler_service.h"
#include "vm/reusable_handles.h"
#include "vm/safepoint.h"
@@ -3121,6 +3122,16 @@ static bool Pause(Thread* thread, JSONStream* js) {
return true;
}
+static const MethodParameter* enable_profiler_params[] = {
+ NULL,
+};
+
+static bool EnableProfiler(Thread* thread, JSONStream* js) {
+ Profiler::EnsureEnabled();
+ PrintSuccess(js);
+ return true;
+}
+
static const MethodParameter* get_tag_profile_params[] = {
RUNNABLE_ISOLATE_PARAMETER, NULL,
};
@@ -4022,6 +4033,8 @@ static const ServiceMethodDescriptor service_methods_[] = {
clear_cpu_profile_params },
{ "_clearVMTimeline", ClearVMTimeline,
clear_vm_timeline_params, },
+ { "_enableProfiler", EnableProfiler,
+ enable_profiler_params, },
{ "evaluate", Evaluate,
evaluate_params },
{ "evaluateInFrame", EvaluateInFrame,

Powered by Google App Engine
This is Rietveld 408576698