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

Side by Side Diff: runtime/lib/timeline.cc

Issue 2985253002: [corelib] dart:developer timeline flow events (Closed)
Patch Set: Update changelog Created 3 years, 4 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 | « pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart ('k') | runtime/lib/timeline.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/native_entry.h" 9 #include "vm/native_entry.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return Object::null(); 103 return Object::null();
104 } 104 }
105 105
106 DartTimelineEventHelpers::ReportCompleteEvent( 106 DartTimelineEventHelpers::ReportCompleteEvent(
107 thread, zone, event, start.AsInt64Value(), start_cpu.AsInt64Value(), 107 thread, zone, event, start.AsInt64Value(), start_cpu.AsInt64Value(),
108 category.ToCString(), name.ToCString(), args.ToCString()); 108 category.ToCString(), name.ToCString(), args.ToCString());
109 #endif // !defined(PRODUCT) 109 #endif // !defined(PRODUCT)
110 return Object::null(); 110 return Object::null();
111 } 111 }
112 112
113 DEFINE_NATIVE_ENTRY(Timeline_reportFlowEvent, 7) {
114 #ifndef PRODUCT
115 if (!FLAG_support_timeline) {
116 return Object::null();
117 }
118 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0));
119 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start_cpu, arguments->NativeArgAt(1));
120 GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(2));
121 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(3));
122 GET_NON_NULL_NATIVE_ARGUMENT(Integer, type, arguments->NativeArgAt(4));
123 GET_NON_NULL_NATIVE_ARGUMENT(Integer, flow_id, arguments->NativeArgAt(5));
124 GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(6));
125
126 TimelineEventRecorder* recorder = Timeline::recorder();
127 if (recorder == NULL) {
128 return Object::null();
129 }
130
131 TimelineEvent* event = Timeline::GetDartStream()->StartEvent();
132 if (event == NULL) {
133 // Stream was turned off.
134 return Object::null();
135 }
136
137 DartTimelineEventHelpers::ReportFlowEvent(
138 thread, zone, event, start.AsInt64Value(), start_cpu.AsInt64Value(),
139 category.ToCString(), name.ToCString(), type.AsInt64Value(),
140 flow_id.AsInt64Value(), args.ToCString());
141 #endif // !defined(PRODUCT)
142 return Object::null();
143 }
144
113 DEFINE_NATIVE_ENTRY(Timeline_reportInstantEvent, 4) { 145 DEFINE_NATIVE_ENTRY(Timeline_reportInstantEvent, 4) {
114 #ifndef PRODUCT 146 #ifndef PRODUCT
115 if (!FLAG_support_timeline) { 147 if (!FLAG_support_timeline) {
116 return Object::null(); 148 return Object::null();
117 } 149 }
118 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0)); 150 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0));
119 GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(1)); 151 GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(1));
120 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(2)); 152 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(2));
121 GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(3)); 153 GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(3));
122 154
123 TimelineEventRecorder* recorder = Timeline::recorder(); 155 TimelineEventRecorder* recorder = Timeline::recorder();
124 if (recorder == NULL) { 156 if (recorder == NULL) {
125 return Object::null(); 157 return Object::null();
126 } 158 }
127 159
128 TimelineEvent* event = Timeline::GetDartStream()->StartEvent(); 160 TimelineEvent* event = Timeline::GetDartStream()->StartEvent();
129 if (event == NULL) { 161 if (event == NULL) {
130 // Stream was turned off. 162 // Stream was turned off.
131 return Object::null(); 163 return Object::null();
132 } 164 }
133 165
134 DartTimelineEventHelpers::ReportInstantEvent( 166 DartTimelineEventHelpers::ReportInstantEvent(
135 thread, zone, event, start.AsInt64Value(), category.ToCString(), 167 thread, zone, event, start.AsInt64Value(), category.ToCString(),
136 name.ToCString(), args.ToCString()); 168 name.ToCString(), args.ToCString());
137 #endif 169 #endif
138 return Object::null(); 170 return Object::null();
139 } 171 }
140 172
141 } // namespace dart 173 } // namespace dart
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart ('k') | runtime/lib/timeline.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698