| Index: runtime/vm/service.cc
|
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
|
| index 404e8d3ee4d3ae1a9a0988f9cb82e293eae56723..f62e38f1698570d8616170358f3b2e6ce1db4a39 100644
|
| --- a/runtime/vm/service.cc
|
| +++ b/runtime/vm/service.cc
|
| @@ -2135,6 +2135,20 @@ static bool GetCpuProfile(Isolate* isolate, JSONStream* js) {
|
| }
|
|
|
|
|
| +static const MethodParameter* clear_cpu_profile_params[] = {
|
| + ISOLATE_PARAMETER,
|
| + NULL,
|
| +};
|
| +
|
| +
|
| +static bool ClearCpuProfile(Isolate* isolate, JSONStream* js) {
|
| + ProfilerService::ClearSamples();
|
| + JSONObject jsobj(js);
|
| + jsobj.AddProperty("type", "Success");
|
| + return true;
|
| +}
|
| +
|
| +
|
| static const MethodParameter* get_allocation_profile_params[] = {
|
| ISOLATE_PARAMETER,
|
| NULL,
|
| @@ -2497,6 +2511,8 @@ static ServiceMethodDescriptor service_methods_[] = {
|
| add_breakpoint_params },
|
| { "addBreakpointAtEntry", AddBreakpointAtEntry,
|
| add_breakpoint_at_entry_params },
|
| + { "clearCpuProfile", ClearCpuProfile,
|
| + clear_cpu_profile_params },
|
| { "eval", Eval,
|
| eval_params },
|
| { "getAllocationProfile", GetAllocationProfile,
|
|
|