Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1247)

Unified Diff: runtime/vm/timeline_macos.cc

Issue 2984603002: Special-case Timeline.{start,finish}Sync for Fuchsia (Closed)
Patch Set: Address comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/timeline_linux.cc ('k') | runtime/vm/timeline_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timeline_macos.cc
diff --git a/runtime/vm/timeline_macos.cc b/runtime/vm/timeline_macos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..18c13118d1d603e281d844386108c450deae5eaf
--- /dev/null
+++ b/runtime/vm/timeline_macos.cc
@@ -0,0 +1,87 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(HOST_OS_MACOS) && !defined(PRODUCT)
+
+#include "vm/timeline.h"
+
+namespace dart {
+
+TimelineEventPlatformRecorder::TimelineEventPlatformRecorder(intptr_t capacity)
+ : TimelineEventFixedBufferRecorder(capacity) {
+ OS::PrintErr(
+ "Warning: The systrace timeline recorder is equivalent to the"
+ "ring recorder on this platform.");
+}
+
+TimelineEventPlatformRecorder::~TimelineEventPlatformRecorder() {}
+
+TimelineEventPlatformRecorder*
+TimelineEventPlatformRecorder::CreatePlatformRecorder(intptr_t capacity) {
+ return new TimelineEventPlatformRecorder(capacity);
+}
+
+const char* TimelineEventPlatformRecorder::name() const {
+ return "Systrace";
+}
+
+TimelineEventBlock* TimelineEventPlatformRecorder::GetNewBlockLocked() {
+ // TODO(johnmccutchan): This function should only hand out blocks
+ // which have been marked as finished.
+ if (block_cursor_ == num_blocks_) {
+ block_cursor_ = 0;
+ }
+ TimelineEventBlock* block = blocks_[block_cursor_++];
+ block->Reset();
+ block->Open();
+ return block;
+}
+
+void TimelineEventPlatformRecorder::CompleteEvent(TimelineEvent* event) {
+ if (event == NULL) {
+ return;
+ }
+ ThreadBlockCompleteEvent(event);
+}
+
+void DartTimelineEventHelpers::ReportTaskEvent(Thread* thread,
+ Zone* zone,
+ TimelineEvent* event,
+ int64_t start,
+ int64_t id,
+ const char* phase,
+ const char* category,
+ const char* name,
+ const char* args) {
+ DartCommonTimelineEventHelpers::ReportTaskEvent(
+ thread, zone, event, start, id, phase, category, name, args);
+}
+
+void DartTimelineEventHelpers::ReportCompleteEvent(Thread* thread,
+ Zone* zone,
+ TimelineEvent* event,
+ int64_t start,
+ int64_t start_cpu,
+ const char* category,
+ const char* name,
+ const char* args) {
+ DartCommonTimelineEventHelpers::ReportCompleteEvent(
+ thread, zone, event, start, start_cpu, category, name, args);
+}
+
+void DartTimelineEventHelpers::ReportInstantEvent(Thread* thread,
+ Zone* zone,
+ TimelineEvent* event,
+ int64_t start,
+ const char* category,
+ const char* name,
+ const char* args) {
+ DartCommonTimelineEventHelpers::ReportInstantEvent(thread, zone, event, start,
+ category, name, args);
+}
+
+} // namespace dart
+
+#endif // defined(HOST_OS_MACOS) && !defined(PRODUCT)
« no previous file with comments | « runtime/vm/timeline_linux.cc ('k') | runtime/vm/timeline_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698