Index: runtime/vm/timeline.h |
diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h |
index cf77396be4b8d5e8b4f013acbaff543938edd714..f44fb53a0c2537b819b47b983999c064b1f00846 100644 |
--- a/runtime/vm/timeline.h |
+++ b/runtime/vm/timeline.h |
@@ -46,7 +46,7 @@ class Timeline : public AllStatic { |
// Access the global recorder. Not thread safe. |
static TimelineEventRecorder* recorder(); |
- static bool EnableStreamByDefault(const char* stream_name); |
+ static void SetupIsolateStreams(Isolate* isolate); |
static TimelineStream* GetVMStream(); |
@@ -57,6 +57,9 @@ class Timeline : public AllStatic { |
static void Clear(); |
+ // Print information about streams to JSON. |
+ static void PrintFlagsToJSON(JSONStream* json); |
+ |
#define ISOLATE_TIMELINE_STREAM_FLAGS(name, not_used) \ |
static const bool* Stream##name##EnabledFlag() { \ |
return &stream_##name##_enabled_; \ |
@@ -66,11 +69,13 @@ class Timeline : public AllStatic { |
} |
ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_FLAGS) |
#undef ISOLATE_TIMELINE_STREAM_FLAGS |
+ static void SetVMStreamEnabled(bool enabled); |
private: |
static TimelineEventRecorder* recorder_; |
static TimelineStream vm_stream_; |
static TimelineStream vm_api_stream_; |
+ static MallocGrowableArray<char*>* enabled_streams_; |
#define ISOLATE_TIMELINE_STREAM_DECLARE_FLAG(name, not_used) \ |
static bool stream_##name##_enabled_; |
@@ -618,7 +623,7 @@ class TimelineEventRecorder { |
// Interface method(s) which must be implemented. |
virtual void PrintJSON(JSONStream* js, TimelineEventFilter* filter) = 0; |
virtual void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter) = 0; |
- |
+ virtual const char* name() const = 0; |
int64_t GetNextAsyncId(); |
void FinishBlock(TimelineEventBlock* block); |
@@ -662,6 +667,9 @@ class TimelineEventRingRecorder : public TimelineEventRecorder { |
void PrintJSON(JSONStream* js, TimelineEventFilter* filter); |
void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter); |
+ const char* name() const { |
+ return "ring"; |
+ } |
protected: |
TimelineEvent* StartEvent(); |
@@ -693,6 +701,10 @@ class TimelineEventStreamingRecorder : public TimelineEventRecorder { |
// reference to |event| as it may be freed as soon as this function returns. |
virtual void StreamEvent(TimelineEvent* event) = 0; |
+ const char* name() const { |
+ return "streaming"; |
+ } |
+ |
protected: |
TimelineEventBlock* GetNewBlockLocked() { |
return NULL; |
@@ -717,6 +729,10 @@ class TimelineEventEndlessRecorder : public TimelineEventRecorder { |
void PrintJSON(JSONStream* js, TimelineEventFilter* filter); |
void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter); |
+ const char* name() const { |
+ return "endless"; |
+ } |
+ |
protected: |
TimelineEvent* StartEvent(); |
void CompleteEvent(TimelineEvent* event); |