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

Side by Side Diff: src/IceTimerTree.h

Issue 655563005: Subzero: Enhance the timer dump format. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Reset UpdateCount as well 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/IceTimerTree.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 14 matching lines...) Expand all
25 typedef std::vector<TimerTreeNode>::size_type TTindex; 25 typedef std::vector<TimerTreeNode>::size_type TTindex;
26 26
27 // TimerTreeNode represents an interior or leaf node in the call tree. 27 // TimerTreeNode represents an interior or leaf node in the call tree.
28 // It contains a list of children, a pointer to its parent, and the 28 // It contains a list of children, a pointer to its parent, and the
29 // timer ID for the node. It also holds the cumulative time spent at 29 // timer ID for the node. It also holds the cumulative time spent at
30 // this node and below. The children are always at a higher index in 30 // this node and below. The children are always at a higher index in
31 // the TimerTreeNode::Nodes array, and the parent is always at a lower 31 // the TimerTreeNode::Nodes array, and the parent is always at a lower
32 // index. 32 // index.
33 class TimerTreeNode { 33 class TimerTreeNode {
34 public: 34 public:
35 TimerTreeNode() : Parent(0), Interior(0), Time(0) {} 35 TimerTreeNode() : Parent(0), Interior(0), Time(0), UpdateCount(0) {}
36 std::vector<TTindex> Children; // indexed by TimerIdT 36 std::vector<TTindex> Children; // indexed by TimerIdT
37 TTindex Parent; 37 TTindex Parent;
38 TimerIdT Interior; 38 TimerIdT Interior;
39 double Time; 39 double Time;
40 size_t UpdateCount;
40 }; 41 };
41 42
42 class TimerStack { 43 class TimerStack {
43 // TimerStack(const TimerStack &) = delete; 44 // TimerStack(const TimerStack &) = delete;
44 TimerStack &operator=(const TimerStack &) = delete; 45 TimerStack &operator=(const TimerStack &) = delete;
45 46
46 public: 47 public:
47 enum TimerTag { 48 enum TimerTag {
48 #define X(tag) TT_##tag, 49 #define X(tag) TT_##tag,
49 TIMERTREE_TABLE 50 TIMERTREE_TABLE
50 #undef X 51 #undef X
51 TT__num 52 TT__num
52 }; 53 };
53 TimerStack(const IceString &Name); 54 TimerStack(const IceString &Name);
54 TimerIdT getTimerID(const IceString &Name); 55 TimerIdT getTimerID(const IceString &Name);
55 void setName(const IceString &NewName) { Name = NewName; } 56 void setName(const IceString &NewName) { Name = NewName; }
56 void push(TimerIdT ID); 57 void push(TimerIdT ID);
57 void pop(TimerIdT ID); 58 void pop(TimerIdT ID);
58 void reset(); 59 void reset();
59 void dump(Ostream &Str, bool DumpCumulative); 60 void dump(Ostream &Str, bool DumpCumulative);
60 61
61 private: 62 private:
62 void update(); 63 void update(bool UpdateCounts);
63 static double timestamp(); 64 static double timestamp();
64 IceString Name; 65 IceString Name;
65 double FirstTimestamp; 66 double FirstTimestamp;
66 double LastTimestamp; 67 double LastTimestamp;
67 uint64_t StateChangeCount; 68 uint64_t StateChangeCount;
68 // IDsIndex maps a symbolic timer name to its integer ID. 69 // IDsIndex maps a symbolic timer name to its integer ID.
69 std::map<IceString, TimerIdT> IDsIndex; 70 std::map<IceString, TimerIdT> IDsIndex;
70 std::vector<IceString> IDs; // indexed by TimerIdT 71 std::vector<IceString> IDs; // indexed by TimerIdT
71 std::vector<TimerTreeNode> Nodes; // indexed by TTindex 72 std::vector<TimerTreeNode> Nodes; // indexed by TTindex
72 std::vector<double> LeafTimes; // indexed by TimerIdT 73 std::vector<double> LeafTimes; // indexed by TimerIdT
74 std::vector<size_t> LeafCounts; // indexed by TimerIdT
73 TTindex StackTop; 75 TTindex StackTop;
74 }; 76 };
75 77
76 } // end of namespace Ice 78 } // end of namespace Ice
77 79
78 #endif // SUBZERO_SRC_ICETIMERTREE_H 80 #endif // SUBZERO_SRC_ICETIMERTREE_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTimerTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698