| 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
|
|
|