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

Unified Diff: runtime/vm/timeline.cc

Issue 1678203002: Remove more feature in product mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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') | runtime/vm/timeline_analysis.cc » ('j') | 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 899bad464e0e96b94aac843d3bdc164a3deda205..8fb0768800b07af5f3d3883b9dc1f6ba56964e9d 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -15,6 +15,8 @@
namespace dart {
+#ifndef PRODUCT
+
DEFINE_FLAG(bool, complete_timeline, false, "Record the complete timeline");
DEFINE_FLAG(bool, trace_timeline, false,
"Trace timeline backend");
@@ -668,6 +670,9 @@ void TimelineEventScope::StealArguments(TimelineEvent* event) {
TimelineDurationScope::TimelineDurationScope(TimelineStream* stream,
const char* label)
: TimelineEventScope(stream, label) {
+ if (!FLAG_support_timeline) {
+ return;
+ }
timestamp_ = OS::GetCurrentMonotonicMicros();
}
@@ -676,11 +681,17 @@ TimelineDurationScope::TimelineDurationScope(Thread* thread,
TimelineStream* stream,
const char* label)
: TimelineEventScope(thread, stream, label) {
+ if (!FLAG_support_timeline) {
+ return;
+ }
timestamp_ = OS::GetCurrentMonotonicMicros();
}
TimelineDurationScope::~TimelineDurationScope() {
+ if (!FLAG_support_timeline) {
+ return;
+ }
if (!ShouldEmitEvent()) {
return;
}
@@ -700,6 +711,9 @@ TimelineDurationScope::~TimelineDurationScope() {
TimelineBeginEndScope::TimelineBeginEndScope(TimelineStream* stream,
const char* label)
: TimelineEventScope(stream, label) {
+ if (!FLAG_support_timeline) {
+ return;
+ }
EmitBegin();
}
@@ -708,16 +722,25 @@ TimelineBeginEndScope::TimelineBeginEndScope(Thread* thread,
TimelineStream* stream,
const char* label)
: TimelineEventScope(thread, stream, label) {
+ if (!FLAG_support_timeline) {
+ return;
+ }
EmitBegin();
}
TimelineBeginEndScope::~TimelineBeginEndScope() {
+ if (!FLAG_support_timeline) {
+ return;
+ }
EmitEnd();
}
void TimelineBeginEndScope::EmitBegin() {
+ if (!FLAG_support_timeline) {
+ return;
+ }
if (!ShouldEmitEvent()) {
return;
}
@@ -735,6 +758,9 @@ void TimelineBeginEndScope::EmitBegin() {
void TimelineBeginEndScope::EmitEnd() {
+ if (!FLAG_support_timeline) {
+ return;
+ }
if (!ShouldEmitEvent()) {
return;
}
@@ -1380,4 +1406,6 @@ TimelineEventBlock* TimelineEventBlockIterator::Next() {
return r;
}
+#endif // !PRODUCT
+
} // namespace dart
« no previous file with comments | « runtime/vm/timeline.h ('k') | runtime/vm/timeline_analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698