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/atomic-utils.h" | 10 #include "src/base/atomic-utils.h" |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 RuntimeCallTimer* current_timer() { return current_timer_.Value(); } | 846 RuntimeCallTimer* current_timer() { return current_timer_.Value(); } |
847 bool InUse() { return in_use_; } | 847 bool InUse() { return in_use_; } |
848 | 848 |
849 private: | 849 private: |
850 // Counter to track recursive time events. | 850 // Counter to track recursive time events. |
851 base::AtomicValue<RuntimeCallTimer*> current_timer_; | 851 base::AtomicValue<RuntimeCallTimer*> current_timer_; |
852 // Used to track nested tracing scopes. | 852 // Used to track nested tracing scopes. |
853 bool in_use_; | 853 bool in_use_; |
854 }; | 854 }; |
855 | 855 |
856 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ | 856 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ |
857 do { \ | 857 do { \ |
858 if (V8_UNLIKELY(FLAG_runtime_stats)) { \ | 858 if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() || \ |
859 RuntimeCallStats::CorrectCurrentCounterId( \ | 859 FLAG_runtime_call_stats)) { \ |
860 isolate->counters()->runtime_call_stats(), \ | 860 RuntimeCallStats::CorrectCurrentCounterId( \ |
861 &RuntimeCallStats::counter_name); \ | 861 isolate->counters()->runtime_call_stats(), \ |
862 } \ | 862 &RuntimeCallStats::counter_name); \ |
| 863 } \ |
863 } while (false) | 864 } while (false) |
864 | 865 |
865 #define TRACE_HANDLER_STATS(isolate, counter_name) \ | 866 #define TRACE_HANDLER_STATS(isolate, counter_name) \ |
866 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name) | 867 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name) |
867 | 868 |
868 #define HISTOGRAM_RANGE_LIST(HR) \ | 869 #define HISTOGRAM_RANGE_LIST(HR) \ |
869 /* Generic range histograms */ \ | 870 /* Generic range histograms */ \ |
870 HR(detached_context_age_in_gc, V8.DetachedContextAgeInGC, 0, 20, 21) \ | 871 HR(detached_context_age_in_gc, V8.DetachedContextAgeInGC, 0, 20, 21) \ |
871 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \ | 872 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \ |
872 HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \ | 873 HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \ |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 } | 1304 } |
1304 | 1305 |
1305 Isolate* isolate_ = nullptr; | 1306 Isolate* isolate_ = nullptr; |
1306 RuntimeCallTimer timer_; | 1307 RuntimeCallTimer timer_; |
1307 }; | 1308 }; |
1308 | 1309 |
1309 } // namespace internal | 1310 } // namespace internal |
1310 } // namespace v8 | 1311 } // namespace v8 |
1311 | 1312 |
1312 #endif // V8_COUNTERS_H_ | 1313 #endif // V8_COUNTERS_H_ |
OLD | NEW |