| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Shutdown timeline system. Not thread safe. | 43 // Shutdown timeline system. Not thread safe. |
| 44 static void Shutdown(); | 44 static void Shutdown(); |
| 45 | 45 |
| 46 // Access the global recorder. Not thread safe. | 46 // Access the global recorder. Not thread safe. |
| 47 static TimelineEventRecorder* recorder(); | 47 static TimelineEventRecorder* recorder(); |
| 48 | 48 |
| 49 static bool EnableStreamByDefault(const char* stream_name); | 49 static bool EnableStreamByDefault(const char* stream_name); |
| 50 | 50 |
| 51 static TimelineStream* GetVMStream(); | 51 static TimelineStream* GetVMStream(); |
| 52 | 52 |
| 53 static TimelineStream* GetVMApiStream(); |
| 54 |
| 53 // Reclaim all |TimelineEventBlocks|s that are cached by threads. | 55 // Reclaim all |TimelineEventBlocks|s that are cached by threads. |
| 54 static void ReclaimCachedBlocksFromThreads(); | 56 static void ReclaimCachedBlocksFromThreads(); |
| 55 | 57 |
| 56 static void Clear(); | 58 static void Clear(); |
| 57 | 59 |
| 58 #define ISOLATE_TIMELINE_STREAM_FLAGS(name, not_used) \ | 60 #define ISOLATE_TIMELINE_STREAM_FLAGS(name, not_used) \ |
| 59 static const bool* Stream##name##EnabledFlag() { \ | 61 static const bool* Stream##name##EnabledFlag() { \ |
| 60 return &stream_##name##_enabled_; \ | 62 return &stream_##name##_enabled_; \ |
| 61 } \ | 63 } \ |
| 62 static void SetStream##name##Enabled(bool enabled) { \ | 64 static void SetStream##name##Enabled(bool enabled) { \ |
| 63 stream_##name##_enabled_ = enabled; \ | 65 stream_##name##_enabled_ = enabled; \ |
| 64 } | 66 } |
| 65 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_FLAGS) | 67 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_FLAGS) |
| 66 #undef ISOLATE_TIMELINE_STREAM_FLAGS | 68 #undef ISOLATE_TIMELINE_STREAM_FLAGS |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 static TimelineEventRecorder* recorder_; | 71 static TimelineEventRecorder* recorder_; |
| 70 static TimelineStream* vm_stream_; | 72 static TimelineStream* vm_stream_; |
| 73 static TimelineStream* vm_api_stream_; |
| 71 | 74 |
| 72 #define ISOLATE_TIMELINE_STREAM_DECLARE_FLAG(name, not_used) \ | 75 #define ISOLATE_TIMELINE_STREAM_DECLARE_FLAG(name, not_used) \ |
| 73 static bool stream_##name##_enabled_; | 76 static bool stream_##name##_enabled_; |
| 74 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_DECLARE_FLAG) | 77 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_DECLARE_FLAG) |
| 75 #undef ISOLATE_TIMELINE_STREAM_DECLARE_FLAG | 78 #undef ISOLATE_TIMELINE_STREAM_DECLARE_FLAG |
| 76 | 79 |
| 77 friend class TimelineRecorderOverride; | 80 friend class TimelineRecorderOverride; |
| 78 friend class ReclaimBlocksIsolateVisitor; | 81 friend class ReclaimBlocksIsolateVisitor; |
| 79 }; | 82 }; |
| 80 | 83 |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 | 708 |
| 706 private: | 709 private: |
| 707 TimelineEventBlock* current_; | 710 TimelineEventBlock* current_; |
| 708 TimelineEventRecorder* recorder_; | 711 TimelineEventRecorder* recorder_; |
| 709 }; | 712 }; |
| 710 | 713 |
| 711 | 714 |
| 712 } // namespace dart | 715 } // namespace dart |
| 713 | 716 |
| 714 #endif // VM_TIMELINE_H_ | 717 #endif // VM_TIMELINE_H_ |
| OLD | NEW |