Chromium Code Reviews| Index: src/IceGlobalContext.h |
| diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h |
| index 0ffff1c3d9013979f8f18cc0cacd0b05bd7d919b..5b0baef4d93eabe02c7e694000464cdd29115413 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(); |
| } |
| + // These are predefined TimerStackIdT values. |
| + enum TimerStackKind { |
| + TSK_Default = 0, |
| + TSK_Funcs, |
| + TSK_Num |
| + }; |
| + |
| static TimerIdT getTimerID(const IceString &Name); |
| - void pushTimer(TimerIdT ID); |
| - void popTimer(TimerIdT ID); |
| - void dumpTimers(); |
| + static TimerStackIdT getTimerStackID(); |
|
jvoung (off chromium)
2014/10/06 16:30:56
How is getTimerStackID() planned to be used? (I do
Jim Stichnoth
2014/10/06 21:29:57
The thought is that some component, e.g. the bitco
|
| + 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,8 @@ private: |
| RandomNumberGenerator RNG; |
| CodeStats StatsFunction; |
| CodeStats StatsCumulative; |
| - std::unique_ptr<class TimerStack> Timers; |
| + std::vector<TimerStack> Timers; |
| + static TimerStackIdT NumTimerStackIds; |
| GlobalContext(const GlobalContext &) = delete; |
| GlobalContext &operator=(const GlobalContext &) = delete; |
| @@ -194,6 +206,8 @@ public: |
| if (Active) |
| Ctx->pushTimer(ID); |
| } |
| + TimerMarker(TimerIdT ID, const Cfg *Func); |
| + |
| ~TimerMarker() { |
| if (Active) |
| Ctx->popTimer(ID); |