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

Side by Side Diff: runtime/vm/timeline.h

Issue 1849643002: Add support for async, metadata, and counter timeline events to be reported by the embedder (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/dart_api_impl_test.cc ('k') | runtime/vm/timeline.cc » ('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 #ifndef VM_TIMELINE_H_ 5 #ifndef VM_TIMELINE_H_
6 #define VM_TIMELINE_H_ 6 #define VM_TIMELINE_H_
7 7
8 #include "include/dart_tools_api.h" 8 #include "include/dart_tools_api.h"
9 9
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // Keep in sync with StateBits below. 121 // Keep in sync with StateBits below.
122 enum EventType { 122 enum EventType {
123 kNone, 123 kNone,
124 kBegin, 124 kBegin,
125 kEnd, 125 kEnd,
126 kDuration, 126 kDuration,
127 kInstant, 127 kInstant,
128 kAsyncBegin, 128 kAsyncBegin,
129 kAsyncInstant, 129 kAsyncInstant,
130 kAsyncEnd, 130 kAsyncEnd,
131 kCounter,
132 kMetadata,
131 kNumEventTypes, 133 kNumEventTypes,
132 }; 134 };
133 135
134 TimelineEvent(); 136 TimelineEvent();
135 ~TimelineEvent(); 137 ~TimelineEvent();
136 138
137 void Reset(); 139 void Reset();
138 140
139 bool IsValid() const { 141 bool IsValid() const {
140 return (event_type() > kNone) && (event_type() < kNumEventTypes); 142 return (event_type() > kNone) && (event_type() < kNumEventTypes);
(...skipping 21 matching lines...) Expand all
162 void Duration(const char* label, 164 void Duration(const char* label,
163 int64_t start_micros, 165 int64_t start_micros,
164 int64_t end_micros); 166 int64_t end_micros);
165 167
166 void Begin(const char* label, 168 void Begin(const char* label,
167 int64_t micros = OS::GetCurrentMonotonicMicros()); 169 int64_t micros = OS::GetCurrentMonotonicMicros());
168 170
169 void End(const char* label, 171 void End(const char* label,
170 int64_t micros = OS::GetCurrentMonotonicMicros()); 172 int64_t micros = OS::GetCurrentMonotonicMicros());
171 173
174 void Counter(const char* label,
175 int64_t micros = OS::GetCurrentMonotonicMicros());
176
177 void Metadata(const char* label,
178 int64_t micros = OS::GetCurrentMonotonicMicros());
179
172 // Completes this event with pre-serialized JSON. Copies |json|. 180 // Completes this event with pre-serialized JSON. Copies |json|.
173 void CompleteWithPreSerializedJSON(const char* json); 181 void CompleteWithPreSerializedJSON(const char* json);
174 182
175 // Set the number of arguments in the event. 183 // Set the number of arguments in the event.
176 void SetNumArguments(intptr_t length); 184 void SetNumArguments(intptr_t length);
177 // |name| must be a compile time constant. Takes ownership of |argument|. 185 // |name| must be a compile time constant. Takes ownership of |argument|.
178 void SetArgument(intptr_t i, const char* name, char* argument); 186 void SetArgument(intptr_t i, const char* name, char* argument);
179 // |name| must be a compile time constant. Copies |argument|. 187 // |name| must be a compile time constant. Copies |argument|.
180 void CopyArgument(intptr_t i, const char* name, const char* argument); 188 void CopyArgument(intptr_t i, const char* name, const char* argument);
181 // |name| must be a compile time constant. 189 // |name| must be a compile time constant.
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 838
831 private: 839 private:
832 TimelineEventBlock* current_; 840 TimelineEventBlock* current_;
833 TimelineEventRecorder* recorder_; 841 TimelineEventRecorder* recorder_;
834 }; 842 };
835 843
836 844
837 } // namespace dart 845 } // namespace dart
838 846
839 #endif // VM_TIMELINE_H_ 847 #endif // VM_TIMELINE_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698