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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1294023009: Switch to a VM wide timeline recorder (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 037033173c6357f5528f18117de8af2d0a22685c..47a410f7630531cf08574c11142cf5dfaf1f8ab1 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -5854,7 +5854,7 @@ DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer,
if (consumer == NULL) {
return false;
}
- TimelineEventRecorder* timeline_recorder = isolate->timeline_event_recorder();
+ TimelineEventRecorder* timeline_recorder = Timeline::recorder();
if (timeline_recorder == NULL) {
// Nothing has been recorded.
return false;
@@ -5862,7 +5862,8 @@ DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer,
// Suspend execution of other threads while serializing to JSON.
isolate->thread_registry()->SafepointThreads();
JSONStream js;
- timeline_recorder->PrintJSON(&js);
+ IsolateTimelineEventFilter filter(isolate);
+ timeline_recorder->PrintJSON(&js, &filter);
// Resume execution of other threads.
isolate->thread_registry()->ResumeAllThreads();
@@ -5975,7 +5976,10 @@ DART_EXPORT Dart_Handle Dart_TimelineAsyncBegin(const char* label,
ASSERT(stream != NULL);
TimelineEvent* event = stream->StartEvent();
if (event != NULL) {
- *async_id = event->AsyncBegin(label);
+ TimelineEventRecorder* recorder = Timeline::recorder();
+ ASSERT(recorder != NULL);
+ *async_id = recorder->GetNextAsyncId();
+ event->AsyncBegin(label, *async_id);
event->Complete();
}
return Api::Success();
« runtime/vm/dart.cc ('K') | « runtime/vm/dart.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698