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

Side by Side Diff: src/counters.h

Issue 2221853002: Revert of [Tracing] Embed V8 runtime call stats into tracing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/counters.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COUNTERS_H_ 5 #ifndef V8_COUNTERS_H_
6 #define V8_COUNTERS_H_ 6 #define V8_COUNTERS_H_
7 7
8 #include "include/v8.h" 8 #include "include/v8.h"
9 #include "src/allocation.h" 9 #include "src/allocation.h"
10 #include "src/base/platform/elapsed-timer.h" 10 #include "src/base/platform/elapsed-timer.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 // The aggregate_value_ is the average for [start_ms_; last_ms_]. 475 // The aggregate_value_ is the average for [start_ms_; last_ms_].
476 // The value is the average for [last_ms_; current_ms]. 476 // The value is the average for [last_ms_; current_ms].
477 // Return the weighted average of the aggregate_value_ and the value. 477 // Return the weighted average of the aggregate_value_ and the value.
478 return aggregate_value_ * ((last_ms_ - start_ms_) / interval_ms) + 478 return aggregate_value_ * ((last_ms_ - start_ms_) / interval_ms) +
479 value * ((current_ms - last_ms_) / interval_ms); 479 value * ((current_ms - last_ms_) / interval_ms);
480 } 480 }
481 481
482 struct RuntimeCallCounter { 482 struct RuntimeCallCounter {
483 explicit RuntimeCallCounter(const char* name) : name(name) {} 483 explicit RuntimeCallCounter(const char* name) : name(name) {}
484 void Reset(); 484 void Reset();
485 V8_NOINLINE void Dump(std::stringstream& out);
486 485
487 const char* name; 486 const char* name;
488 int64_t count = 0; 487 int64_t count = 0;
489 base::TimeDelta time; 488 base::TimeDelta time;
490 }; 489 };
491 490
492 // RuntimeCallTimer is used to keep track of the stack of currently active 491 // RuntimeCallTimer is used to keep track of the stack of currently active
493 // timers used for properly measuring the own time of a RuntimeCallCounter. 492 // timers used for properly measuring the own time of a RuntimeCallCounter.
494 class RuntimeCallTimer { 493 class RuntimeCallTimer {
495 public: 494 public:
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 1234
1236 explicit Counters(Isolate* isolate); 1235 explicit Counters(Isolate* isolate);
1237 1236
1238 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); 1237 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters);
1239 }; 1238 };
1240 1239
1241 } // namespace internal 1240 } // namespace internal
1242 } // namespace v8 1241 } // namespace v8
1243 1242
1244 #endif // V8_COUNTERS_H_ 1243 #endif // V8_COUNTERS_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698