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

Unified Diff: runtime/vm/trace_buffer.cc

Issue 227423005: Add TraceBuffer log to all Functions (plus small tweaks to function-view) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
« runtime/vm/object.cc ('K') | « runtime/vm/trace_buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/trace_buffer.cc
diff --git a/runtime/vm/trace_buffer.cc b/runtime/vm/trace_buffer.cc
index 831e95d6abd74a5d45a79d9ff3a807a25fb9f004..50772b1f38c7e9694954d60a50ae0b97515978bd 100644
--- a/runtime/vm/trace_buffer.cc
+++ b/runtime/vm/trace_buffer.cc
@@ -83,11 +83,11 @@ void TraceBuffer::TraceF(const char* format, ...) {
}
-void TraceBuffer::PrintToJSONStream(JSONStream* stream) const {
- JSONObject json_trace_buffer(stream);
- json_trace_buffer.AddProperty("type", "TraceBuffer");
+void TraceBuffer::PrintToJSONObject(JSONObject* json_trace_buffer) const {
+ json_trace_buffer->AddProperty("type", "TraceBuffer");
+ json_trace_buffer->AddProperty("id", "");
// TODO(johnmccutchan): Send cursor position in response.
- JSONArray json_trace_buffer_array(&json_trace_buffer, "members");
+ JSONArray json_trace_buffer_array(json_trace_buffer, "members");
// Scan forward until we find the first entry which isn't empty.
// TODO(johnmccutchan): Accept cursor start position as input.
intptr_t start = -1;
@@ -111,11 +111,18 @@ void TraceBuffer::PrintToJSONStream(JSONStream* stream) const {
}
JSONObject trace_entry(&json_trace_buffer_array);
trace_entry.AddProperty("type", "TraceBufferEntry");
- double seconds = static_cast<double>(entry.micros) /
- static_cast<double>(kMicrosecondsPerSecond);
- trace_entry.AddProperty("time", seconds);
+ trace_entry.AddProperty("id", "");
+ intptr_t millis =
+ static_cast<intptr_t>(entry.micros / kMicrosecondsPerMillisecond);
+ trace_entry.AddProperty("time", millis);
trace_entry.AddProperty("message", entry.message);
}
}
+
+void TraceBuffer::PrintToJSONStream(JSONStream* stream) const {
+ JSONObject json_trace_buffer(stream);
+ PrintToJSONObject(&json_trace_buffer);
+}
+
} // namespace dart
« runtime/vm/object.cc ('K') | « runtime/vm/trace_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698