Chromium Code Reviews| Index: runtime/vm/service.cc |
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
| index c456fee51e9516a6f5088e970b5e4f7e47cf6322..7f753ba740ce0b00bea01c18b484364d952fed0a 100644 |
| --- a/runtime/vm/service.cc |
| +++ b/runtime/vm/service.cc |
| @@ -3228,6 +3228,28 @@ static bool GetAllocationSamples(Thread* thread, JSONStream* js) { |
| } |
| +static const MethodParameter* get_native_allocation_samples_params[] = { |
| + RUNNABLE_ISOLATE_PARAMETER, |
|
Cutch
2017/02/21 18:53:35
DO we want this to be a vm-level service request?
bkonyi
2017/02/22 19:12:51
Done.
|
| + new EnumParameter("tags", true, tags_enum_names), |
| + new Int64Parameter("timeOriginMicros", false), |
| + new Int64Parameter("timeExtentMicros", false), |
| + NULL, |
| +}; |
| + |
| + |
| +static bool GetNativeAllocationSamples(Thread* thread, JSONStream* js) { |
| + Profile::TagOrder tag_order = |
| + EnumMapper(js->LookupParam("tags"), tags_enum_names, tags_enum_values); |
| + int64_t time_origin_micros = |
| + Int64Parameter::Parse(js->LookupParam("timeOriginMicros")); |
| + int64_t time_extent_micros = |
| + Int64Parameter::Parse(js->LookupParam("timeExtentMicros")); |
| + ProfilerService::PrintNativeAllocationJSON(js, tag_order, time_origin_micros, |
| + time_extent_micros); |
| + return true; |
| +} |
| + |
| + |
| static const MethodParameter* clear_cpu_profile_params[] = { |
| RUNNABLE_ISOLATE_PARAMETER, NULL, |
| }; |
| @@ -4050,6 +4072,8 @@ static const ServiceMethodDescriptor service_methods_[] = { |
| get_allocation_profile_params }, |
| { "_getAllocationSamples", GetAllocationSamples, |
| get_allocation_samples_params }, |
| + { "_getNativeAllocationSamples", GetNativeAllocationSamples, |
| + get_native_allocation_samples_params }, |
| { "getClassList", GetClassList, |
| get_class_list_params }, |
| { "_getCpuProfile", GetCpuProfile, |