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

Unified Diff: runtime/vm/profiler_service.cc

Issue 1287033006: Fix time span in profiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/observatory/lib/src/elements/cpu_profile.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 872b6009c3329b0e13850929b30e17ba679c5159..e773e9560f62f79946771ca24f2fc8cf7879b3da 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -1071,6 +1071,13 @@ class ProfileBuilder : public ValueObject {
timestamp > profile_->max_time_ ? timestamp : profile_->max_time_;
}
+ void SanitizeMinMaxTimes() {
+ if ((profile_->min_time_ == kMaxInt64) && (profile_->max_time_ == 0)) {
+ profile_->min_time_ = 0;
+ profile_->max_time_ = 0;
+ }
+ }
+
void BuildCodeTable() {
ScopeTimer sw("ProfileBuilder::BuildCodeTable", FLAG_trace_profiler);
for (intptr_t sample_index = 0;
@@ -1105,6 +1112,7 @@ class ProfileBuilder : public ValueObject {
code->Tick(pc, IsExecutingFrame(sample, frame_index), sample_index);
}
}
+ SanitizeMinMaxTimes();
}
void FinalizeCodeIndexes() {
« no previous file with comments | « runtime/observatory/lib/src/elements/cpu_profile.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698