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

Unified Diff: src/IceTimerTree.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/IceTargetLoweringX8632.cpp ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTimerTree.h
diff --git a/src/IceTimerTree.h b/src/IceTimerTree.h
index 029b7f46bb0186067499097f69a06f453be2c7ad..289ea2deecee780cb35e58dcdc235a466f7f0ebe 100644
--- a/src/IceTimerTree.h
+++ b/src/IceTimerTree.h
@@ -15,6 +15,8 @@
#ifndef SUBZERO_SRC_ICETIMERTREE_H
#define SUBZERO_SRC_ICETIMERTREE_H
+#include "IceTimerTree.def"
+
namespace Ice {
class TimerTreeNode;
@@ -38,23 +40,32 @@ public:
};
class TimerStack {
- TimerStack(const TimerStack &) = delete;
+ // TimerStack(const TimerStack &) = delete;
TimerStack &operator=(const TimerStack &) = delete;
public:
- TimerStack(const IceString &TopLevelName);
- static TimerIdT getTimerID(const IceString &Name);
+ enum TimerTag {
+#define X(tag) TT_##tag,
+ TIMERTREE_TABLE
+#undef X
+ TT__num
+ };
+ TimerStack(const IceString &Name);
+ TimerIdT getTimerID(const IceString &Name);
void push(TimerIdT ID);
void pop(TimerIdT ID);
- void dump(Ostream &Str);
+ void dump(Ostream &Str, bool DumpCumulative);
private:
void update();
static double timestamp();
+ const IceString Name;
const double FirstTimestamp;
double LastTimestamp;
uint64_t StateChangeCount;
- static std::vector<IceString> IDs; // indexed by TimerIdT
+ // IDsIndex maps a symbolic timer name to its integer ID.
+ std::map<IceString, TimerIdT> IDsIndex;
+ std::vector<IceString> IDs; // indexed by TimerIdT
std::vector<TimerTreeNode> Nodes; // indexed by TTindex
std::vector<double> LeafTimes; // indexed by TimerIdT
TTindex StackTop;
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698