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

Side by Side 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, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
(...skipping 11 matching lines...) Expand all
22 #include "vm/message_handler.h" 22 #include "vm/message_handler.h"
23 #include "vm/native_arguments.h" 23 #include "vm/native_arguments.h"
24 #include "vm/native_entry.h" 24 #include "vm/native_entry.h"
25 #include "vm/native_symbol.h" 25 #include "vm/native_symbol.h"
26 #include "vm/object.h" 26 #include "vm/object.h"
27 #include "vm/object_graph.h" 27 #include "vm/object_graph.h"
28 #include "vm/object_id_ring.h" 28 #include "vm/object_id_ring.h"
29 #include "vm/object_store.h" 29 #include "vm/object_store.h"
30 #include "vm/parser.h" 30 #include "vm/parser.h"
31 #include "vm/port.h" 31 #include "vm/port.h"
32 #include "vm/profiler.h"
32 #include "vm/profiler_service.h" 33 #include "vm/profiler_service.h"
33 #include "vm/reusable_handles.h" 34 #include "vm/reusable_handles.h"
34 #include "vm/safepoint.h" 35 #include "vm/safepoint.h"
35 #include "vm/service_event.h" 36 #include "vm/service_event.h"
36 #include "vm/service_isolate.h" 37 #include "vm/service_isolate.h"
37 #include "vm/source_report.h" 38 #include "vm/source_report.h"
38 #include "vm/stack_frame.h" 39 #include "vm/stack_frame.h"
39 #include "vm/symbols.h" 40 #include "vm/symbols.h"
40 #include "vm/timeline.h" 41 #include "vm/timeline.h"
41 #include "vm/type_table.h" 42 #include "vm/type_table.h"
(...skipping 3072 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 // the service isolate directly, but would require some special case 3115 // the service isolate directly, but would require some special case
3115 // code. That would prevent this isolate getting double-interrupted 3116 // code. That would prevent this isolate getting double-interrupted
3116 // with OOB messages. 3117 // with OOB messages.
3117 Isolate* isolate = thread->isolate(); 3118 Isolate* isolate = thread->isolate();
3118 isolate->SendInternalLibMessage(Isolate::kInterruptMsg, 3119 isolate->SendInternalLibMessage(Isolate::kInterruptMsg,
3119 isolate->pause_capability()); 3120 isolate->pause_capability());
3120 PrintSuccess(js); 3121 PrintSuccess(js);
3121 return true; 3122 return true;
3122 } 3123 }
3123 3124
3125 static const MethodParameter* enable_profiler_params[] = {
3126 NULL,
3127 };
3128
3129 static bool EnableProfiler(Thread* thread, JSONStream* js) {
3130 Profiler::EnsureEnabled();
3131 PrintSuccess(js);
3132 return true;
3133 }
3134
3124 static const MethodParameter* get_tag_profile_params[] = { 3135 static const MethodParameter* get_tag_profile_params[] = {
3125 RUNNABLE_ISOLATE_PARAMETER, NULL, 3136 RUNNABLE_ISOLATE_PARAMETER, NULL,
3126 }; 3137 };
3127 3138
3128 static bool GetTagProfile(Thread* thread, JSONStream* js) { 3139 static bool GetTagProfile(Thread* thread, JSONStream* js) {
3129 JSONObject miniProfile(js); 3140 JSONObject miniProfile(js);
3130 miniProfile.AddProperty("type", "TagProfile"); 3141 miniProfile.AddProperty("type", "TagProfile");
3131 thread->isolate()->vm_tag_counters()->PrintToJSONObject(&miniProfile); 3142 thread->isolate()->vm_tag_counters()->PrintToJSONObject(&miniProfile);
3132 return true; 3143 return true;
3133 } 3144 }
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
4015 { "addBreakpointWithScriptUri", AddBreakpointWithScriptUri, 4026 { "addBreakpointWithScriptUri", AddBreakpointWithScriptUri,
4016 add_breakpoint_with_script_uri_params }, 4027 add_breakpoint_with_script_uri_params },
4017 { "addBreakpointAtEntry", AddBreakpointAtEntry, 4028 { "addBreakpointAtEntry", AddBreakpointAtEntry,
4018 add_breakpoint_at_entry_params }, 4029 add_breakpoint_at_entry_params },
4019 { "_addBreakpointAtActivation", AddBreakpointAtActivation, 4030 { "_addBreakpointAtActivation", AddBreakpointAtActivation,
4020 add_breakpoint_at_activation_params }, 4031 add_breakpoint_at_activation_params },
4021 { "_clearCpuProfile", ClearCpuProfile, 4032 { "_clearCpuProfile", ClearCpuProfile,
4022 clear_cpu_profile_params }, 4033 clear_cpu_profile_params },
4023 { "_clearVMTimeline", ClearVMTimeline, 4034 { "_clearVMTimeline", ClearVMTimeline,
4024 clear_vm_timeline_params, }, 4035 clear_vm_timeline_params, },
4036 { "_enableProfiler", EnableProfiler,
4037 enable_profiler_params, },
4025 { "evaluate", Evaluate, 4038 { "evaluate", Evaluate,
4026 evaluate_params }, 4039 evaluate_params },
4027 { "evaluateInFrame", EvaluateInFrame, 4040 { "evaluateInFrame", EvaluateInFrame,
4028 evaluate_in_frame_params }, 4041 evaluate_in_frame_params },
4029 { "_getAllocationProfile", GetAllocationProfile, 4042 { "_getAllocationProfile", GetAllocationProfile,
4030 get_allocation_profile_params }, 4043 get_allocation_profile_params },
4031 { "_getAllocationSamples", GetAllocationSamples, 4044 { "_getAllocationSamples", GetAllocationSamples,
4032 get_allocation_samples_params }, 4045 get_allocation_samples_params },
4033 { "_getNativeAllocationSamples", GetNativeAllocationSamples, 4046 { "_getNativeAllocationSamples", GetNativeAllocationSamples,
4034 get_native_allocation_samples_params }, 4047 get_native_allocation_samples_params },
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
4126 if (strcmp(method_name, method.name) == 0) { 4139 if (strcmp(method_name, method.name) == 0) {
4127 return &method; 4140 return &method;
4128 } 4141 }
4129 } 4142 }
4130 return NULL; 4143 return NULL;
4131 } 4144 }
4132 4145
4133 #endif // !PRODUCT 4146 #endif // !PRODUCT
4134 4147
4135 } // namespace dart 4148 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698