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. Returns 0 if no |
| 206 // events have been recorded. |
| 207 double MeanScavengerDuration() const { |
| 208 return MeanDuration(scavenger_events_); |
| 209 } |
| 210 |
| 211 // Compute the max duration of the last scavenger events. Returns 0 if no |
| 212 // events have been recorded. |
| 213 double MaxScavengerDuration() const { return MaxDuration(scavenger_events_); } |
| 214 |
| 215 // Compute the mean duration of the last mark compactor events. Returns 0 if |
| 216 // no events have been recorded. |
| 217 double MeanMarkCompactorDuration() const { |
| 218 return MeanDuration(mark_compactor_events_); |
| 219 } |
| 220 |
| 221 // Compute the max duration of the last mark compactor events. Return 0 if no |
| 222 // events have been recorded. |
| 223 double MaxMarkCompactorDuration() const { |
| 224 return MaxDuration(mark_compactor_events_); |
| 225 } |
| 226 |
| 227 // Compute the mean step duration of the last incremental marking round. |
| 228 // Returns 0 if no incremental marking round has been completed. |
| 229 double MeanIncrementalMarkingDuration() const; |
| 230 |
| 231 // Compute the max step duration of the last incremental marking round. |
| 232 // Returns 0 if no incremental marking round has been completed. |
| 233 double MaxIncrementalMarkingDuration() const; |
| 234 |
205 private: | 235 private: |
206 // Print one detailed trace line in name=value format. | 236 // Print one detailed trace line in name=value format. |
207 // TODO(ernstm): Move to Heap. | 237 // TODO(ernstm): Move to Heap. |
208 void PrintNVP() const; | 238 void PrintNVP() const; |
209 | 239 |
210 // Print one trace line. | 240 // Print one trace line. |
211 // TODO(ernstm): Move to Heap. | 241 // TODO(ernstm): Move to Heap. |
212 void Print() const; | 242 void Print() const; |
213 | 243 |
| 244 // Compute the mean duration of the events in the given ring buffer. |
| 245 double MeanDuration(const EventBuffer& events) const; |
| 246 |
| 247 // Compute the max duration of the events in the given ring buffer. |
| 248 double MaxDuration(const EventBuffer& events) const; |
| 249 |
214 // Pointer to the heap that owns this tracer. | 250 // Pointer to the heap that owns this tracer. |
215 Heap* heap_; | 251 Heap* heap_; |
216 | 252 |
217 // Current tracer event. Populated during Start/Stop cycle. Valid after Stop() | 253 // Current tracer event. Populated during Start/Stop cycle. Valid after Stop() |
218 // has returned. | 254 // has returned. |
219 Event current_; | 255 Event current_; |
220 | 256 |
221 // Previous tracer event. | 257 // Previous tracer event. |
222 Event previous_; | 258 Event previous_; |
223 | 259 |
(...skipping 14 matching lines...) Expand all Loading... |
238 | 274 |
239 // Longest incremental marking step since start of marking. | 275 // Longest incremental marking step since start of marking. |
240 double longest_incremental_marking_step_; | 276 double longest_incremental_marking_step_; |
241 | 277 |
242 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 278 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
243 }; | 279 }; |
244 } | 280 } |
245 } // namespace v8::internal | 281 } // namespace v8::internal |
246 | 282 |
247 #endif // V8_GC_TRACER_H_ | 283 #endif // V8_GC_TRACER_H_ |
OLD | NEW |