Chromium Code Reviews| Index: runtime/vm/timeline.h |
| diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h |
| index d91e9090189a519f0e2172072d779ffd74140556..851113f8ca3f5caa578cdbd937b71a2b5faa3ef3 100644 |
| --- a/runtime/vm/timeline.h |
| +++ b/runtime/vm/timeline.h |
| @@ -342,6 +342,9 @@ class TimelineEvent { |
| state_ = OwnsLabelBit::update(owns_label, state_); |
| } |
| + // Returns the number of bytes written into |buffer|. |
| + intptr_t PrintSystrace(char* buffer, intptr_t buffer_size); |
| + |
| private: |
| void FreeArguments(); |
| @@ -413,6 +416,7 @@ class TimelineEvent { |
| friend class TimelineEventEndlessRecorder; |
| friend class TimelineEventRingRecorder; |
| friend class TimelineEventStartupRecorder; |
| + friend class TimelineEventSystraceRecorder; |
| friend class TimelineStream; |
| friend class TimelineTestHelper; |
| DISALLOW_COPY_AND_ASSIGN(TimelineEvent); |
| @@ -622,6 +626,7 @@ class TimelineEventBlock { |
| friend class TimelineEventEndlessRecorder; |
| friend class TimelineEventRingRecorder; |
| friend class TimelineEventStartupRecorder; |
| + friend class TimelineEventSystraceRecorder; |
| friend class TimelineTestHelper; |
| friend class JSONStream; |
| @@ -786,6 +791,28 @@ class TimelineEventRingRecorder : public TimelineEventFixedBufferRecorder { |
| }; |
| +// A recorder that writes events to Android Systrace. Events are also stored in |
| +// a buffer of fixed capacity. When the buffer is full, new events overwrite |
| +// old events. |
| +class TimelineEventSystraceRecorder |
| + : public TimelineEventFixedBufferRecorder { |
| + public: |
| + explicit TimelineEventSystraceRecorder(intptr_t capacity = kDefaultCapacity); |
| + |
| + ~TimelineEventSystraceRecorder(); |
| + |
| + const char* name() const { |
| + return "Systrace"; |
| + } |
| + |
| + protected: |
| + TimelineEventBlock* GetNewBlockLocked(); |
| + void CompleteEvent(TimelineEvent* event); |
| + |
| + int systrace_fd_; |
|
Chinmay
2016/09/08 17:58:11
Should this be private? Along with the usual `DISA
Cutch
2016/09/08 18:06:10
The base class has the decoration.
|
| +}; |
| + |
| + |
| // A recorder that stores events in a buffer of fixed capacity. When the buffer |
| // is full, new events are dropped. |
| class TimelineEventStartupRecorder : public TimelineEventFixedBufferRecorder { |