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

Side by Side Diff: src/counters.h

Issue 2460973003: [Tracing] Use TracingCategoryObserver in runtime statistics (Closed)
Patch Set: address cbruni's comments Created 4 years, 1 month 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
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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 RuntimeCallTimer* current_timer() { return current_timer_; } 827 RuntimeCallTimer* current_timer() { return current_timer_; }
828 bool InUse() { return in_use_; } 828 bool InUse() { return in_use_; }
829 829
830 private: 830 private:
831 // Counter to track recursive time events. 831 // Counter to track recursive time events.
832 RuntimeCallTimer* current_timer_ = NULL; 832 RuntimeCallTimer* current_timer_ = NULL;
833 // Used to track nested tracing scopes. 833 // Used to track nested tracing scopes.
834 bool in_use_; 834 bool in_use_;
835 }; 835 };
836 836
837 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ 837 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \
838 do { \ 838 do { \
839 if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() || \ 839 if (V8_UNLIKELY(FLAG_runtime_stats)) { \
840 FLAG_runtime_call_stats)) { \ 840 RuntimeCallStats::CorrectCurrentCounterId( \
841 RuntimeCallStats::CorrectCurrentCounterId( \ 841 isolate->counters()->runtime_call_stats(), \
842 isolate->counters()->runtime_call_stats(), \ 842 &RuntimeCallStats::counter_name); \
843 &RuntimeCallStats::counter_name); \ 843 } \
844 } \
845 } while (false) 844 } while (false)
846 845
847 #define TRACE_HANDLER_STATS(isolate, counter_name) \ 846 #define TRACE_HANDLER_STATS(isolate, counter_name) \
848 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name) 847 TRACE_RUNTIME_CALL_STATS(isolate, Handler_##counter_name)
849 848
850 #define HISTOGRAM_RANGE_LIST(HR) \ 849 #define HISTOGRAM_RANGE_LIST(HR) \
851 /* Generic range histograms */ \ 850 /* Generic range histograms */ \
852 HR(detached_context_age_in_gc, V8.DetachedContextAgeInGC, 0, 20, 21) \ 851 HR(detached_context_age_in_gc, V8.DetachedContextAgeInGC, 0, 20, 21) \
853 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \ 852 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \
854 HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \ 853 HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 } 1284 }
1286 1285
1287 Isolate* isolate_ = nullptr; 1286 Isolate* isolate_ = nullptr;
1288 RuntimeCallTimer timer_; 1287 RuntimeCallTimer timer_;
1289 }; 1288 };
1290 1289
1291 } // namespace internal 1290 } // namespace internal
1292 } // namespace v8 1291 } // namespace v8
1293 1292
1294 #endif // V8_COUNTERS_H_ 1293 #endif // V8_COUNTERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698