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

Side by Side Diff: src/counters.cc

Issue 2812653002: Revert of Ensure counters are initialized, to avoid init on non-joinable threads. (Closed)
Patch Set: Created 3 years, 8 months 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
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/counters.h" 5 #include "src/counters.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/builtins/builtins-definitions.h" 10 #include "src/builtins/builtins-definitions.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 #define AHT(name, caption) name##_.Reset(); 245 #define AHT(name, caption) name##_.Reset();
246 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) 246 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT)
247 #undef AHT 247 #undef AHT
248 248
249 #define HP(name, caption) name##_.Reset(); 249 #define HP(name, caption) name##_.Reset();
250 HISTOGRAM_PERCENTAGE_LIST(HP) 250 HISTOGRAM_PERCENTAGE_LIST(HP)
251 #undef HP 251 #undef HP
252 252
253 #define HM(name, caption) name##_.Reset(); 253 #define HM(name, caption) name##_.Reset();
254 HISTOGRAM_LEGACY_MEMORY_LIST(HM) 254 HISTOGRAM_LEGACY_MEMORY_LIST(HM)
255 HISTOGRAM_MEMORY_LIST(HM)
256 #undef HM 255 #undef HM
257 } 256 }
258 257
259 void Counters::InitializeHistograms() {
260 #define HR(name, caption, min, max, num_buckets) name##_.Enabled();
261 HISTOGRAM_RANGE_LIST(HR)
262 #undef HR
263
264 #define HT(name, caption, max, res) name##_.Enabled();
265 HISTOGRAM_TIMER_LIST(HT)
266 #undef HT
267
268 #define AHT(name, caption) name##_.Enabled();
269 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT)
270 #undef AHT
271
272 #define HP(name, caption) name##_.Enabled();
273 HISTOGRAM_PERCENTAGE_LIST(HP)
274 #undef HP
275
276 #define HM(name, caption) name##_.Enabled();
277 HISTOGRAM_LEGACY_MEMORY_LIST(HM)
278 HISTOGRAM_MEMORY_LIST(HM)
279 #undef HM
280 }
281
282 class RuntimeCallStatEntries { 258 class RuntimeCallStatEntries {
283 public: 259 public:
284 void Print(std::ostream& os) { 260 void Print(std::ostream& os) {
285 if (total_call_count == 0) return; 261 if (total_call_count == 0) return;
286 std::sort(entries.rbegin(), entries.rend()); 262 std::sort(entries.rbegin(), entries.rend());
287 os << std::setw(50) << "Runtime Function/C++ Builtin" << std::setw(12) 263 os << std::setw(50) << "Runtime Function/C++ Builtin" << std::setw(12)
288 << "Time" << std::setw(18) << "Count" << std::endl 264 << "Time" << std::setw(18) << "Count" << std::endl
289 << std::string(88, '=') << std::endl; 265 << std::string(88, '=') << std::endl;
290 for (Entry& entry : entries) { 266 for (Entry& entry : entries) {
291 entry.SetTotal(total_time, total_call_count); 267 entry.SetTotal(total_time, total_call_count);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 RuntimeCallStats::counters) { 501 RuntimeCallStats::counters) {
526 RuntimeCallCounter* counter = &(this->*counter_id); 502 RuntimeCallCounter* counter = &(this->*counter_id);
527 if (counter->count() > 0) counter->Dump(value); 503 if (counter->count() > 0) counter->Dump(value);
528 } 504 }
529 505
530 in_use_ = false; 506 in_use_ = false;
531 } 507 }
532 508
533 } // namespace internal 509 } // namespace internal
534 } // namespace v8 510 } // namespace v8
OLDNEW
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698