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

Unified Diff: runtime/vm/timeline.cc

Issue 1849643002: Add support for async, metadata, and counter timeline events to be reported by the embedder (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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') | no next file » | 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 959b9adb77ba76d1dcc6e7f0a95040e9037ba434..68850be7e7ad1a2e7e1fe5a431c0000487367a7f 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -379,6 +379,18 @@ void TimelineEvent::End(const char* label,
}
+void TimelineEvent::Counter(const char* label, int64_t micros) {
+ Init(kCounter, label);
+ set_timestamp0(micros);
+}
+
+
+void TimelineEvent::Metadata(const char* label, int64_t micros) {
+ Init(kMetadata, label);
+ set_timestamp0(micros);
+}
+
+
void TimelineEvent::CompleteWithPreSerializedJSON(const char* json) {
set_pre_serialized_json(true);
SetNumArguments(1);
@@ -577,6 +589,14 @@ void TimelineEvent::PrintJSON(JSONStream* stream) const {
obj.AddPropertyF("id", "%" Px64 "", AsyncId());
}
break;
+ case kMetadata: {
+ obj.AddProperty("ph", "M");
+ }
+ break;
+ case kCounter: {
+ obj.AddProperty("ph", "C");
+ }
+ break;
default:
UNIMPLEMENTED();
}
« no previous file with comments | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698