OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_GC_TRACER_H_ | 5 #ifndef V8_GC_TRACER_H_ |
6 #define V8_GC_TRACER_H_ | 6 #define V8_GC_TRACER_H_ |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 // Start collecting data. | 195 // Start collecting data. |
196 void Start(GarbageCollector collector, const char* gc_reason, | 196 void Start(GarbageCollector collector, const char* gc_reason, |
197 const char* collector_reason); | 197 const char* collector_reason); |
198 | 198 |
199 // Stop collecting data and print results. | 199 // Stop collecting data and print results. |
200 void Stop(); | 200 void Stop(); |
201 | 201 |
202 // Log an incremental marking step. | 202 // Log an incremental marking step. |
203 void AddIncrementalMarkingStep(double duration); | 203 void AddIncrementalMarkingStep(double duration); |
204 | 204 |
205 // Compute the mean duration of the last scavenger events. | |
Hannes Payer (out of office)
2014/07/24 15:16:40
Returns 0 if no events have been recorded.
ernstm
2014/07/24 15:22:39
Done.
| |
206 double MeanScavengerDuration() const { | |
207 return MeanDuration(scavenger_events_); | |
208 } | |
209 | |
210 // Compute the max duratino of the last scavenger events. Returns 0 if no | |
Hannes Payer (out of office)
2014/07/24 15:16:40
duration
ernstm
2014/07/24 15:22:39
Done.
| |
211 // events have been recorded. | |
212 double MaxScavengerDuration() const { return MaxDuration(scavenger_events_); } | |
213 | |
214 // Compute the mean duration of the last mark compactor events. Returns 0 if | |
215 // no events have been recorded. | |
216 double MeanMarkCompactorDuration() const { | |
217 return MeanDuration(mark_compactor_events_); | |
218 } | |
219 | |
220 // Compute the max duration of the last mark compactor events. Return 0 if no | |
221 // events have been recorded. | |
222 double MaxMarkCompactorDuration() const { | |
223 return MaxDuration(mark_compactor_events_); | |
224 } | |
225 | |
226 // Compute the mean step duration of the last incremental marking round. | |
227 // Returns 0 if no incremental marking round has been completed. | |
228 double MeanIncrementalMarkingDuration() const; | |
229 | |
230 // Compute the max step duration of the last incremental marking round. | |
231 // Returns 0 if no incremental marking round has been completed. | |
232 double MaxIncrementalMarkingDuration() const; | |
233 | |
205 private: | 234 private: |
206 // Print one detailed trace line in name=value format. | 235 // Print one detailed trace line in name=value format. |
207 // TODO(ernstm): Move to Heap. | 236 // TODO(ernstm): Move to Heap. |
208 void PrintNVP() const; | 237 void PrintNVP() const; |
209 | 238 |
210 // Print one trace line. | 239 // Print one trace line. |
211 // TODO(ernstm): Move to Heap. | 240 // TODO(ernstm): Move to Heap. |
212 void Print() const; | 241 void Print() const; |
213 | 242 |
243 // Compute the mean duration of the events in the given ring buffer. | |
244 double MeanDuration(const EventBuffer& events) const; | |
245 | |
246 // Compute the max duration of the events in the given ring buffer. | |
247 double MaxDuration(const EventBuffer& events) const; | |
248 | |
214 // Pointer to the heap that owns this tracer. | 249 // Pointer to the heap that owns this tracer. |
215 Heap* heap_; | 250 Heap* heap_; |
216 | 251 |
217 // Current tracer event. Populated during Start/Stop cycle. Valid after Stop() | 252 // Current tracer event. Populated during Start/Stop cycle. Valid after Stop() |
218 // has returned. | 253 // has returned. |
219 Event current_; | 254 Event current_; |
220 | 255 |
221 // Previous tracer event. | 256 // Previous tracer event. |
222 Event previous_; | 257 Event previous_; |
223 | 258 |
(...skipping 14 matching lines...) Expand all Loading... | |
238 | 273 |
239 // Longest incremental marking step since start of marking. | 274 // Longest incremental marking step since start of marking. |
240 double longest_incremental_marking_step_; | 275 double longest_incremental_marking_step_; |
241 | 276 |
242 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 277 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
243 }; | 278 }; |
244 } | 279 } |
245 } // namespace v8::internal | 280 } // namespace v8::internal |
246 | 281 |
247 #endif // V8_GC_TRACER_H_ | 282 #endif // V8_GC_TRACER_H_ |
OLD | NEW |