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

Side by Side Diff: runtime/vm/service.cc

Issue 2992893002: Reapply "[vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, … (Closed)
Patch Set: native symbol resolver 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
« no previous file with comments | « runtime/vm/program_visitor.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 if (!FLAG_profiler) {
3131 FLAG_profiler = true;
3132 Profiler::InitOnce();
3133 }
3134 PrintSuccess(js);
3135 return true;
3136 }
3137
3124 static const MethodParameter* get_tag_profile_params[] = { 3138 static const MethodParameter* get_tag_profile_params[] = {
3125 RUNNABLE_ISOLATE_PARAMETER, NULL, 3139 RUNNABLE_ISOLATE_PARAMETER, NULL,
3126 }; 3140 };
3127 3141
3128 static bool GetTagProfile(Thread* thread, JSONStream* js) { 3142 static bool GetTagProfile(Thread* thread, JSONStream* js) {
3129 JSONObject miniProfile(js); 3143 JSONObject miniProfile(js);
3130 miniProfile.AddProperty("type", "TagProfile"); 3144 miniProfile.AddProperty("type", "TagProfile");
3131 thread->isolate()->vm_tag_counters()->PrintToJSONObject(&miniProfile); 3145 thread->isolate()->vm_tag_counters()->PrintToJSONObject(&miniProfile);
3132 return true; 3146 return true;
3133 } 3147 }
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
4015 { "addBreakpointWithScriptUri", AddBreakpointWithScriptUri, 4029 { "addBreakpointWithScriptUri", AddBreakpointWithScriptUri,
4016 add_breakpoint_with_script_uri_params }, 4030 add_breakpoint_with_script_uri_params },
4017 { "addBreakpointAtEntry", AddBreakpointAtEntry, 4031 { "addBreakpointAtEntry", AddBreakpointAtEntry,
4018 add_breakpoint_at_entry_params }, 4032 add_breakpoint_at_entry_params },
4019 { "_addBreakpointAtActivation", AddBreakpointAtActivation, 4033 { "_addBreakpointAtActivation", AddBreakpointAtActivation,
4020 add_breakpoint_at_activation_params }, 4034 add_breakpoint_at_activation_params },
4021 { "_clearCpuProfile", ClearCpuProfile, 4035 { "_clearCpuProfile", ClearCpuProfile,
4022 clear_cpu_profile_params }, 4036 clear_cpu_profile_params },
4023 { "_clearVMTimeline", ClearVMTimeline, 4037 { "_clearVMTimeline", ClearVMTimeline,
4024 clear_vm_timeline_params, }, 4038 clear_vm_timeline_params, },
4039 { "_enableProfiler", EnableProfiler,
4040 enable_profiler_params, },
4025 { "evaluate", Evaluate, 4041 { "evaluate", Evaluate,
4026 evaluate_params }, 4042 evaluate_params },
4027 { "evaluateInFrame", EvaluateInFrame, 4043 { "evaluateInFrame", EvaluateInFrame,
4028 evaluate_in_frame_params }, 4044 evaluate_in_frame_params },
4029 { "_getAllocationProfile", GetAllocationProfile, 4045 { "_getAllocationProfile", GetAllocationProfile,
4030 get_allocation_profile_params }, 4046 get_allocation_profile_params },
4031 { "_getAllocationSamples", GetAllocationSamples, 4047 { "_getAllocationSamples", GetAllocationSamples,
4032 get_allocation_samples_params }, 4048 get_allocation_samples_params },
4033 { "_getNativeAllocationSamples", GetNativeAllocationSamples, 4049 { "_getNativeAllocationSamples", GetNativeAllocationSamples,
4034 get_native_allocation_samples_params }, 4050 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) { 4142 if (strcmp(method_name, method.name) == 0) {
4127 return &method; 4143 return &method;
4128 } 4144 }
4129 } 4145 }
4130 return NULL; 4146 return NULL;
4131 } 4147 }
4132 4148
4133 #endif // !PRODUCT 4149 #endif // !PRODUCT
4134 4150
4135 } // namespace dart 4151 } // namespace dart
OLDNEW
« 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