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

Side by Side Diff: runtime/vm/timeline_analysis.h

Issue 1297443002: Improve timeline iterators and tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « runtime/vm/timeline.cc ('k') | runtime/vm/timeline_analysis.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_TIMELINE_ANALYSIS_H_ 5 #ifndef VM_TIMELINE_ANALYSIS_H_
6 #define VM_TIMELINE_ANALYSIS_H_ 6 #define VM_TIMELINE_ANALYSIS_H_
7 7
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/timeline.h" 9 #include "vm/timeline.h"
10 10
(...skipping 20 matching lines...) Expand all
31 void AddBlock(TimelineEventBlock* block); 31 void AddBlock(TimelineEventBlock* block);
32 void Finalize(); 32 void Finalize();
33 33
34 const ThreadId id_; 34 const ThreadId id_;
35 ZoneGrowableArray<TimelineEventBlock*> blocks_; 35 ZoneGrowableArray<TimelineEventBlock*> blocks_;
36 36
37 friend class TimelineAnalysis; 37 friend class TimelineAnalysis;
38 }; 38 };
39 39
40 40
41 class TimelineAnalysisThreadEventIterator : public ValueObject {
42 public:
43 explicit TimelineAnalysisThreadEventIterator(TimelineAnalysisThread* thread);
44 ~TimelineAnalysisThreadEventIterator();
45
46 void Reset(TimelineAnalysisThread* thread);
47
48 bool HasNext() const;
49
50 TimelineEvent* Next();
51
52 private:
53 TimelineAnalysisThread* thread_;
54 TimelineEvent* current_;
55 intptr_t block_cursor_;
56 intptr_t event_cursor_;
57 };
58
59
41 // Base of all timeline analysis classes. Base functionality: 60 // Base of all timeline analysis classes. Base functionality:
42 // - discovery of all thread ids in a recording. 61 // - discovery of all thread ids in a recording.
43 // - collecting all ThreadEventBlocks by thread id. 62 // - collecting all ThreadEventBlocks by thread id.
44 class TimelineAnalysis : public ValueObject { 63 class TimelineAnalysis : public ValueObject {
45 public: 64 public:
46 TimelineAnalysis(Zone* zone, 65 TimelineAnalysis(Zone* zone,
47 Isolate* isolate, 66 Isolate* isolate,
48 TimelineEventRecorder* recorder); 67 TimelineEventRecorder* recorder);
49 ~TimelineAnalysis(); 68 ~TimelineAnalysis();
50 69
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 103
85 ZoneGrowableArray<TimelineAnalysisThread*> threads_; 104 ZoneGrowableArray<TimelineAnalysisThread*> threads_;
86 }; 105 };
87 106
88 107
89 class TimelinePauses : public TimelineAnalysis { 108 class TimelinePauses : public TimelineAnalysis {
90 public: 109 public:
91 TimelinePauses(Zone* zone, 110 TimelinePauses(Zone* zone,
92 Isolate* isolate, 111 Isolate* isolate,
93 TimelineEventRecorder* recorder); 112 TimelineEventRecorder* recorder);
113
114 void CalculatePauseTimes();
115
94 private: 116 private:
95 }; 117 };
96 118
97 } // namespace dart 119 } // namespace dart
98 120
99 #endif // VM_TIMELINE_ANALYSIS_H_ 121 #endif // VM_TIMELINE_ANALYSIS_H_
OLDNEW
« no previous file with comments | « runtime/vm/timeline.cc ('k') | runtime/vm/timeline_analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698