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

Unified Diff: runtime/vm/isolate.cc

Issue 1170503004: Initial Timeline Events (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 40159cf9d80a7ddcdc6b3e1e0f3850e803d53236..56da593e5413512d2f66df0f312cf15e2f8df281 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -35,6 +35,7 @@
#include "vm/symbols.h"
#include "vm/tags.h"
#include "vm/thread_interrupter.h"
+#include "vm/timeline.h"
#include "vm/timer.h"
#include "vm/visitor.h"
@@ -607,6 +608,7 @@ Isolate::Isolate()
last_allocationprofile_gc_timestamp_(0),
object_id_ring_(NULL),
trace_buffer_(NULL),
+ timeline_event_buffer_(NULL),
profiler_data_(NULL),
thread_state_(NULL),
tag_table_(GrowableObjectArray::null()),
@@ -654,6 +656,7 @@ Isolate::~Isolate() {
delete compiler_stats_;
compiler_stats_ = NULL;
}
+ RemoveTimelineEventBuffer();
}
@@ -681,6 +684,12 @@ Isolate* Isolate::Init(const char* name_prefix, bool is_vm_isolate) {
ISOLATE_METRIC_LIST(ISOLATE_METRIC_INIT);
#undef ISOLATE_METRIC_INIT
+ // Initialize Timeline streams.
+#define ISOLATE_TIMELINE_STREAM_INIT(name, enabled_by_default) \
+ result->stream_##name##_.Init(#name, enabled_by_default);
+ ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_INIT);
+#undef ISOLATE_TIMELINE_STREAM_INIT
+
// TODO(5411455): For now just set the recently created isolate as
// the current isolate.
Thread::EnterIsolate(result);
@@ -1394,6 +1403,10 @@ void Isolate::Shutdown() {
OS::Print("[-] Stopping isolate:\n"
"\tisolate: %s\n", name());
}
+
+ if (timeline_event_buffer_ != NULL) {
Cutch 2015/06/05 20:18:42 Temporary
+ timeline_event_buffer_->Dump();
+ }
}
// TODO(5411455): For now just make sure there are no current isolates
@@ -1492,6 +1505,21 @@ void Isolate::VisitPrologueWeakPersistentHandles(HandleVisitor* visitor) {
}
+void Isolate::SetTimelineEventBuffer(
+ TimelineEventBuffer* timeline_event_buffer) {
+#define ISOLATE_TIMELINE_STREAM_SET_BUFFER(name, enabled_by_default) \
+ stream_##name##_.set_buffer(timeline_event_buffer);
+ ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_SET_BUFFER)
+#undef ISOLATE_TIMELINE_STREAM_SET_BUFFER
+ timeline_event_buffer_ = timeline_event_buffer;
+}
+
+void Isolate::RemoveTimelineEventBuffer() {
+ SetTimelineEventBuffer(NULL);
+ delete timeline_event_buffer_;
+}
+
+
void Isolate::PrintJSON(JSONStream* stream, bool ref) {
JSONObject jsobj(stream);
jsobj.AddProperty("type", (ref ? "@Isolate" : "Isolate"));
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | runtime/vm/timeline.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698