Index: runtime/vm/timeline.cc |
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc |
index 1a8536a8c0d5c39832ed1da5c48e5078e336cf64..2fd5167998b8ee85f82238945e9e635f9a5d60fc 100644 |
--- a/runtime/vm/timeline.cc |
+++ b/runtime/vm/timeline.cc |
@@ -260,6 +260,20 @@ void TimelineEvent::Duration(const char* label, |
} |
+void TimelineEvent::Begin(const char* label, |
+ int64_t micros) { |
+ Init(kBegin, label); |
+ timestamp0_ = micros; |
+} |
+ |
+ |
+void TimelineEvent::End(const char* label, |
+ int64_t micros) { |
+ Init(kEnd, label); |
+ timestamp0_ = micros; |
+} |
+ |
+ |
void TimelineEvent::SetNumArguments(intptr_t length) { |
// Cannot call this twice. |
ASSERT(arguments_ == NULL); |
@@ -358,6 +372,14 @@ void TimelineEvent::PrintJSON(JSONStream* stream) const { |
obj.AddPropertyTimeMicros("ts", TimeOrigin()); |
switch (event_type()) { |
+ case kBegin: { |
+ obj.AddProperty("ph", "B"); |
+ } |
+ break; |
+ case kEnd: { |
+ obj.AddProperty("ph", "E"); |
+ } |
+ break; |
case kDuration: { |
obj.AddProperty("ph", "X"); |
obj.AddPropertyTimeMicros("dur", TimeDuration()); |