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

Unified Diff: runtime/vm/isolate.cc

Issue 1294023009: Switch to a VM wide timeline recorder (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 9825341b4d3460dde8b9efe5e0ed59308dea2938..690b1722c9ad5f03c4a6fc5295d27c5c61ee0b88 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -44,6 +44,8 @@
namespace dart {
+DECLARE_FLAG(charp, timeline_trace_dir);
+
DEFINE_FLAG(bool, trace_isolates, false,
"Trace isolate creation and shut down.");
DEFINE_FLAG(bool, pause_isolates_on_start, false,
@@ -57,9 +59,6 @@ DEFINE_FLAG(charp, isolate_log_filter, NULL,
"Log isolates whose name include the filter. "
"Default: service isolate log messages are suppressed.");
-DEFINE_FLAG(charp, timeline_trace_dir, NULL,
- "Enable all timeline trace streams and output traces "
- "into specified directory.");
DEFINE_FLAG(int, new_gen_semi_max_size, (kWordSize <= 4) ? 16 : 32,
"Max size of new gen semi space in MB");
DEFINE_FLAG(int, old_gen_heap_size, 0,
@@ -384,6 +383,8 @@ bool IsolateMessageHandler::HandleMessage(Message* message) {
StackZone zone(I);
HandleScope handle_scope(I);
TimelineDurationScope tds(I, I->GetIsolateStream(), "HandleMessage");
+ tds.SetNumArguments(1);
+ tds.CopyArgument(0, "isolateName", I->name());
// TODO(turnidge): Rework collection total dart execution. This can
// overcount when other things (gc, compilation) are active.
@@ -686,7 +687,6 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
last_allocationprofile_gc_timestamp_(0),
object_id_ring_(NULL),
trace_buffer_(NULL),
- timeline_event_recorder_(NULL),
profiler_data_(NULL),
tag_table_(GrowableObjectArray::null()),
current_tag_(UserTag::null()),
@@ -736,7 +736,6 @@ Isolate::~Isolate() {
delete compiler_stats_;
compiler_stats_ = NULL;
}
- RemoveTimelineEventRecorder();
delete thread_registry_;
}
@@ -767,11 +766,11 @@ Isolate* Isolate::Init(const char* name_prefix,
ISOLATE_METRIC_LIST(ISOLATE_METRIC_INIT);
#undef ISOLATE_METRIC_INIT
- const bool force_streams = FLAG_timeline_trace_dir != NULL;
-
// Initialize Timeline streams.
#define ISOLATE_TIMELINE_STREAM_INIT(name, enabled_by_default) \
- result->stream_##name##_.Init(#name, force_streams || enabled_by_default);
+ result->stream_##name##_.Init(#name, \
+ Timeline::EnableStreamByDefault(#name) || \
+ enabled_by_default);
ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_INIT);
#undef ISOLATE_TIMELINE_STREAM_INIT
@@ -1476,11 +1475,6 @@ void Isolate::Shutdown() {
// Write out the coverage data if collection has been enabled.
CodeCoverage::Write(this);
-
- if ((timeline_event_recorder_ != NULL) &&
- (FLAG_timeline_trace_dir != NULL)) {
- timeline_event_recorder_->WriteTo(FLAG_timeline_trace_dir);
- }
}
// Remove this isolate from the list *before* we start tearing it down, to
@@ -1651,21 +1645,6 @@ void Isolate::VisitPrologueWeakPersistentHandles(HandleVisitor* visitor) {
}
-void Isolate::SetTimelineEventRecorder(
- TimelineEventRecorder* timeline_event_recorder) {
-#define ISOLATE_TIMELINE_STREAM_SET_BUFFER(name, enabled_by_default) \
- stream_##name##_.set_recorder(timeline_event_recorder);
- ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_SET_BUFFER)
-#undef ISOLATE_TIMELINE_STREAM_SET_BUFFER
- timeline_event_recorder_ = timeline_event_recorder;
-}
-
-void Isolate::RemoveTimelineEventRecorder() {
- SetTimelineEventRecorder(NULL);
- delete timeline_event_recorder_;
-}
-
-
void Isolate::PrintJSON(JSONStream* stream, bool ref) {
JSONObject jsobj(stream);
jsobj.AddProperty("type", (ref ? "@Isolate" : "Isolate"));
« runtime/vm/dart.cc ('K') | « runtime/vm/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698