Chromium Code Reviews
DescriptionGather trace data by waiting on handles with a fixed timeout
The tracing service collects to an arbitrary number of collectors and,
when requested, asks all of these collectors to please send in all data
they have available and signal they are done by closing a collector
message pipe. When this happens the tracing service would like to wait
for some period of time for all collectors to provide as much data as
possible and then signal its caller as soon as it knows it has received
and forwarded all data it will receive.
This behavior was implemented by posting a delayed task 5 seconds into
the future and then serving incoming calls as normal until the task ran.
This meant that the tracing service always waited for 5 seconds to
signal that all data was collected, even when all collectors complete
much faster, and since the message loop is running handling overlapping
calls on message pipes other than the collectors is tricky.
This instead performs a blocking gather operation on the collector pipes
by issuing a MojoWaitMany on only those message pipe handles and, when a
handle is signaled as readable, reading and dispatching a single message
in a non-blocking fashion by using WaitForIncomingMethodCall() with a
deadline of 0. This requires exposing a raw handle value from
mojo::Binding so MojoWaitMany calls can be issued directly and exposing
a deadline parameter in WaitForIncomingMethodCall().
R=viettrungluu@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/115caf812397a3347ca813dfec1a06b8e61f5494
Patch Set 1 #Patch Set 2 : #
Total comments: 11
Patch Set 3 : review feedback #
Messages
Total messages: 5 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||