| OLD | NEW |
| 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 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2610 static bool GetVMTimeline(Thread* thread, JSONStream* js) { | 2610 static bool GetVMTimeline(Thread* thread, JSONStream* js) { |
| 2611 Isolate* isolate = thread->isolate(); | 2611 Isolate* isolate = thread->isolate(); |
| 2612 ASSERT(isolate != NULL); | 2612 ASSERT(isolate != NULL); |
| 2613 StackZone zone(thread); | 2613 StackZone zone(thread); |
| 2614 Timeline::ReclaimCachedBlocksFromThreads(); | 2614 Timeline::ReclaimCachedBlocksFromThreads(); |
| 2615 TimelineEventRecorder* timeline_recorder = Timeline::recorder(); | 2615 TimelineEventRecorder* timeline_recorder = Timeline::recorder(); |
| 2616 // TODO(johnmccutchan): Return an error. | 2616 // TODO(johnmccutchan): Return an error. |
| 2617 ASSERT(timeline_recorder != NULL); | 2617 ASSERT(timeline_recorder != NULL); |
| 2618 TimelineEventFilter filter; | 2618 TimelineEventFilter filter; |
| 2619 timeline_recorder->PrintJSON(js, &filter); | 2619 timeline_recorder->PrintJSON(js, &filter); |
| 2620 | |
| 2621 return true; | 2620 return true; |
| 2622 } | 2621 } |
| 2623 | 2622 |
| 2624 | 2623 |
| 2625 static const MethodParameter* resume_params[] = { | 2624 static const MethodParameter* resume_params[] = { |
| 2626 ISOLATE_PARAMETER, | 2625 ISOLATE_PARAMETER, |
| 2627 NULL, | 2626 NULL, |
| 2628 }; | 2627 }; |
| 2629 | 2628 |
| 2630 | 2629 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2742 EnumMapper(js->LookupParam("tags"), tags_enum_names, tags_enum_values); | 2741 EnumMapper(js->LookupParam("tags"), tags_enum_names, tags_enum_values); |
| 2743 intptr_t extra_tags = 0; | 2742 intptr_t extra_tags = 0; |
| 2744 if (BoolParameter::Parse(js->LookupParam("_codeTransitionTags"))) { | 2743 if (BoolParameter::Parse(js->LookupParam("_codeTransitionTags"))) { |
| 2745 extra_tags |= ProfilerService::kCodeTransitionTagsBit; | 2744 extra_tags |= ProfilerService::kCodeTransitionTagsBit; |
| 2746 } | 2745 } |
| 2747 ProfilerService::PrintJSON(js, tag_order, extra_tags); | 2746 ProfilerService::PrintJSON(js, tag_order, extra_tags); |
| 2748 return true; | 2747 return true; |
| 2749 } | 2748 } |
| 2750 | 2749 |
| 2751 | 2750 |
| 2751 static const MethodParameter* get_cpu_profile_timeline_params[] = { |
| 2752 ISOLATE_PARAMETER, |
| 2753 new EnumParameter("tags", true, tags_enum_names), |
| 2754 NULL, |
| 2755 }; |
| 2756 |
| 2757 |
| 2758 static bool GetCpuProfileTimeline(Thread* thread, JSONStream* js) { |
| 2759 Profile::TagOrder tag_order = |
| 2760 EnumMapper(js->LookupParam("tags"), tags_enum_names, tags_enum_values); |
| 2761 ProfilerService::PrintTimelineJSON(js, tag_order); |
| 2762 return true; |
| 2763 } |
| 2764 |
| 2765 |
| 2752 static const MethodParameter* get_allocation_samples_params[] = { | 2766 static const MethodParameter* get_allocation_samples_params[] = { |
| 2753 ISOLATE_PARAMETER, | 2767 ISOLATE_PARAMETER, |
| 2754 new EnumParameter("tags", true, tags_enum_names), | 2768 new EnumParameter("tags", true, tags_enum_names), |
| 2755 new IdParameter("classId", false), | 2769 new IdParameter("classId", false), |
| 2756 NULL, | 2770 NULL, |
| 2757 }; | 2771 }; |
| 2758 | 2772 |
| 2759 | 2773 |
| 2760 static bool GetAllocationSamples(Thread* thread, JSONStream* js) { | 2774 static bool GetAllocationSamples(Thread* thread, JSONStream* js) { |
| 2761 Profile::TagOrder tag_order = | 2775 Profile::TagOrder tag_order = |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3474 { "_getAllocationSamples", GetAllocationSamples, | 3488 { "_getAllocationSamples", GetAllocationSamples, |
| 3475 get_allocation_samples_params }, | 3489 get_allocation_samples_params }, |
| 3476 { "_getCallSiteData", GetCallSiteData, | 3490 { "_getCallSiteData", GetCallSiteData, |
| 3477 get_call_site_data_params }, | 3491 get_call_site_data_params }, |
| 3478 { "getClassList", GetClassList, | 3492 { "getClassList", GetClassList, |
| 3479 get_class_list_params }, | 3493 get_class_list_params }, |
| 3480 { "_getCoverage", GetCoverage, | 3494 { "_getCoverage", GetCoverage, |
| 3481 get_coverage_params }, | 3495 get_coverage_params }, |
| 3482 { "_getCpuProfile", GetCpuProfile, | 3496 { "_getCpuProfile", GetCpuProfile, |
| 3483 get_cpu_profile_params }, | 3497 get_cpu_profile_params }, |
| 3498 { "_getCpuProfileTimeline", GetCpuProfileTimeline, |
| 3499 get_cpu_profile_timeline_params }, |
| 3484 { "getFlagList", GetFlagList, | 3500 { "getFlagList", GetFlagList, |
| 3485 get_flag_list_params }, | 3501 get_flag_list_params }, |
| 3486 { "_getHeapMap", GetHeapMap, | 3502 { "_getHeapMap", GetHeapMap, |
| 3487 get_heap_map_params }, | 3503 get_heap_map_params }, |
| 3488 { "_getInboundReferences", GetInboundReferences, | 3504 { "_getInboundReferences", GetInboundReferences, |
| 3489 get_inbound_references_params }, | 3505 get_inbound_references_params }, |
| 3490 { "_getInstances", GetInstances, | 3506 { "_getInstances", GetInstances, |
| 3491 get_instances_params }, | 3507 get_instances_params }, |
| 3492 { "getIsolate", GetIsolate, | 3508 { "getIsolate", GetIsolate, |
| 3493 get_isolate_params }, | 3509 get_isolate_params }, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3559 const ServiceMethodDescriptor& method = service_methods_[i]; | 3575 const ServiceMethodDescriptor& method = service_methods_[i]; |
| 3560 if (strcmp(method_name, method.name) == 0) { | 3576 if (strcmp(method_name, method.name) == 0) { |
| 3561 return &method; | 3577 return &method; |
| 3562 } | 3578 } |
| 3563 } | 3579 } |
| 3564 return NULL; | 3580 return NULL; |
| 3565 } | 3581 } |
| 3566 | 3582 |
| 3567 | 3583 |
| 3568 } // namespace dart | 3584 } // namespace dart |
| OLD | NEW |