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

Unified Diff: runtime/vm/timeline.h

Issue 1690333002: Add fine grained command line and service protocol control over timeline streams recording (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
Index: runtime/vm/timeline.h
diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h
index cf77396be4b8d5e8b4f013acbaff543938edd714..ffef80a04940f5be7ff65dd0a07e51507dcb8fb6 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,6 +69,7 @@ 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_;
@@ -618,7 +622,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 +666,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 +700,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 +728,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);

Powered by Google App Engine
This is Rietveld 408576698