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

Unified Diff: runtime/vm/timeline.cc

Issue 1386263002: Add support to timeline for begin and end events (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « runtime/vm/timeline.h ('k') | runtime/vm/timeline_analysis.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « runtime/vm/timeline.h ('k') | runtime/vm/timeline_analysis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698