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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/timeline_linux.cc ('k') | runtime/vm/timeline_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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)
OLDNEW
« 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