Chromium Code Reviews| Index: runtime/vm/timeline.h |
| diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h |
| index c7c6016693bd9489884608cbbb4e415f3cd322a1..698291de9b02b1b578e3069301ca3ff52f5c80fb 100644 |
| --- a/runtime/vm/timeline.h |
| +++ b/runtime/vm/timeline.h |
| @@ -318,6 +318,10 @@ class TimelineEvent { |
| // Returns the number of bytes written into |buffer|. |
| intptr_t PrintSystrace(char* buffer, intptr_t buffer_size); |
| +#if defined(HOST_OS_FUCHSIA) |
| + void EmitFuchsiaEvent(); |
| +#endif |
| + |
| private: |
| void FreeArguments(); |
| @@ -386,6 +390,7 @@ class TimelineEvent { |
| friend class TimelineEventRingRecorder; |
| friend class TimelineEventStartupRecorder; |
| friend class TimelineEventSystraceRecorder; |
| + friend class TimelineEventFuchsiaRecorder; |
| friend class TimelineStream; |
| friend class TimelineTestHelper; |
| DISALLOW_COPY_AND_ASSIGN(TimelineEvent); |
| @@ -433,6 +438,10 @@ class TimelineEventScope : public StackResource { |
| const char* label() const { return label_; } |
| + TimelineEventArgument* arguments() const { return arguments_; } |
| + |
| + intptr_t arguments_length() const { return arguments_length_; } |
| + |
| TimelineStream* stream() const { return stream_; } |
| virtual ~TimelineEventScope(); |
| @@ -560,6 +569,7 @@ class TimelineEventBlock { |
| friend class TimelineEventRingRecorder; |
| friend class TimelineEventStartupRecorder; |
| friend class TimelineEventSystraceRecorder; |
| + friend class TimelineEventFuchsiaRecorder; |
| friend class TimelineTestHelper; |
| friend class JSONStream; |
| @@ -735,6 +745,24 @@ class TimelineEventSystraceRecorder : public TimelineEventFixedBufferRecorder { |
| }; |
| +#if defined(HOST_OS_FUCHSIA) |
| +// A recorder that sends events to Fuchsia's tracing app. Events are also stored |
| +// in a buffer of fixed capacity. When the buffer is full, new events overwrite |
| +// old events. |
| +class TimelineEventFuchsiaRecorder : public TimelineEventFixedBufferRecorder { |
|
rmacnak
2017/07/11 20:04:47
Reference https://fuchsia.googlesource.com/tracing
zra
2017/07/11 20:39:59
Done.
|
| + public: |
| + explicit TimelineEventFuchsiaRecorder(intptr_t capacity = kDefaultCapacity); |
| + virtual ~TimelineEventFuchsiaRecorder() {} |
| + |
| + const char* name() const { return "Fuchsia"; } |
| + |
| + protected: |
| + TimelineEventBlock* GetNewBlockLocked(); |
| + void CompleteEvent(TimelineEvent* event); |
| +}; |
| +#endif // defined(HOST_OS_FUCHSIA) |
| + |
| + |
| // A recorder that stores events in a buffer of fixed capacity. When the buffer |
| // is full, new events are dropped. |
| class TimelineEventStartupRecorder : public TimelineEventFixedBufferRecorder { |