Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add async events to pipeline flows. #7985

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions synchronization/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Pipeline : public fml::RefCountedThreadSafe<Pipeline<R>> {
TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_);
// The continuation is being dropped on the floor. End the flow.
TRACE_FLOW_END("flutter", "PipelineItem", trace_id_);
TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id_);
}
}

Expand All @@ -79,6 +80,7 @@ class Pipeline : public fml::RefCountedThreadSafe<Pipeline<R>> {
ProducerContinuation(Continuation continuation, size_t trace_id)
: continuation_(continuation), trace_id_(trace_id) {
TRACE_FLOW_BEGIN("flutter", "PipelineItem", trace_id_);
TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineItem", trace_id_);
TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineProduce", trace_id_);
}

Expand Down Expand Up @@ -133,6 +135,7 @@ class Pipeline : public fml::RefCountedThreadSafe<Pipeline<R>> {
empty_.Signal();

TRACE_FLOW_END("flutter", "PipelineItem", trace_id);
TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: why are there two TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id) (one here ,one in ~ProducerContinuation()), but only one TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineItem", trace_id_) in the ProducerContinuation constructor? Could it be possible that BEGIN is called once while END is called twice? Maybe it's Ok to call END multiple times?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A trace can end only once. The end call in the destructor is if the pipeline drops the continuation (while shutting down the engine maybe). See the if (continuation_).


return items_count > 0 ? PipelineConsumeResult::MoreAvailable
: PipelineConsumeResult::Done;
Expand Down