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

Unified Diff: runtime/vm/profiler.cc

Issue 192443004: Complete the switch to ServiceObject (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/profiler.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 53bc048a4929fc32cbcdf0efda1d52ff045e668b..9eb125e0ed3d05c0beca8b121758f3219cb13ee6 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -342,6 +342,15 @@ class CodeRegion : public ZoneAllocated {
obj.AddPropertyF("start", "%" Px "", start());
obj.AddPropertyF("end", "%" Px "", end());
obj.AddPropertyF("id", "code/native/%" Px "", start());
+ {
+ // Generate a fake function entry.
+ JSONObject func(&obj, "function");
+ func.AddProperty("type", "@Function");
+ func.AddPropertyF("id", "native/functions/%" Pd "", start());
+ func.AddProperty("name", name());
+ func.AddProperty("user_name", name());
+ func.AddProperty("kind", "Native");
+ }
}
void PrintCollectedCode(JSONObject* profile_code_obj) {
@@ -354,6 +363,15 @@ class CodeRegion : public ZoneAllocated {
obj.AddPropertyF("start", "%" Px "", start());
obj.AddPropertyF("end", "%" Px "", end());
obj.AddPropertyF("id", "code/collected/%" Px "", start());
+ {
+ // Generate a fake function entry.
+ JSONObject func(&obj, "function");
+ func.AddProperty("type", "@Function");
+ func.AddPropertyF("id", "collected/functions/%" Pd "", start());
+ func.AddProperty("name", name());
+ func.AddProperty("user_name", name());
+ func.AddProperty("kind", "Collected");
+ }
}
void PrintToJSONArray(Isolate* isolate, JSONArray* events, bool full) {
@@ -824,6 +842,7 @@ void Profiler::PrintToJSONStream(Isolate* isolate, JSONStream* stream,
// Serialize to JSON.
JSONObject obj(stream);
obj.AddProperty("type", "Profile");
+ obj.AddProperty("id", "profile");
obj.AddProperty("samples", samples);
obj.AddProperty("time_delta_micros", builder.TimeDeltaMicros());
JSONArray codes(&obj, "codes");
« runtime/vm/json_stream.cc ('K') | « runtime/vm/object.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698