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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 640713003: Subzero: Improve the output with the --timing-focus=xxx option. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 80-col Created 6 years, 2 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/IceGlobalContext.h ('k') | src/IceTimerTree.h » ('j') | 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 void GlobalContext::pushTimer(TimerIdT ID, TimerStackIdT StackID) { 400 void GlobalContext::pushTimer(TimerIdT ID, TimerStackIdT StackID) {
401 assert(StackID < Timers.size()); 401 assert(StackID < Timers.size());
402 Timers[StackID].push(ID); 402 Timers[StackID].push(ID);
403 } 403 }
404 404
405 void GlobalContext::popTimer(TimerIdT ID, TimerStackIdT StackID) { 405 void GlobalContext::popTimer(TimerIdT ID, TimerStackIdT StackID) {
406 assert(StackID < Timers.size()); 406 assert(StackID < Timers.size());
407 Timers[StackID].pop(ID); 407 Timers[StackID].pop(ID);
408 } 408 }
409 409
410 void GlobalContext::resetTimer(TimerStackIdT StackID) {
411 assert(StackID < Timers.size());
412 Timers[StackID].reset();
413 }
414
415 void GlobalContext::setTimerName(TimerStackIdT StackID,
416 const IceString &NewName) {
417 assert(StackID < Timers.size());
418 Timers[StackID].setName(NewName);
419 }
420
410 void GlobalContext::dumpStats(const IceString &Name, bool Final) { 421 void GlobalContext::dumpStats(const IceString &Name, bool Final) {
411 if (Flags.DumpStats) { 422 if (Flags.DumpStats) {
412 if (Final) { 423 if (Final) {
413 StatsCumulative.dump(Name, getStrDump()); 424 StatsCumulative.dump(Name, getStrDump());
414 } else { 425 } else {
415 StatsFunction.dump(Name, getStrDump()); 426 StatsFunction.dump(Name, getStrDump());
416 StatsCumulative.dump("_TOTAL_", getStrDump()); 427 StatsCumulative.dump("_TOTAL_", getStrDump());
417 } 428 }
418 } 429 }
419 } 430 }
420 431
421 void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) { 432 void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) {
422 assert(Timers.size() > StackID); 433 assert(Timers.size() > StackID);
423 Timers[StackID].dump(getStrDump(), DumpCumulative); 434 Timers[StackID].dump(getStrDump(), DumpCumulative);
424 } 435 }
425 436
426 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func) 437 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func)
427 : ID(ID), Ctx(Func->getContext()), 438 : ID(ID), Ctx(Func->getContext()),
428 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) { 439 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) {
429 if (Active) 440 if (Active)
430 Ctx->pushTimer(ID); 441 Ctx->pushTimer(ID);
431 } 442 }
432 443
433 } // end of namespace Ice 444 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceTimerTree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698