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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 V8_INLINE void Initialize(RuntimeCallStats* stats, | 904 V8_INLINE void Initialize(RuntimeCallStats* stats, |
905 RuntimeCallStats::CounterId counter_id) { | 905 RuntimeCallStats::CounterId counter_id) { |
906 stats_ = stats; | 906 stats_ = stats; |
907 RuntimeCallStats::Enter(stats_, &timer_, counter_id); | 907 RuntimeCallStats::Enter(stats_, &timer_, counter_id); |
908 } | 908 } |
909 | 909 |
910 RuntimeCallStats* stats_ = nullptr; | 910 RuntimeCallStats* stats_ = nullptr; |
911 RuntimeCallTimer timer_; | 911 RuntimeCallTimer timer_; |
912 }; | 912 }; |
913 | 913 |
914 #define HISTOGRAM_RANGE_LIST(HR) \ | 914 #define HISTOGRAM_RANGE_LIST(HR) \ |
915 /* Generic range histograms */ \ | 915 /* Generic range histograms */ \ |
916 HR(detached_context_age_in_gc, V8.DetachedContextAgeInGC, 0, 20, 21) \ | 916 HR(detached_context_age_in_gc, V8.DetachedContextAgeInGC, 0, 20, 21) \ |
917 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \ | 917 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \ |
918 HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \ | 918 HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \ |
919 HR(gc_idle_time_limit_undershot, V8.GCIdleTimeLimit.Undershot, 0, 10000, \ | 919 HR(gc_idle_time_limit_undershot, V8.GCIdleTimeLimit.Undershot, 0, 10000, \ |
920 101) \ | 920 101) \ |
921 HR(code_cache_reject_reason, V8.CodeCacheRejectReason, 1, 6, 6) \ | 921 HR(code_cache_reject_reason, V8.CodeCacheRejectReason, 1, 6, 6) \ |
922 HR(errors_thrown_per_context, V8.ErrorsThrownPerContext, 0, 200, 20) \ | 922 HR(errors_thrown_per_context, V8.ErrorsThrownPerContext, 0, 200, 20) \ |
923 HR(debug_feature_usage, V8.DebugFeatureUsage, 1, 7, 7) \ | 923 HR(debug_feature_usage, V8.DebugFeatureUsage, 1, 7, 7) \ |
924 HR(incremental_marking_reason, V8.GCIncrementalMarkingReason, 0, 21, 22) \ | 924 HR(incremental_marking_reason, V8.GCIncrementalMarkingReason, 0, 21, 22) \ |
925 HR(mark_compact_reason, V8.GCMarkCompactReason, 0, 21, 22) \ | 925 HR(mark_compact_reason, V8.GCMarkCompactReason, 0, 21, 22) \ |
926 HR(scavenge_reason, V8.GCScavengeReason, 0, 21, 22) \ | 926 HR(scavenge_reason, V8.GCScavengeReason, 0, 21, 22) \ |
927 HR(young_generation_handling, V8.GCYoungGenerationHandling, 0, 2, 3) \ | 927 HR(young_generation_handling, V8.GCYoungGenerationHandling, 0, 2, 3) \ |
928 /* Asm/Wasm. */ \ | 928 /* Asm/Wasm. */ \ |
929 HR(wasm_functions_per_asm_module, V8.WasmFunctionsPerModule, 1, 10000, 51) \ | 929 HR(wasm_functions_per_asm_module, V8.WasmFunctionsPerModule.asm, 1, 10000, \ |
930 HR(wasm_functions_per_wasm_module, V8.WasmFunctionsPerModule, 1, 10000, 51) | 930 51) \ |
| 931 HR(wasm_functions_per_wasm_module, V8.WasmFunctionsPerModule.wasm, 1, 10000, \ |
| 932 51) |
931 | 933 |
932 #define HISTOGRAM_TIMER_LIST(HT) \ | 934 #define HISTOGRAM_TIMER_LIST(HT) \ |
933 /* Garbage collection timers. */ \ | 935 /* Garbage collection timers. */ \ |
934 HT(gc_compactor, V8.GCCompactor, 10000, MILLISECOND) \ | 936 HT(gc_compactor, V8.GCCompactor, 10000, MILLISECOND) \ |
935 HT(gc_finalize, V8.GCFinalizeMC, 10000, MILLISECOND) \ | 937 HT(gc_finalize, V8.GCFinalizeMC, 10000, MILLISECOND) \ |
936 HT(gc_finalize_reduce_memory, V8.GCFinalizeMCReduceMemory, 10000, \ | 938 HT(gc_finalize_reduce_memory, V8.GCFinalizeMCReduceMemory, 10000, \ |
937 MILLISECOND) \ | 939 MILLISECOND) \ |
938 HT(gc_scavenger, V8.GCScavenger, 10000, MILLISECOND) \ | 940 HT(gc_scavenger, V8.GCScavenger, 10000, MILLISECOND) \ |
939 HT(gc_context, V8.GCContext, 10000, \ | 941 HT(gc_context, V8.GCContext, 10000, \ |
940 MILLISECOND) /* GC context cleanup time */ \ | 942 MILLISECOND) /* GC context cleanup time */ \ |
(...skipping 11 matching lines...) Expand all Loading... |
952 /* Serialization as part of compilation (code caching) */ \ | 954 /* Serialization as part of compilation (code caching) */ \ |
953 HT(compile_serialize, V8.CompileSerializeMicroSeconds, 100000, MICROSECOND) \ | 955 HT(compile_serialize, V8.CompileSerializeMicroSeconds, 100000, MICROSECOND) \ |
954 HT(compile_deserialize, V8.CompileDeserializeMicroSeconds, 1000000, \ | 956 HT(compile_deserialize, V8.CompileDeserializeMicroSeconds, 1000000, \ |
955 MICROSECOND) \ | 957 MICROSECOND) \ |
956 /* Total compilation time incl. caching/parsing */ \ | 958 /* Total compilation time incl. caching/parsing */ \ |
957 HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND) \ | 959 HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND) \ |
958 /* Total JavaScript execution time (including callbacks and runtime calls */ \ | 960 /* Total JavaScript execution time (including callbacks and runtime calls */ \ |
959 HT(execute, V8.Execute, 1000000, MICROSECOND) \ | 961 HT(execute, V8.Execute, 1000000, MICROSECOND) \ |
960 /* Asm/Wasm */ \ | 962 /* Asm/Wasm */ \ |
961 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 963 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
962 HT(wasm_instantiate_asm_module_time, V8.WasmInstantiateModuleMicroSeconds, \ | 964 HT(wasm_instantiate_asm_module_time, \ |
| 965 V8.WasmInstantiateModuleMicroSeconds.asm, 1000000, MICROSECOND) \ |
| 966 HT(wasm_instantiate_wasm_module_time, \ |
| 967 V8.WasmInstantiateModuleMicroSeconds.wasm, 1000000, MICROSECOND) \ |
| 968 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
| 969 HT(wasm_decode_asm_module_time, V8.WasmDecodeModuleMicroSeconds.asm, \ |
963 1000000, MICROSECOND) \ | 970 1000000, MICROSECOND) \ |
964 HT(wasm_instantiate_wasm_module_time, V8.WasmInstantiateModuleMicroSeconds, \ | 971 HT(wasm_decode_wasm_module_time, V8.WasmDecodeModuleMicroSeconds.wasm, \ |
965 1000000, MICROSECOND) \ | 972 1000000, MICROSECOND) \ |
966 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 973 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
967 HT(wasm_decode_asm_module_time, V8.WasmDecodeModuleMicroSeconds, 1000000, \ | 974 HT(wasm_decode_asm_function_time, V8.WasmDecodeFunctionMicroSeconds.asm, \ |
968 MICROSECOND) \ | |
969 HT(wasm_decode_wasm_module_time, V8.WasmDecodeModuleMicroSeconds, 1000000, \ | |
970 MICROSECOND) \ | |
971 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | |
972 HT(wasm_decode_asm_function_time, V8.WasmDecodeFunctionMicroSeconds, \ | |
973 1000000, MICROSECOND) \ | 975 1000000, MICROSECOND) \ |
974 HT(wasm_decode_wasm_function_time, V8.WasmDecodeFunctionMicroSeconds, \ | 976 HT(wasm_decode_wasm_function_time, V8.WasmDecodeFunctionMicroSeconds.wasm, \ |
975 1000000, MICROSECOND) \ | 977 1000000, MICROSECOND) \ |
976 /* TODO(kschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 978 /* TODO(kschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
977 HT(wasm_compile_asm_module_time, V8.WasmCompileModuleMicroSeconds, 1000000, \ | 979 HT(wasm_compile_asm_module_time, V8.WasmCompileModuleMicroSeconds.asm, \ |
978 MICROSECOND) \ | 980 1000000, MICROSECOND) \ |
979 HT(wasm_compile_wasm_module_time, V8.WasmCompileModuleMicroSeconds, 1000000, \ | 981 HT(wasm_compile_wasm_module_time, V8.WasmCompileModuleMicroSeconds.wasm, \ |
980 MICROSECOND) \ | 982 1000000, MICROSECOND) \ |
981 HT(wasm_compile_function_time, V8.WasmCompileFunctionMicroSeconds, 1000000, \ | 983 HT(wasm_compile_function_time, V8.WasmCompileFunctionMicroSeconds, 1000000, \ |
982 MICROSECOND) \ | 984 MICROSECOND) \ |
983 HT(asm_wasm_translation_time, V8.AsmWasmTranslationMicroSeconds, 1000000, \ | 985 HT(asm_wasm_translation_time, V8.AsmWasmTranslationMicroSeconds, 1000000, \ |
984 MICROSECOND) \ | 986 MICROSECOND) \ |
985 HT(wasm_lazy_compilation_time, V8.WasmLazyCompilationMicroSeconds, 1000000, \ | 987 HT(wasm_lazy_compilation_time, V8.WasmLazyCompilationMicroSeconds, 1000000, \ |
986 MICROSECOND) | 988 MICROSECOND) |
987 | 989 |
988 #define AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) \ | 990 #define AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) \ |
989 AHT(compile_lazy, V8.CompileLazyMicroSeconds) | 991 AHT(compile_lazy, V8.CompileLazyMicroSeconds) |
990 | 992 |
(...skipping 18 matching lines...) Expand all Loading... |
1009 HM(heap_sample_map_space_committed, V8.MemoryHeapSampleMapSpaceCommitted) \ | 1011 HM(heap_sample_map_space_committed, V8.MemoryHeapSampleMapSpaceCommitted) \ |
1010 HM(heap_sample_code_space_committed, V8.MemoryHeapSampleCodeSpaceCommitted) \ | 1012 HM(heap_sample_code_space_committed, V8.MemoryHeapSampleCodeSpaceCommitted) \ |
1011 HM(heap_sample_maximum_committed, V8.MemoryHeapSampleMaximumCommitted) | 1013 HM(heap_sample_maximum_committed, V8.MemoryHeapSampleMaximumCommitted) |
1012 | 1014 |
1013 #define HISTOGRAM_MEMORY_LIST(HM) \ | 1015 #define HISTOGRAM_MEMORY_LIST(HM) \ |
1014 HM(memory_heap_committed, V8.MemoryHeapCommitted) \ | 1016 HM(memory_heap_committed, V8.MemoryHeapCommitted) \ |
1015 HM(memory_heap_used, V8.MemoryHeapUsed) \ | 1017 HM(memory_heap_used, V8.MemoryHeapUsed) \ |
1016 /* Asm/Wasm */ \ | 1018 /* Asm/Wasm */ \ |
1017 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 1019 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
1018 HM(wasm_decode_asm_module_peak_memory_bytes, \ | 1020 HM(wasm_decode_asm_module_peak_memory_bytes, \ |
1019 V8.WasmDecodeModulePeakMemoryBytes) \ | 1021 V8.WasmDecodeModulePeakMemoryBytes.asm) \ |
1020 HM(wasm_decode_wasm_module_peak_memory_bytes, \ | 1022 HM(wasm_decode_wasm_module_peak_memory_bytes, \ |
1021 V8.WasmDecodeModulePeakMemoryBytes) \ | 1023 V8.WasmDecodeModulePeakMemoryBytes.wasm) \ |
1022 HM(wasm_compile_function_peak_memory_bytes, \ | 1024 HM(wasm_compile_function_peak_memory_bytes, \ |
1023 V8.WasmCompileFunctionPeakMemoryBytes) \ | 1025 V8.WasmCompileFunctionPeakMemoryBytes) \ |
1024 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 1026 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
1025 HM(wasm_asm_min_mem_pages_count, V8.WasmMinMemPagesCount) \ | 1027 HM(wasm_asm_min_mem_pages_count, V8.WasmMinMemPagesCount.asm) \ |
1026 HM(wasm_wasm_min_mem_pages_count, V8.WasmMinMemPagesCount) \ | 1028 HM(wasm_wasm_min_mem_pages_count, V8.WasmMinMemPagesCount.wasm) \ |
1027 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 1029 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
1028 HM(wasm_asm_max_mem_pages_count, V8.WasmMaxMemPagesCount) \ | 1030 HM(wasm_asm_max_mem_pages_count, V8.WasmMaxMemPagesCount.asm) \ |
1029 HM(wasm_wasm_max_mem_pages_count, V8.WasmMaxMemPagesCount) \ | 1031 HM(wasm_wasm_max_mem_pages_count, V8.WasmMaxMemPagesCount.wasm) \ |
1030 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 1032 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
1031 HM(wasm_asm_function_size_bytes, V8.WasmFunctionSizeBytes) \ | 1033 HM(wasm_asm_function_size_bytes, V8.WasmFunctionSizeBytes.asm) \ |
1032 HM(wasm_wasm_function_size_bytes, V8.WasmFunctionSizeBytes) \ | 1034 HM(wasm_wasm_function_size_bytes, V8.WasmFunctionSizeBytes.wasm) \ |
1033 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ | 1035 /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ |
1034 HM(wasm_asm_module_size_bytes, V8.WasmModuleSizeBytes) \ | 1036 HM(wasm_asm_module_size_bytes, V8.WasmModuleSizeBytes.asm) \ |
1035 HM(wasm_wasm_module_size_bytes, V8.WasmModuleSizeBytes) | 1037 HM(wasm_wasm_module_size_bytes, V8.WasmModuleSizeBytes.wasm) |
1036 | 1038 |
1037 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC | 1039 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC |
1038 // Intellisense to crash. It was broken into two macros (each of length 40 | 1040 // Intellisense to crash. It was broken into two macros (each of length 40 |
1039 // lines) rather than one macro (of length about 80 lines) to work around | 1041 // lines) rather than one macro (of length about 80 lines) to work around |
1040 // this problem. Please avoid using recursive macros of this length when | 1042 // this problem. Please avoid using recursive macros of this length when |
1041 // possible. | 1043 // possible. |
1042 #define STATS_COUNTER_LIST_1(SC) \ | 1044 #define STATS_COUNTER_LIST_1(SC) \ |
1043 /* Global Handle Count*/ \ | 1045 /* Global Handle Count*/ \ |
1044 SC(global_handles, V8.GlobalHandles) \ | 1046 SC(global_handles, V8.GlobalHandles) \ |
1045 /* OS Memory allocated */ \ | 1047 /* OS Memory allocated */ \ |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 | 1346 |
1345 explicit Counters(Isolate* isolate); | 1347 explicit Counters(Isolate* isolate); |
1346 | 1348 |
1347 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 1349 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
1348 }; | 1350 }; |
1349 | 1351 |
1350 } // namespace internal | 1352 } // namespace internal |
1351 } // namespace v8 | 1353 } // namespace v8 |
1352 | 1354 |
1353 #endif // V8_COUNTERS_H_ | 1355 #endif // V8_COUNTERS_H_ |
OLD | NEW |