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

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
« no previous file with comments | « runtime/vm/program_visitor.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index be4bd31e197364af831d05df3b095d19ff40f326..d35bdba7c2bcf032adc8cd7cbac4a336c91fd012 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,19 @@ static bool Pause(Thread* thread, JSONStream* js) {
return true;
}
+static const MethodParameter* enable_profiler_params[] = {
+ NULL,
+};
+
+static bool EnableProfiler(Thread* thread, JSONStream* js) {
+ if (!FLAG_profiler) {
+ FLAG_profiler = true;
+ Profiler::InitOnce();
+ }
+ PrintSuccess(js);
+ return true;
+}
+
static const MethodParameter* get_tag_profile_params[] = {
RUNNABLE_ISOLATE_PARAMETER, NULL,
};
@@ -4022,6 +4036,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,
« no previous file with comments | « runtime/vm/program_visitor.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698