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

Unified Diff: runtime/vm/timeline.cc

Issue 1367973004: Make timeline use the same clock source as mojo's tracing infrastructure (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/os_win.cc ('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 b830a74ca5eb08522cac09284925bfcd00284aaa..d55a8dcd9b6ff949ade135d668c4213168268963 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -210,7 +210,7 @@ void TimelineEvent::Reset() {
void TimelineEvent::AsyncBegin(const char* label, int64_t async_id) {
Init(kAsyncBegin, label);
- timestamp0_ = OS::GetCurrentTimeMicros();
+ timestamp0_ = OS::GetCurrentTraceMicros();
// Overload timestamp1_ with the async_id.
timestamp1_ = async_id;
}
@@ -219,7 +219,7 @@ void TimelineEvent::AsyncBegin(const char* label, int64_t async_id) {
void TimelineEvent::AsyncInstant(const char* label,
int64_t async_id) {
Init(kAsyncInstant, label);
- timestamp0_ = OS::GetCurrentTimeMicros();
+ timestamp0_ = OS::GetCurrentTraceMicros();
// Overload timestamp1_ with the async_id.
timestamp1_ = async_id;
}
@@ -228,7 +228,7 @@ void TimelineEvent::AsyncInstant(const char* label,
void TimelineEvent::AsyncEnd(const char* label,
int64_t async_id) {
Init(kAsyncEnd, label);
- timestamp0_ = OS::GetCurrentTimeMicros();
+ timestamp0_ = OS::GetCurrentTraceMicros();
// Overload timestamp1_ with the async_id.
timestamp1_ = async_id;
}
@@ -236,18 +236,18 @@ void TimelineEvent::AsyncEnd(const char* label,
void TimelineEvent::DurationBegin(const char* label) {
Init(kDuration, label);
- timestamp0_ = OS::GetCurrentTimeMicros();
+ timestamp0_ = OS::GetCurrentTraceMicros();
}
void TimelineEvent::DurationEnd() {
- timestamp1_ = OS::GetCurrentTimeMicros();
+ timestamp1_ = OS::GetCurrentTraceMicros();
}
void TimelineEvent::Instant(const char* label) {
Init(kInstant, label);
- timestamp0_ = OS::GetCurrentTimeMicros();
+ timestamp0_ = OS::GetCurrentTraceMicros();
}
@@ -355,12 +355,12 @@ void TimelineEvent::PrintJSON(JSONStream* stream) const {
obj.AddProperty("cat", category_);
obj.AddProperty64("tid", tid);
obj.AddProperty64("pid", pid);
- obj.AddPropertyTimeMillis("ts", TimeOrigin());
+ obj.AddPropertyTimeMicros("ts", TimeOrigin());
switch (event_type()) {
case kDuration: {
obj.AddProperty("ph", "X");
- obj.AddPropertyTimeMillis("dur", TimeDuration());
+ obj.AddPropertyTimeMicros("dur", TimeDuration());
}
break;
case kInstant: {
@@ -409,7 +409,7 @@ int64_t TimelineEvent::AsyncId() const {
int64_t TimelineEvent::TimeDuration() const {
if (timestamp1_ == 0) {
// This duration is still open, use current time as end.
- return OS::GetCurrentTimeMicros() - timestamp0_;
+ return OS::GetCurrentTraceMicros() - timestamp0_;
}
return timestamp1_ - timestamp0_;
}
« no previous file with comments | « runtime/vm/os_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698