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

Unified Diff: src/counters.cc

Issue 2457523002: [Tracing] Fix inaccurate timer calculation in runtime statistics. (Closed)
Patch Set: Address cbruni's comments Created 4 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 | « src/counters.h ('k') | src/tracing/trace-event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.cc
diff --git a/src/counters.cc b/src/counters.cc
index 8fcfd541411d433911bf2003d4ce46d8535ff873..ec66d885fda70fcd119cfa46f3e542769e17f93f 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -316,6 +316,9 @@ void RuntimeCallStats::CorrectCurrentCounterId(RuntimeCallStats* stats,
void RuntimeCallStats::Print(std::ostream& os) {
RuntimeCallStatEntries entries;
+ if (current_timer_ != NULL) {
+ current_timer_->Elapsed();
+ }
#define PRINT_COUNTER(name) entries.Add(&this->name);
FOR_EACH_MANUAL_COUNTER(PRINT_COUNTER)
@@ -368,6 +371,9 @@ void RuntimeCallStats::Reset() {
}
void RuntimeCallStats::Dump(v8::tracing::TracedValue* value) {
+ if (current_timer_ != NULL) {
+ current_timer_->Elapsed();
+ }
#define DUMP_COUNTER(name) \
if (this->name.count > 0) this->name.Dump(value);
FOR_EACH_MANUAL_COUNTER(DUMP_COUNTER)
« no previous file with comments | « src/counters.h ('k') | src/tracing/trace-event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698