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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 1362503002: Add global timeline stream overrides (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/include/dart_tools_api.h ('k') | runtime/vm/dart_api_impl_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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 5674 matching lines...) Expand 10 before | Expand all | Expand 10 after
5685 (stream_mask & DART_TIMELINE_STREAM_COMPILER) != 0); 5685 (stream_mask & DART_TIMELINE_STREAM_COMPILER) != 0);
5686 isolate->GetEmbedderStream()->set_enabled( 5686 isolate->GetEmbedderStream()->set_enabled(
5687 (stream_mask & DART_TIMELINE_STREAM_EMBEDDER) != 0); 5687 (stream_mask & DART_TIMELINE_STREAM_EMBEDDER) != 0);
5688 isolate->GetGCStream()->set_enabled( 5688 isolate->GetGCStream()->set_enabled(
5689 (stream_mask & DART_TIMELINE_STREAM_GC) != 0); 5689 (stream_mask & DART_TIMELINE_STREAM_GC) != 0);
5690 isolate->GetIsolateStream()->set_enabled( 5690 isolate->GetIsolateStream()->set_enabled(
5691 (stream_mask & DART_TIMELINE_STREAM_ISOLATE) != 0); 5691 (stream_mask & DART_TIMELINE_STREAM_ISOLATE) != 0);
5692 } 5692 }
5693 5693
5694 5694
5695 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask) {
5696 // Per isolate overrides.
5697 const bool api_enabled = (stream_mask & DART_TIMELINE_STREAM_API) != 0;
5698 const bool compiler_enabled =
5699 (stream_mask & DART_TIMELINE_STREAM_COMPILER) != 0;
5700 const bool embedder_enabled =
5701 (stream_mask & DART_TIMELINE_STREAM_EMBEDDER) != 0;
5702 const bool gc_enabled = (stream_mask & DART_TIMELINE_STREAM_GC) != 0;
5703 const bool isolate_enabled =
5704 (stream_mask & DART_TIMELINE_STREAM_ISOLATE) != 0;
5705 Timeline::SetStreamAPIEnabled(api_enabled);
5706 Timeline::SetStreamCompilerEnabled(compiler_enabled);
5707 Timeline::SetStreamEmbedderEnabled(embedder_enabled);
5708 Timeline::SetStreamGCEnabled(gc_enabled);
5709 Timeline::SetStreamIsolateEnabled(isolate_enabled);
5710 // VM wide.
5711 const bool vm_enabled =
5712 (stream_mask & DART_TIMELINE_STREAM_VM) != 0;
5713 Timeline::GetVMStream()->set_enabled(vm_enabled);
5714 }
5715
5716
5695 DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer, 5717 DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer,
5696 void* user_data) { 5718 void* user_data) {
5697 Isolate* isolate = Isolate::Current(); 5719 Isolate* isolate = Isolate::Current();
5698 CHECK_ISOLATE(isolate); 5720 CHECK_ISOLATE(isolate);
5699 if (consumer == NULL) { 5721 if (consumer == NULL) {
5700 return false; 5722 return false;
5701 } 5723 }
5702 TimelineEventRecorder* timeline_recorder = Timeline::recorder(); 5724 TimelineEventRecorder* timeline_recorder = Timeline::recorder();
5703 if (timeline_recorder == NULL) { 5725 if (timeline_recorder == NULL) {
5704 // Nothing has been recorded. 5726 // Nothing has been recorded.
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
5935 ApiReallocate); 5957 ApiReallocate);
5936 writer.WriteFullSnapshot(); 5958 writer.WriteFullSnapshot();
5937 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); 5959 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
5938 *isolate_snapshot_size = writer.IsolateSnapshotSize(); 5960 *isolate_snapshot_size = writer.IsolateSnapshotSize();
5939 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); 5961 *instructions_snapshot_size = writer.InstructionsSnapshotSize();
5940 5962
5941 return Api::Success(); 5963 return Api::Success();
5942 } 5964 }
5943 5965
5944 } // namespace dart 5966 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_tools_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698