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

Unified Diff: runtime/vm/timeline.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timeline.cc
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index d510d5ee984e5f61673bd27581f87196244e130f..6b03d99fa5101720ff17a27b9c990ceb3e8e861e 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -39,7 +39,12 @@ void Timeline::InitOnce() {
recorder_ = new TimelineEventRingRecorder();
}
vm_stream_ = new TimelineStream();
- vm_stream_->Init("VM", EnableStreamByDefault("VM"));
+ vm_stream_->Init("VM", EnableStreamByDefault("VM"), NULL);
+ // Global overrides.
+#define ISOLATE_TIMELINE_STREAM_FLAG_DEFAULT(name, not_used) \
+ stream_##name##_enabled_ = false;
+ ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_FLAG_DEFAULT)
+#undef ISOLATE_TIMELINE_STREAM_FLAG_DEFAULT
}
@@ -75,6 +80,11 @@ TimelineStream* Timeline::GetVMStream() {
TimelineEventRecorder* Timeline::recorder_ = NULL;
TimelineStream* Timeline::vm_stream_ = NULL;
+#define ISOLATE_TIMELINE_STREAM_DEFINE_FLAG(name, enabled_by_default) \
+ bool Timeline::stream_##name##_enabled_ = false;
+ ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_DEFINE_FLAG)
+#undef ISOLATE_TIMELINE_STREAM_DEFINE_FLAG
+
TimelineEvent::TimelineEvent()
: timestamp0_(0),
timestamp1_(0),
@@ -311,19 +321,23 @@ int64_t TimelineEvent::TimeDuration() const {
TimelineStream::TimelineStream()
: name_(NULL),
- enabled_(false) {
+ enabled_(false),
+ globally_enabled_(NULL) {
}
-void TimelineStream::Init(const char* name, bool enabled) {
+void TimelineStream::Init(const char* name,
+ bool enabled,
+ const bool* globally_enabled) {
name_ = name;
enabled_ = enabled;
+ globally_enabled_ = globally_enabled;
}
TimelineEvent* TimelineStream::StartEvent() {
TimelineEventRecorder* recorder = Timeline::recorder();
- if (!enabled_ || (recorder == NULL)) {
+ if (!Enabled() || (recorder == NULL)) {
return NULL;
}
ASSERT(name_ != NULL);
« no previous file with comments | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698