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

Unified Diff: runtime/vm/timeline.h

Issue 2977513002: [Fuchsia] Routes timeline events to Fuchsia's tracing app (Closed)
Patch Set: Format Created 3 years, 5 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
« no previous file with comments | « runtime/vm/BUILD.gn ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « runtime/vm/BUILD.gn ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698