OLD | NEW |
1 //===- subzero/src/IceTimerTree.h - Pass timer defs -------------*- C++ -*-===// | 1 //===- subzero/src/IceTimerTree.h - Pass timer defs -------------*- C++ -*-===// |
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 /// \file | 10 /// \file |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 size_t UpdateCount = 0; | 55 size_t UpdateCount = 0; |
56 }; | 56 }; |
57 | 57 |
58 public: | 58 public: |
59 enum TimerTag { | 59 enum TimerTag { |
60 #define X(tag) TT_##tag, | 60 #define X(tag) TT_##tag, |
61 TIMERTREE_TABLE | 61 TIMERTREE_TABLE |
62 #undef X | 62 #undef X |
63 TT__num | 63 TT__num |
64 }; | 64 }; |
65 explicit TimerStack(const IceString &Name); | 65 explicit TimerStack(const std::string &Name); |
66 TimerStack(const TimerStack &) = default; | 66 TimerStack(const TimerStack &) = default; |
67 TimerIdT getTimerID(const IceString &Name); | 67 TimerIdT getTimerID(const std::string &Name); |
68 void mergeFrom(const TimerStack &Src); | 68 void mergeFrom(const TimerStack &Src); |
69 void setName(const IceString &NewName) { Name = NewName; } | 69 void setName(const std::string &NewName) { Name = NewName; } |
70 const IceString &getName() const { return Name; } | 70 const std::string &getName() const { return Name; } |
71 void push(TimerIdT ID); | 71 void push(TimerIdT ID); |
72 void pop(TimerIdT ID); | 72 void pop(TimerIdT ID); |
73 void reset(); | 73 void reset(); |
74 void dump(Ostream &Str, bool DumpCumulative); | 74 void dump(Ostream &Str, bool DumpCumulative); |
75 | 75 |
76 private: | 76 private: |
77 void update(bool UpdateCounts); | 77 void update(bool UpdateCounts); |
78 static double timestamp(); | 78 static double timestamp(); |
79 TranslationType translateIDsFrom(const TimerStack &Src); | 79 TranslationType translateIDsFrom(const TimerStack &Src); |
80 PathType getPath(TTindex Index, const TranslationType &Mapping) const; | 80 PathType getPath(TTindex Index, const TranslationType &Mapping) const; |
81 TTindex getChildIndex(TTindex Parent, TimerIdT ID); | 81 TTindex getChildIndex(TTindex Parent, TimerIdT ID); |
82 TTindex findPath(const PathType &Path); | 82 TTindex findPath(const PathType &Path); |
83 IceString Name; | 83 std::string Name; |
84 double FirstTimestamp; | 84 double FirstTimestamp; |
85 double LastTimestamp; | 85 double LastTimestamp; |
86 uint64_t StateChangeCount = 0; | 86 uint64_t StateChangeCount = 0; |
87 /// IDsIndex maps a symbolic timer name to its integer ID. | 87 /// IDsIndex maps a symbolic timer name to its integer ID. |
88 std::map<IceString, TimerIdT> IDsIndex; | 88 std::map<std::string, TimerIdT> IDsIndex; |
89 std::vector<IceString> IDs; /// indexed by TimerIdT | 89 std::vector<std::string> IDs; /// indexed by TimerIdT |
90 std::vector<TimerTreeNode> Nodes; /// indexed by TTindex | 90 std::vector<TimerTreeNode> Nodes; /// indexed by TTindex |
91 std::vector<double> LeafTimes; /// indexed by TimerIdT | 91 std::vector<double> LeafTimes; /// indexed by TimerIdT |
92 std::vector<size_t> LeafCounts; /// indexed by TimerIdT | 92 std::vector<size_t> LeafCounts; /// indexed by TimerIdT |
93 TTindex StackTop = 0; | 93 TTindex StackTop = 0; |
94 }; | 94 }; |
95 | 95 |
96 } // end of namespace Ice | 96 } // end of namespace Ice |
97 | 97 |
98 #endif // SUBZERO_SRC_ICETIMERTREE_H | 98 #endif // SUBZERO_SRC_ICETIMERTREE_H |
OLD | NEW |