OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 #include "platform/globals.h" |
| 6 #if defined(HOST_OS_MACOS) && !defined(PRODUCT) |
| 7 |
| 8 #include "vm/timeline.h" |
| 9 |
| 10 namespace dart { |
| 11 |
| 12 TimelineEventPlatformRecorder::TimelineEventPlatformRecorder(intptr_t capacity) |
| 13 : TimelineEventFixedBufferRecorder(capacity) { |
| 14 OS::PrintErr( |
| 15 "Warning: The systrace timeline recorder is equivalent to the" |
| 16 "ring recorder on this platform."); |
| 17 } |
| 18 |
| 19 TimelineEventPlatformRecorder::~TimelineEventPlatformRecorder() {} |
| 20 |
| 21 TimelineEventPlatformRecorder* |
| 22 TimelineEventPlatformRecorder::CreatePlatformRecorder(intptr_t capacity) { |
| 23 return new TimelineEventPlatformRecorder(capacity); |
| 24 } |
| 25 |
| 26 const char* TimelineEventPlatformRecorder::name() const { |
| 27 return "Systrace"; |
| 28 } |
| 29 |
| 30 TimelineEventBlock* TimelineEventPlatformRecorder::GetNewBlockLocked() { |
| 31 // TODO(johnmccutchan): This function should only hand out blocks |
| 32 // which have been marked as finished. |
| 33 if (block_cursor_ == num_blocks_) { |
| 34 block_cursor_ = 0; |
| 35 } |
| 36 TimelineEventBlock* block = blocks_[block_cursor_++]; |
| 37 block->Reset(); |
| 38 block->Open(); |
| 39 return block; |
| 40 } |
| 41 |
| 42 void TimelineEventPlatformRecorder::CompleteEvent(TimelineEvent* event) { |
| 43 if (event == NULL) { |
| 44 return; |
| 45 } |
| 46 ThreadBlockCompleteEvent(event); |
| 47 } |
| 48 |
| 49 void DartTimelineEventHelpers::ReportTaskEvent(Thread* thread, |
| 50 Zone* zone, |
| 51 TimelineEvent* event, |
| 52 int64_t start, |
| 53 int64_t id, |
| 54 const char* phase, |
| 55 const char* category, |
| 56 const char* name, |
| 57 const char* args) { |
| 58 DartCommonTimelineEventHelpers::ReportTaskEvent( |
| 59 thread, zone, event, start, id, phase, category, name, args); |
| 60 } |
| 61 |
| 62 void DartTimelineEventHelpers::ReportCompleteEvent(Thread* thread, |
| 63 Zone* zone, |
| 64 TimelineEvent* event, |
| 65 int64_t start, |
| 66 int64_t start_cpu, |
| 67 const char* category, |
| 68 const char* name, |
| 69 const char* args) { |
| 70 DartCommonTimelineEventHelpers::ReportCompleteEvent( |
| 71 thread, zone, event, start, start_cpu, category, name, args); |
| 72 } |
| 73 |
| 74 void DartTimelineEventHelpers::ReportInstantEvent(Thread* thread, |
| 75 Zone* zone, |
| 76 TimelineEvent* event, |
| 77 int64_t start, |
| 78 const char* category, |
| 79 const char* name, |
| 80 const char* args) { |
| 81 DartCommonTimelineEventHelpers::ReportInstantEvent(thread, zone, event, start, |
| 82 category, name, args); |
| 83 } |
| 84 |
| 85 } // namespace dart |
| 86 |
| 87 #endif // defined(HOST_OS_MACOS) && !defined(PRODUCT) |
OLD | NEW |