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

Unified Diff: runtime/vm/isolate.cc

Issue 1296353002: Add --timing (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/isolate.h ('k') | runtime/vm/os_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index bb29b65f4b4f947d05078ca111b3db3bd78152b6..f20e055b79ee0918bbdcdd55147a6fb781941252 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -38,6 +38,7 @@
#include "vm/thread_interrupter.h"
#include "vm/thread_registry.h"
#include "vm/timeline.h"
+#include "vm/timeline_analysis.h"
#include "vm/timer.h"
#include "vm/visitor.h"
@@ -45,6 +46,7 @@
namespace dart {
DECLARE_FLAG(bool, print_metrics);
+DECLARE_FLAG(bool, timing);
DECLARE_FLAG(bool, trace_service);
DEFINE_FLAG(bool, trace_isolates, false,
@@ -1529,6 +1531,15 @@ void Isolate::Shutdown() {
// Dump all accumulated timer data for the isolate.
timer_list_.ReportTimers();
+ // Before analyzing the isolate's timeline blocks- close all of them.
+ CloseAllTimelineBlocks();
+
+ // Dump all timing data for the isolate.
+ if (FLAG_timing) {
+ TimelinePauseTrace tpt;
+ tpt.Print();
+ }
+
// Finalize any weak persistent handles with a non-null referent.
FinalizeWeakPersistentHandlesVisitor visitor;
api_state()->weak_persistent_handles().VisitHandles(&visitor);
@@ -1570,6 +1581,17 @@ void Isolate::Shutdown() {
}
+void Isolate::CloseAllTimelineBlocks() {
+ // Close all blocks
+ thread_registry_->CloseAllTimelineBlocks();
+ TimelineEventRecorder* recorder = Timeline::recorder();
+ if (recorder != NULL) {
+ MutexLocker ml(&recorder->lock_);
+ Thread::Current()->CloseTimelineBlock();
+ }
+}
+
+
Dart_IsolateCreateCallback Isolate::create_callback_ = NULL;
Dart_IsolateInterruptCallback Isolate::interrupt_callback_ = NULL;
Dart_IsolateUnhandledExceptionCallback
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/os_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698