Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
dart::TimelineTestHelper Class Reference
Inheritance diagram for dart::TimelineTestHelper:
dart::AllStatic

Static Public Member Functions

static void SetStream (TimelineEvent *event, TimelineStream *stream)
 
static MutexGetRecorderLock (TimelineEventRecorder &recorder)
 
static void FakeThreadEvent (TimelineEventBlock *block, intptr_t ftid, const char *label="fake", TimelineStream *stream=nullptr)
 
static void FakeDuration (TimelineEventRecorder *recorder, const char *label, int64_t start, int64_t end)
 
static void FakeBegin (TimelineEventRecorder *recorder, const char *label, int64_t start)
 
static void FakeEnd (TimelineEventRecorder *recorder, const char *label, int64_t end)
 
static void FinishBlock (TimelineEventBlock *block)
 

Detailed Description

Definition at line 44 of file timeline_test.cc.

Member Function Documentation

◆ FakeBegin()

static void dart::TimelineTestHelper::FakeBegin ( TimelineEventRecorder *  recorder,
const char *  label,
int64_t  start 
)
inlinestatic

Definition at line 82 of file timeline_test.cc.

84 {
85 ASSERT(recorder != nullptr);
86 ASSERT(label != nullptr);
87 ASSERT(start >= 0);
88 TimelineEvent* event = recorder->StartEvent();
89 ASSERT(event != nullptr);
90 event->Begin(label, /*id=*/-1, start);
91 recorder->CompleteEvent(event);
92 }
#define ASSERT(E)
FlKeyEvent * event

◆ FakeDuration()

static void dart::TimelineTestHelper::FakeDuration ( TimelineEventRecorder *  recorder,
const char *  label,
int64_t  start,
int64_t  end 
)
inlinestatic

Definition at line 69 of file timeline_test.cc.

72 {
73 ASSERT(recorder != nullptr);
74 ASSERT(start < end);
75 ASSERT(label != nullptr);
76 TimelineEvent* event = recorder->StartEvent();
77 ASSERT(event != nullptr);
78 event->Duration(label, start, end);
79 recorder->CompleteEvent(event);
80 }

◆ FakeEnd()

static void dart::TimelineTestHelper::FakeEnd ( TimelineEventRecorder *  recorder,
const char *  label,
int64_t  end 
)
inlinestatic

Definition at line 94 of file timeline_test.cc.

96 {
97 ASSERT(recorder != nullptr);
98 ASSERT(label != nullptr);
99 ASSERT(end >= 0);
100 TimelineEvent* event = recorder->StartEvent();
101 ASSERT(event != nullptr);
102 event->End(label, end);
103 recorder->CompleteEvent(event);
104 }

◆ FakeThreadEvent()

static void dart::TimelineTestHelper::FakeThreadEvent ( TimelineEventBlock *  block,
intptr_t  ftid,
const char *  label = "fake",
TimelineStream stream = nullptr 
)
inlinestatic

Definition at line 54 of file timeline_test.cc.

57 {
58 OSThread& current_thread = *OSThread::Current();
59 MutexLocker ml(current_thread.timeline_block_lock());
60 TimelineEvent* event = block->StartEventLocked();
61 ASSERT(event != nullptr);
62 event->DurationBegin(label);
63 event->thread_ = OSThread::ThreadIdFromIntPtr(ftid);
64 if (stream != nullptr) {
65 event->StreamInit(stream);
66 }
67 }
static ThreadId ThreadIdFromIntPtr(intptr_t id)
static OSThread * Current()
Definition: os_thread.h:179

◆ FinishBlock()

static void dart::TimelineTestHelper::FinishBlock ( TimelineEventBlock *  block)
inlinestatic

Definition at line 106 of file timeline_test.cc.

106{ block->Finish(); }

◆ GetRecorderLock()

static Mutex & dart::TimelineTestHelper::GetRecorderLock ( TimelineEventRecorder &  recorder)
inlinestatic

Definition at line 50 of file timeline_test.cc.

50 {
51 return recorder.lock_;
52 }

◆ SetStream()

static void dart::TimelineTestHelper::SetStream ( TimelineEvent *  event,
TimelineStream stream 
)
inlinestatic

Definition at line 46 of file timeline_test.cc.

46 {
47 event->StreamInit(stream);
48 }

The documentation for this class was generated from the following file: