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

Side by Side Diff: src/IceTimerTree.h

Issue 1216963007: Doxygenize the documentation comments (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
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
11 // cumulative execution time collection of call chains. 11 // cumulative execution time collection of call chains.
12 // 12 //
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #ifndef SUBZERO_SRC_ICETIMERTREE_H 15 #ifndef SUBZERO_SRC_ICETIMERTREE_H
16 #define SUBZERO_SRC_ICETIMERTREE_H 16 #define SUBZERO_SRC_ICETIMERTREE_H
17 17
18 // TODO(jpp): Refactor IceDefs. 18 // TODO(jpp): Refactor IceDefs.
19 #include "IceDefs.h" 19 #include "IceDefs.h"
20 #include "IceTimerTree.def" 20 #include "IceTimerTree.def"
21 21
22 namespace Ice { 22 namespace Ice {
23 23
24 class TimerStack { 24 class TimerStack {
25 TimerStack() = delete; 25 TimerStack() = delete;
26 TimerStack &operator=(const TimerStack &) = delete; 26 TimerStack &operator=(const TimerStack &) = delete;
27 27
28 // Timer tree index type. A variable of this type is used to access 28 /// Timer tree index type. A variable of this type is used to access
29 // an interior, not-necessarily-leaf node of the tree. 29 /// an interior, not-necessarily-leaf node of the tree.
30 typedef std::vector<class TimerTreeNode>::size_type TTindex; 30 typedef std::vector<class TimerTreeNode>::size_type TTindex;
31 // Representation of a path of leaf values leading to a particular 31 /// Representation of a path of leaf values leading to a particular
32 // node. The representation happens to be in "reverse" order, 32 /// node. The representation happens to be in "reverse" order,
33 // i.e. from leaf/interior to root, for implementation efficiency. 33 /// i.e. from leaf/interior to root, for implementation efficiency.
34 typedef llvm::SmallVector<TTindex, 8> PathType; 34 typedef llvm::SmallVector<TTindex, 8> PathType;
35 // Representation of a mapping of leaf node indexes from one timer 35 /// Representation of a mapping of leaf node indexes from one timer
36 // stack to another. 36 /// stack to another.
37 typedef std::vector<TimerIdT> TranslationType; 37 typedef std::vector<TimerIdT> TranslationType;
38 38
39 // TimerTreeNode represents an interior or leaf node in the call tree. 39 /// TimerTreeNode represents an interior or leaf node in the call tree.
40 // It contains a list of children, a pointer to its parent, and the 40 /// It contains a list of children, a pointer to its parent, and the
41 // timer ID for the node. It also holds the cumulative time spent at 41 /// timer ID for the node. It also holds the cumulative time spent at
42 // this node and below. The children are always at a higher index in 42 /// this node and below. The children are always at a higher index in
43 // the TimerTreeNode::Nodes array, and the parent is always at a lower 43 /// the TimerTreeNode::Nodes array, and the parent is always at a lower
44 // index. 44 /// index.
45 class TimerTreeNode { 45 class TimerTreeNode {
46 TimerTreeNode &operator=(const TimerTreeNode &) = delete; 46 TimerTreeNode &operator=(const TimerTreeNode &) = delete;
47 47
48 public: 48 public:
49 TimerTreeNode() = default; 49 TimerTreeNode() = default;
50 TimerTreeNode(const TimerTreeNode &) = default; 50 TimerTreeNode(const TimerTreeNode &) = default;
51 std::vector<TTindex> Children; // indexed by TimerIdT 51 std::vector<TTindex> Children; // indexed by TimerIdT
52 TTindex Parent = 0; 52 TTindex Parent = 0;
53 TimerIdT Interior = 0; 53 TimerIdT Interior = 0;
54 double Time = 0; 54 double Time = 0;
(...skipping 22 matching lines...) Expand all
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 IceString 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<IceString, TimerIdT> IDsIndex;
89 std::vector<IceString> IDs; // indexed by TimerIdT 89 std::vector<IceString> 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698