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

Side by Side Diff: runtime/vm/timeline.cc

Issue 1241683005: Support piping log data over the service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/service_event.cc ('k') | sdk/lib/_internal/js_runtime/lib/developer_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 <cstdlib> 5 #include <cstdlib>
6 6
7 #include "vm/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/json_stream.h" 8 #include "vm/json_stream.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/thread.h" 10 #include "vm/thread.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 191
192 void TimelineEvent::PrintJSON(JSONStream* stream) const { 192 void TimelineEvent::PrintJSON(JSONStream* stream) const {
193 JSONObject obj(stream); 193 JSONObject obj(stream);
194 int64_t pid = GetPid(Isolate::Current()); 194 int64_t pid = GetPid(Isolate::Current());
195 int64_t tid = GetTid(thread_); 195 int64_t tid = GetTid(thread_);
196 obj.AddProperty("name", label_); 196 obj.AddProperty("name", label_);
197 obj.AddProperty("cat", stream_->name()); 197 obj.AddProperty("cat", stream_->name());
198 obj.AddProperty64("tid", tid); 198 obj.AddProperty64("tid", tid);
199 obj.AddProperty64("pid", pid); 199 obj.AddProperty64("pid", pid);
200 obj.AddProperty("ts", static_cast<double>(TimeOrigin())); 200 obj.AddPropertyTimeMillis("ts", TimeOrigin());
201 201
202 switch (event_type()) { 202 switch (event_type()) {
203 case kDuration: { 203 case kDuration: {
204 obj.AddProperty("ph", "X"); 204 obj.AddProperty("ph", "X");
205 obj.AddProperty("dur", static_cast<double>(TimeDuration())); 205 obj.AddPropertyTimeMillis("dur", TimeDuration());
206 } 206 }
207 break; 207 break;
208 case kInstant: { 208 case kInstant: {
209 obj.AddProperty("ph", "i"); 209 obj.AddProperty("ph", "i");
210 obj.AddProperty("s", "p"); 210 obj.AddProperty("s", "p");
211 } 211 }
212 break; 212 break;
213 case kAsyncBegin: { 213 case kAsyncBegin: {
214 obj.AddProperty("ph", "b"); 214 obj.AddProperty("ph", "b");
215 obj.AddPropertyF("id", "%" Px64 "", AsyncId()); 215 obj.AddPropertyF("id", "%" Px64 "", AsyncId());
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 return event; 508 return event;
509 } 509 }
510 510
511 511
512 void TimelineEventStreamingRecorder::CompleteEvent(TimelineEvent* event) { 512 void TimelineEventStreamingRecorder::CompleteEvent(TimelineEvent* event) {
513 StreamEvent(event); 513 StreamEvent(event);
514 delete event; 514 delete event;
515 } 515 }
516 516
517 } // namespace dart 517 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service_event.cc ('k') | sdk/lib/_internal/js_runtime/lib/developer_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698