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

Unified Diff: src/IceGlobalContext.h

Issue 620373004: Subzero: Add a few performance measurement tools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Improve the use of containers 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.h
diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
index 0ffff1c3d9013979f8f18cc0cacd0b05bd7d919b..9968abbc8715d70d3e153b6c1392aa2e503bb9eb 100644
--- a/src/IceGlobalContext.h
+++ b/src/IceGlobalContext.h
@@ -23,6 +23,7 @@
#include "IceDefs.h"
#include "IceIntrinsics.h"
#include "IceRNG.h"
+#include "IceTimerTree.h"
#include "IceTypes.h"
namespace Ice {
@@ -71,6 +72,7 @@ public:
// Returns true if any of the specified options in the verbose mask
// are set. If the argument is omitted, it checks if any verbose
// options at all are set.
+ VerboseMask getVerbose() const { return VMask; }
bool isVerbose(VerboseMask Mask = IceV_All) const { return VMask & Mask; }
void setVerbose(VerboseMask Mask) { VMask = Mask; }
void addVerbose(VerboseMask Mask) { VMask |= Mask; }
@@ -151,10 +153,19 @@ public:
StatsCumulative.updateFills();
}
- static TimerIdT getTimerID(const IceString &Name);
- void pushTimer(TimerIdT ID);
- void popTimer(TimerIdT ID);
- void dumpTimers();
+ // These are predefined TimerStackIdT values.
+ enum TimerStackKind {
+ TSK_Default = 0,
+ TSK_Funcs,
+ TSK_Num
+ };
+
+ TimerIdT getTimerID(TimerStackIdT StackID, const IceString &Name);
+ TimerStackIdT newTimerStackID(const IceString &Name);
+ void pushTimer(TimerIdT ID, TimerStackIdT StackID = TSK_Default);
+ void popTimer(TimerIdT ID, TimerStackIdT StackID = TSK_Default);
+ void dumpTimers(TimerStackIdT StackID = TSK_Default,
+ bool DumpCumulative = true);
private:
Ostream *StrDump; // Stream for dumping / diagnostics
@@ -172,7 +183,7 @@ private:
RandomNumberGenerator RNG;
CodeStats StatsFunction;
CodeStats StatsCumulative;
- std::unique_ptr<class TimerStack> Timers;
+ std::vector<TimerStack> Timers;
GlobalContext(const GlobalContext &) = delete;
GlobalContext &operator=(const GlobalContext &) = delete;
@@ -194,6 +205,8 @@ public:
if (Active)
Ctx->pushTimer(ID);
}
+ TimerMarker(TimerIdT ID, const Cfg *Func);
+
~TimerMarker() {
if (Active)
Ctx->popTimer(ID);
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698