Chromium Code Reviews| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/platform/platform.h" | 7 #include "src/base/platform/platform.h" |
| 8 #include "src/counters.h" | 8 #include "src/counters.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/log-inl.h" | 10 #include "src/log-inl.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 if (Enabled()) { | 40 if (Enabled()) { |
| 41 timer_.Start(); | 41 timer_.Start(); |
| 42 } | 42 } |
| 43 Logger::CallEventLogger(isolate(), name(), Logger::START, true); | 43 Logger::CallEventLogger(isolate(), name(), Logger::START, true); |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 // Stop the timer and record the results. | 47 // Stop the timer and record the results. |
| 48 void HistogramTimer::Stop() { | 48 void HistogramTimer::Stop() { |
| 49 if (Enabled()) { | 49 if (Enabled()) { |
| 50 // Compute the delta between start and stop, in milliseconds. | 50 // Compute the delta between start and stop, in microseconds. |
| 51 AddSample(static_cast<int>(timer_.Elapsed().InMilliseconds())); | 51 AddSample(static_cast<int>(timer_.Elapsed().InMicroseconds())); |
| 52 timer_.Stop(); | 52 timer_.Stop(); |
| 53 } | 53 } |
| 54 Logger::CallEventLogger(isolate(), name(), Logger::END, true); | 54 Logger::CallEventLogger(isolate(), name(), Logger::END, true); |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 Counters::Counters(Isolate* isolate) { | 58 Counters::Counters(Isolate* isolate) { |
| 59 #define HR(name, caption, min, max, num_buckets) \ | 59 #define HR(name, caption, min, max, num_buckets) \ |
| 60 name##_ = Histogram(#caption, min, max, num_buckets, isolate); | 60 name##_ = Histogram(#caption, min, max, num_buckets, isolate); |
| 61 HISTOGRAM_RANGE_LIST(HR) | 61 HISTOGRAM_RANGE_LIST(HR) |
| 62 #undef HR | 62 #undef HR |
| 63 | 63 |
| 64 #define HT(name, caption) \ | 64 #define HT(name, caption, max) \ |
| 65 name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate); | 65 name##_ = HistogramTimer(#caption, 0, max, 50, isolate); |
| 66 HISTOGRAM_TIMER_LIST(HT) | 66 HISTOGRAM_TIMER_LIST(HT) |
| 67 #undef HT | 67 #undef HT |
| 68 | 68 |
| 69 #define AHT(name, caption) \ | 69 #define AHT(name, caption) \ |
| 70 name##_ = AggregatableHistogramTimer(#caption, 0, 10000, 50, isolate); | 70 name##_ = AggregatableHistogramTimer(#caption, 0, 1000000, 50, isolate); |
|
vogelheim
2015/01/26 14:46:50
One more '0' please. Compile times in single digit
Yang
2015/01/26 15:09:07
Done.
| |
| 71 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) | 71 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) |
| 72 #undef AHT | 72 #undef AHT |
| 73 | 73 |
| 74 #define HP(name, caption) \ | 74 #define HP(name, caption) \ |
| 75 name##_ = Histogram(#caption, 0, 101, 100, isolate); | 75 name##_ = Histogram(#caption, 0, 101, 100, isolate); |
| 76 HISTOGRAM_PERCENTAGE_LIST(HP) | 76 HISTOGRAM_PERCENTAGE_LIST(HP) |
| 77 #undef HP | 77 #undef HP |
| 78 | 78 |
| 79 #define HM(name, caption) \ | 79 #define HM(name, caption) \ |
| 80 name##_ = Histogram(#caption, 1000, 500000, 50, isolate); | 80 name##_ = Histogram(#caption, 1000, 500000, 50, isolate); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 CODE_AGE_LIST_COMPLETE(SC) | 150 CODE_AGE_LIST_COMPLETE(SC) |
| 151 #undef SC | 151 #undef SC |
| 152 } | 152 } |
| 153 | 153 |
| 154 | 154 |
| 155 void Counters::ResetHistograms() { | 155 void Counters::ResetHistograms() { |
| 156 #define HR(name, caption, min, max, num_buckets) name##_.Reset(); | 156 #define HR(name, caption, min, max, num_buckets) name##_.Reset(); |
| 157 HISTOGRAM_RANGE_LIST(HR) | 157 HISTOGRAM_RANGE_LIST(HR) |
| 158 #undef HR | 158 #undef HR |
| 159 | 159 |
| 160 #define HT(name, caption) name##_.Reset(); | 160 #define HT(name, caption, max) name##_.Reset(); |
| 161 HISTOGRAM_TIMER_LIST(HT) | 161 HISTOGRAM_TIMER_LIST(HT) |
| 162 #undef HT | 162 #undef HT |
| 163 | 163 |
| 164 #define AHT(name, caption) name##_.Reset(); | 164 #define AHT(name, caption) name##_.Reset(); |
| 165 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) | 165 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) |
| 166 #undef AHT | 166 #undef AHT |
| 167 | 167 |
| 168 #define HP(name, caption) name##_.Reset(); | 168 #define HP(name, caption) name##_.Reset(); |
| 169 HISTOGRAM_PERCENTAGE_LIST(HP) | 169 HISTOGRAM_PERCENTAGE_LIST(HP) |
| 170 #undef HP | 170 #undef HP |
| 171 | 171 |
| 172 #define HM(name, caption) name##_.Reset(); | 172 #define HM(name, caption) name##_.Reset(); |
| 173 HISTOGRAM_MEMORY_LIST(HM) | 173 HISTOGRAM_MEMORY_LIST(HM) |
| 174 #undef HM | 174 #undef HM |
| 175 } | 175 } |
| 176 | 176 |
| 177 } } // namespace v8::internal | 177 } } // namespace v8::internal |
| OLD | NEW |