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

Side by Side Diff: src/counters.h

Issue 2063853002: Reland: Add a trace-event for each runtime-stats timer (CL 2052523002) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: The reland fix: Use an atomic variable Created 4 years, 6 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/api-arguments-inl.h ('k') | src/execution.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"
11 #include "src/base/platform/time.h" 11 #include "src/base/platform/time.h"
12 #include "src/builtins.h" 12 #include "src/builtins.h"
13 #include "src/globals.h" 13 #include "src/globals.h"
14 #include "src/objects.h" 14 #include "src/objects.h"
15 #include "src/runtime/runtime.h" 15 #include "src/runtime/runtime.h"
16 #include "src/tracing/trace-event.h"
16 17
17 namespace v8 { 18 namespace v8 {
18 namespace internal { 19 namespace internal {
19 20
20 // StatsCounters is an interface for plugging into external 21 // StatsCounters is an interface for plugging into external
21 // counters for monitoring. Counters can be looked up and 22 // counters for monitoring. Counters can be looked up and
22 // manipulated by name. 23 // manipulated by name.
23 24
24 class StatsTable { 25 class StatsTable {
25 public: 26 public:
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 RuntimeCallStats() { Reset(); } 780 RuntimeCallStats() { Reset(); }
780 RuntimeCallTimer* current_timer() { return current_timer_; } 781 RuntimeCallTimer* current_timer() { return current_timer_; }
781 782
782 private: 783 private:
783 // Counter to track recursive time events. 784 // Counter to track recursive time events.
784 RuntimeCallTimer* current_timer_ = NULL; 785 RuntimeCallTimer* current_timer_ = NULL;
785 }; 786 };
786 787
787 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ 788 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \
788 do { \ 789 do { \
790 TRACE_RUNTIME_CALL(#counter_name); \
789 if (FLAG_runtime_call_stats) { \ 791 if (FLAG_runtime_call_stats) { \
790 RuntimeCallStats::CorrectCurrentCounterId( \ 792 RuntimeCallStats::CorrectCurrentCounterId( \
791 isolate, &RuntimeCallStats::counter_name); \ 793 isolate, &RuntimeCallStats::counter_name); \
792 } \ 794 } \
793 } while (false) 795 } while (false)
794 796
795 #define TRACE_HANDLER_STATS(isolate, counter_name) \ 797 #define TRACE_HANDLER_STATS(isolate, counter_name) \
796 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name) 798 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name)
797 799
798 // A RuntimeCallTimerScopes wraps around a RuntimeCallTimer to measure the 800 // A RuntimeCallTimerScopes wraps around a RuntimeCallTimer to measure the
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 1235
1234 explicit Counters(Isolate* isolate); 1236 explicit Counters(Isolate* isolate);
1235 1237
1236 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); 1238 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters);
1237 }; 1239 };
1238 1240
1239 } // namespace internal 1241 } // namespace internal
1240 } // namespace v8 1242 } // namespace v8
1241 1243
1242 #endif // V8_COUNTERS_H_ 1244 #endif // V8_COUNTERS_H_
OLDNEW
« no previous file with comments | « src/api-arguments-inl.h ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698