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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 887213002: Subzero: Fix stats collection and output for multithreading. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Reduce the number of TLS lookups Created 5 years, 10 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
« src/IceGlobalContext.h ('K') | « src/IceGlobalContext.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 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines aspects of the compilation that persist across 10 // This file defines aspects of the compilation that persist across
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 536 }
537 537
538 void GlobalContext::dumpStats(const IceString &Name, bool Final) { 538 void GlobalContext::dumpStats(const IceString &Name, bool Final) {
539 if (!ALLOW_DUMP || !getFlags().DumpStats) 539 if (!ALLOW_DUMP || !getFlags().DumpStats)
540 return; 540 return;
541 OstreamLocker OL(this); 541 OstreamLocker OL(this);
542 if (Final) { 542 if (Final) {
543 getStatsCumulative()->dump(Name, getStrDump()); 543 getStatsCumulative()->dump(Name, getStrDump());
544 } else { 544 } else {
545 ICE_TLS_GET_FIELD(TLS)->StatsFunction.dump(Name, getStrDump()); 545 ICE_TLS_GET_FIELD(TLS)->StatsFunction.dump(Name, getStrDump());
546 getStatsCumulative()->dump("_TOTAL_", getStrDump());
547 } 546 }
548 } 547 }
549 548
550 void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) { 549 void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) {
551 if (!ALLOW_DUMP) 550 if (!ALLOW_DUMP)
552 return; 551 return;
553 auto Timers = getTimers(); 552 auto Timers = getTimers();
554 assert(Timers->size() > StackID); 553 assert(Timers->size() > StackID);
555 OstreamLocker L(this); 554 OstreamLocker L(this);
556 Timers->at(StackID).dump(getStrDump(), DumpCumulative); 555 Timers->at(StackID).dump(getStrDump(), DumpCumulative);
(...skipping 17 matching lines...) Expand all
574 void TimerMarker::pushCfg(const Cfg *Func) { 573 void TimerMarker::pushCfg(const Cfg *Func) {
575 Ctx = Func->getContext(); 574 Ctx = Func->getContext();
576 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled; 575 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled;
577 if (Active) 576 if (Active)
578 Ctx->pushTimer(ID, StackID); 577 Ctx->pushTimer(ID, StackID);
579 } 578 }
580 579
581 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 580 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
582 581
583 } // end of namespace Ice 582 } // end of namespace Ice
OLDNEW
« src/IceGlobalContext.h ('K') | « src/IceGlobalContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698