OLD | NEW |
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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 777 |
777 RuntimeCallStats() { Reset(); } | 778 RuntimeCallStats() { Reset(); } |
778 | 779 |
779 private: | 780 private: |
780 // Counter to track recursive time events. | 781 // Counter to track recursive time events. |
781 RuntimeCallTimer* current_timer_ = NULL; | 782 RuntimeCallTimer* current_timer_ = NULL; |
782 }; | 783 }; |
783 | 784 |
784 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ | 785 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ |
785 do { \ | 786 do { \ |
| 787 TRACE_RUNTIME_CALL(#counter_name); \ |
786 if (FLAG_runtime_call_stats) { \ | 788 if (FLAG_runtime_call_stats) { \ |
787 RuntimeCallStats::CorrectCurrentCounterId( \ | 789 RuntimeCallStats::CorrectCurrentCounterId( \ |
788 isolate, &RuntimeCallStats::counter_name); \ | 790 isolate, &RuntimeCallStats::counter_name); \ |
789 } \ | 791 } \ |
790 } while (false) | 792 } while (false) |
791 | 793 |
792 #define TRACE_HANDLER_STATS(isolate, counter_name) \ | 794 #define TRACE_HANDLER_STATS(isolate, counter_name) \ |
793 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name) | 795 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name) |
794 | 796 |
795 // A RuntimeCallTimerScopes wraps around a RuntimeCallTimer to measure the | 797 // A RuntimeCallTimerScopes wraps around a RuntimeCallTimer to measure the |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 | 1233 |
1232 explicit Counters(Isolate* isolate); | 1234 explicit Counters(Isolate* isolate); |
1233 | 1235 |
1234 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 1236 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
1235 }; | 1237 }; |
1236 | 1238 |
1237 } // namespace internal | 1239 } // namespace internal |
1238 } // namespace v8 | 1240 } // namespace v8 |
1239 | 1241 |
1240 #endif // V8_COUNTERS_H_ | 1242 #endif // V8_COUNTERS_H_ |
OLD | NEW |