| 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 // This file declares the TimerTree class, which allows flat and | 10 // This file declares the TimerTree class, which allows flat and |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // TimerTreeNode represents an interior or leaf node in the call tree. | 37 // TimerTreeNode represents an interior or leaf node in the call tree. |
| 38 // It contains a list of children, a pointer to its parent, and the | 38 // It contains a list of children, a pointer to its parent, and the |
| 39 // timer ID for the node. It also holds the cumulative time spent at | 39 // timer ID for the node. It also holds the cumulative time spent at |
| 40 // this node and below. The children are always at a higher index in | 40 // this node and below. The children are always at a higher index in |
| 41 // the TimerTreeNode::Nodes array, and the parent is always at a lower | 41 // the TimerTreeNode::Nodes array, and the parent is always at a lower |
| 42 // index. | 42 // index. |
| 43 class TimerTreeNode { | 43 class TimerTreeNode { |
| 44 TimerTreeNode &operator=(const TimerTreeNode &) = delete; | 44 TimerTreeNode &operator=(const TimerTreeNode &) = delete; |
| 45 | 45 |
| 46 public: | 46 public: |
| 47 TimerTreeNode() : Parent(0), Interior(0), Time(0), UpdateCount(0) {} | 47 TimerTreeNode() = default; |
| 48 TimerTreeNode(const TimerTreeNode &) = default; | 48 TimerTreeNode(const TimerTreeNode &) = default; |
| 49 std::vector<TTindex> Children; // indexed by TimerIdT | 49 std::vector<TTindex> Children; // indexed by TimerIdT |
| 50 TTindex Parent; | 50 TTindex Parent = 0; |
| 51 TimerIdT Interior; | 51 TimerIdT Interior = 0; |
| 52 double Time; | 52 double Time = 0; |
| 53 size_t UpdateCount; | 53 size_t UpdateCount = 0; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 public: | 56 public: |
| 57 enum TimerTag { | 57 enum TimerTag { |
| 58 #define X(tag) TT_##tag, | 58 #define X(tag) TT_##tag, |
| 59 TIMERTREE_TABLE | 59 TIMERTREE_TABLE |
| 60 #undef X | 60 #undef X |
| 61 TT__num | 61 TT__num |
| 62 }; | 62 }; |
| 63 explicit TimerStack(const IceString &Name); | 63 explicit TimerStack(const IceString &Name); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 74 private: | 74 private: |
| 75 void update(bool UpdateCounts); | 75 void update(bool UpdateCounts); |
| 76 static double timestamp(); | 76 static double timestamp(); |
| 77 TranslationType translateIDsFrom(const TimerStack &Src); | 77 TranslationType translateIDsFrom(const TimerStack &Src); |
| 78 PathType getPath(TTindex Index, const TranslationType &Mapping) const; | 78 PathType getPath(TTindex Index, const TranslationType &Mapping) const; |
| 79 TTindex getChildIndex(TTindex Parent, TimerIdT ID); | 79 TTindex getChildIndex(TTindex Parent, TimerIdT ID); |
| 80 TTindex findPath(const PathType &Path); | 80 TTindex findPath(const PathType &Path); |
| 81 IceString Name; | 81 IceString Name; |
| 82 double FirstTimestamp; | 82 double FirstTimestamp; |
| 83 double LastTimestamp; | 83 double LastTimestamp; |
| 84 uint64_t StateChangeCount; | 84 uint64_t StateChangeCount = 0; |
| 85 // IDsIndex maps a symbolic timer name to its integer ID. | 85 // IDsIndex maps a symbolic timer name to its integer ID. |
| 86 std::map<IceString, TimerIdT> IDsIndex; | 86 std::map<IceString, TimerIdT> IDsIndex; |
| 87 std::vector<IceString> IDs; // indexed by TimerIdT | 87 std::vector<IceString> IDs; // indexed by TimerIdT |
| 88 std::vector<TimerTreeNode> Nodes; // indexed by TTindex | 88 std::vector<TimerTreeNode> Nodes; // indexed by TTindex |
| 89 std::vector<double> LeafTimes; // indexed by TimerIdT | 89 std::vector<double> LeafTimes; // indexed by TimerIdT |
| 90 std::vector<size_t> LeafCounts; // indexed by TimerIdT | 90 std::vector<size_t> LeafCounts; // indexed by TimerIdT |
| 91 TTindex StackTop; | 91 TTindex StackTop = 0; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // end of namespace Ice | 94 } // end of namespace Ice |
| 95 | 95 |
| 96 #endif // SUBZERO_SRC_ICETIMERTREE_H | 96 #endif // SUBZERO_SRC_ICETIMERTREE_H |
| OLD | NEW |