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

Unified Diff: src/IceGlobalContext.cpp

Issue 788713002: Subzero: Disable stats and timers under the MINIMAL build. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 2f5269bc64d7592a848046a92497f86aba26d30c..84d7b685b75bc3b08833f7e12fa0420b36d5c928 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -114,8 +114,10 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit,
TestPrefix(TestPrefix), Flags(Flags), HasEmittedFirstMethod(false),
RNG(""), ObjectWriter() {
// Pre-register built-in stack names.
- newTimerStackID("Total across all functions");
- newTimerStackID("Per-function summary");
+ if (ALLOW_DUMP) {
+ newTimerStackID("Total across all functions");
+ newTimerStackID("Per-function summary");
+ }
if (Flags.UseELFWriter) {
ObjectWriter.reset(new ELFObjectWriter(*this, *ELFStr));
}
@@ -221,7 +223,7 @@ IceString GlobalContext::mangleName(const IceString &Name) const {
// _Z3barxyz ==> ZN6Prefix3barExyz
// An unmangled, extern "C" style name, gets a simple prefix:
// bar ==> Prefixbar
- if (getTestPrefix().empty())
+ if (!ALLOW_DUMP || getTestPrefix().empty())
return Name;
unsigned PrefixLength = getTestPrefix().length();
@@ -438,6 +440,8 @@ TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID,
}
TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) {
+ if (!ALLOW_DUMP)
+ return 0;
TimerStackIdT NewID = Timers.size();
Timers.push_back(TimerStack(Name));
return NewID;
@@ -485,10 +489,12 @@ void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) {
}
TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func)
- : ID(ID), Ctx(Func->getContext()),
- Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) {
- if (Active)
- Ctx->pushTimer(ID);
+ : ID(ID), Ctx(Func->getContext()), Active(false) {
+ if (ALLOW_DUMP) {
+ Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled;
+ if (Active)
+ Ctx->pushTimer(ID);
+ }
}
} // end of namespace Ice
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698