| Index: runtime/vm/timeline.h
|
| diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h
|
| index c7c6016693bd9489884608cbbb4e415f3cd322a1..0abf0254d91b0cdca4c8dda9dccb7fbfae28cc9a 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,25 @@ 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.
|
| +// See: https://fuchsia.googlesource.com/tracing/+/HEAD/docs/usage_guide.md
|
| +class TimelineEventFuchsiaRecorder : public TimelineEventFixedBufferRecorder {
|
| + 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 {
|
|
|