OLD | NEW |
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_H_ | 5 #ifndef VM_TIMELINE_H_ |
6 #define VM_TIMELINE_H_ | 6 #define VM_TIMELINE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/bitfield.h" | 9 #include "vm/bitfield.h" |
10 #include "vm/os.h" | 10 #include "vm/os.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 char* value; | 87 char* value; |
88 }; | 88 }; |
89 | 89 |
90 | 90 |
91 // You should get a |TimelineEvent| from a |TimelineStream|. | 91 // You should get a |TimelineEvent| from a |TimelineStream|. |
92 class TimelineEvent { | 92 class TimelineEvent { |
93 public: | 93 public: |
94 // Keep in sync with StateBits below. | 94 // Keep in sync with StateBits below. |
95 enum EventType { | 95 enum EventType { |
96 kNone, | 96 kNone, |
97 kSerializedJSON, // Events from Dart code. | |
98 kBegin, | 97 kBegin, |
99 kEnd, | 98 kEnd, |
100 kDuration, | 99 kDuration, |
101 kInstant, | 100 kInstant, |
102 kAsyncBegin, | 101 kAsyncBegin, |
103 kAsyncInstant, | 102 kAsyncInstant, |
104 kAsyncEnd, | 103 kAsyncEnd, |
105 kNumEventTypes, | 104 kNumEventTypes, |
106 }; | 105 }; |
107 | 106 |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 const char* label); | 379 const char* label); |
381 | 380 |
382 TimelineEventScope(Thread* thread, | 381 TimelineEventScope(Thread* thread, |
383 TimelineStream* stream, | 382 TimelineStream* stream, |
384 const char* label); | 383 const char* label); |
385 | 384 |
386 bool ShouldEmitEvent() const { | 385 bool ShouldEmitEvent() const { |
387 return enabled_; | 386 return enabled_; |
388 } | 387 } |
389 | 388 |
| 389 void set_enabled(bool enabled) { |
| 390 enabled_ = enabled; |
| 391 } |
| 392 |
390 const char* label() const { | 393 const char* label() const { |
391 return label_; | 394 return label_; |
392 } | 395 } |
393 | 396 |
394 TimelineStream* stream() const { | 397 TimelineStream* stream() const { |
395 return stream_; | 398 return stream_; |
396 } | 399 } |
397 | 400 |
398 virtual ~TimelineEventScope(); | 401 virtual ~TimelineEventScope(); |
399 | 402 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 | 746 |
744 private: | 747 private: |
745 TimelineEventBlock* current_; | 748 TimelineEventBlock* current_; |
746 TimelineEventRecorder* recorder_; | 749 TimelineEventRecorder* recorder_; |
747 }; | 750 }; |
748 | 751 |
749 | 752 |
750 } // namespace dart | 753 } // namespace dart |
751 | 754 |
752 #endif // VM_TIMELINE_H_ | 755 #endif // VM_TIMELINE_H_ |
OLD | NEW |