| Index: runtime/vm/timeline.h
|
| diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h
|
| index fa55f75f884a75df9dfb4385866ed55c59047ec4..47d2439567b56b1308e5bdf4014f565abcd7f7d1 100644
|
| --- a/runtime/vm/timeline.h
|
| +++ b/runtime/vm/timeline.h
|
| @@ -334,17 +334,9 @@ class TimelineStream {
|
| }
|
|
|
|
|
| -class TimelineDurationScope : public StackResource {
|
| +// See |TimelineDurationScope| and |TimelineBeginEndScope|.
|
| +class TimelineEventScope : public StackResource {
|
| public:
|
| - TimelineDurationScope(TimelineStream* stream,
|
| - const char* label);
|
| -
|
| - TimelineDurationScope(Thread* thread,
|
| - TimelineStream* stream,
|
| - const char* label);
|
| -
|
| - ~TimelineDurationScope();
|
| -
|
| bool enabled() const {
|
| return enabled_;
|
| }
|
| @@ -359,21 +351,81 @@ class TimelineDurationScope : public StackResource {
|
| const char* name,
|
| const char* fmt, ...) PRINTF_ATTRIBUTE(4, 5);
|
|
|
| + protected:
|
| + TimelineEventScope(TimelineStream* stream,
|
| + const char* label);
|
| +
|
| + TimelineEventScope(Thread* thread,
|
| + TimelineStream* stream,
|
| + const char* label);
|
| +
|
| + bool ShouldEmitEvent() const {
|
| + return enabled_;
|
| + }
|
| +
|
| + const char* label() const {
|
| + return label_;
|
| + }
|
| +
|
| + TimelineStream* stream() const {
|
| + return stream_;
|
| + }
|
| +
|
| + virtual ~TimelineEventScope();
|
| +
|
| + void StealArguments(TimelineEvent* event);
|
| +
|
| private:
|
| void Init();
|
| void FreeArguments();
|
|
|
| - int64_t timestamp_;
|
| TimelineStream* stream_;
|
| const char* label_;
|
| TimelineEventArgument* arguments_;
|
| intptr_t arguments_length_;
|
| bool enabled_;
|
|
|
| + DISALLOW_COPY_AND_ASSIGN(TimelineEventScope);
|
| +};
|
| +
|
| +
|
| +class TimelineDurationScope : public TimelineEventScope {
|
| + public:
|
| + TimelineDurationScope(TimelineStream* stream,
|
| + const char* label);
|
| +
|
| + TimelineDurationScope(Thread* thread,
|
| + TimelineStream* stream,
|
| + const char* label);
|
| +
|
| + ~TimelineDurationScope();
|
| +
|
| + private:
|
| + int64_t timestamp_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(TimelineDurationScope);
|
| };
|
|
|
|
|
| +class TimelineBeginEndScope : public TimelineEventScope {
|
| + public:
|
| + TimelineBeginEndScope(TimelineStream* stream,
|
| + const char* label);
|
| +
|
| + TimelineBeginEndScope(Thread* thread,
|
| + TimelineStream* stream,
|
| + const char* label);
|
| +
|
| + ~TimelineBeginEndScope();
|
| +
|
| + private:
|
| + void EmitBegin();
|
| + void EmitEnd();
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TimelineBeginEndScope);
|
| +};
|
| +
|
| +
|
| // A block of |TimelineEvent|s. Not thread safe.
|
| class TimelineEventBlock {
|
| public:
|
|
|