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

Unified Diff: runtime/vm/service.cc

Issue 2680213002: Updated MallocHooks to collect stack traces when memory is allocated. (Closed)
Patch Set: Added tests and modified stack walker to allow for skipping an arbitrary number of frames before co… Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 66c7abec3ac3f98a02ec7d45f701cbc9db47a488..44a9ca9c8e4cd391955773106dce4e22547650df 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -3215,6 +3215,28 @@ static bool GetAllocationSamples(Thread* thread, JSONStream* js) {
}
+static const MethodParameter* get_native_allocation_samples_params[] = {
+ RUNNABLE_ISOLATE_PARAMETER,
+ 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,
};
@@ -4041,6 +4063,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,

Powered by Google App Engine
This is Rietveld 408576698