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

Issue 1055703002: Gather trace data by waiting on handles with a fixed timeout (Closed)

Created:
5 years, 8 months ago by jamesr
Modified:
5 years, 8 months ago
Reviewers:
viettrungluu
CC:
mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Gather 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+299 lines, -131 lines) Patch
M mojo/common/data_pipe_utils.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/common/trace_controller_impl.cc View 3 chunks +3 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/binding.h View 1 2 chunks +14 lines, -3 lines 0 comments Download
M mojo/public/cpp/bindings/lib/connector.h View 1 2 1 chunk +6 lines, -4 lines 0 comments Download
M mojo/public/cpp/bindings/lib/connector.cc View 1 1 chunk +5 lines, -5 lines 0 comments Download
M mojo/public/cpp/bindings/lib/interface_ptr_internal.h View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/cpp/bindings/lib/router.h View 1 2 2 chunks +7 lines, -3 lines 0 comments Download
M mojo/public/cpp/bindings/tests/connector_unittest.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M mojo/public/cpp/bindings/tests/router_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M services/tracing/BUILD.gn View 1 chunk +4 lines, -0 lines 0 comments Download
A services/tracing/collector_impl.h View 1 2 1 chunk +43 lines, -0 lines 0 comments Download
A services/tracing/collector_impl.cc View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
M services/tracing/main.cc View 1 2 1 chunk +1 line, -105 lines 0 comments Download
M services/tracing/tracing.mojom View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A services/tracing/tracing_app.h View 1 2 1 chunk +57 lines, -0 lines 0 comments Download
A services/tracing/tracing_app.cc View 1 2 1 chunk +116 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
jamesr
5 years, 8 months ago (2015-04-01 23:50:44 UTC) #1
viettrungluu
lgtm with various nits https://codereview.chromium.org/1055703002/diff/20001/mojo/common/data_pipe_utils.cc File mojo/common/data_pipe_utils.cc (right): https://codereview.chromium.org/1055703002/diff/20001/mojo/common/data_pipe_utils.cc#newcode96 mojo/common/data_pipe_utils.cc:96: if (it == source.end()) If ...
5 years, 8 months ago (2015-04-02 19:54:13 UTC) #2
jamesr
Could you take another look at the new comments/names to make sure they're sane? Thanks. ...
5 years, 8 months ago (2015-04-06 22:31:04 UTC) #3
viettrungluu
On 2015/04/06 22:31:04, jamesr wrote: > Could you take another look at the new comments/names ...
5 years, 8 months ago (2015-04-07 19:50:58 UTC) #4
jamesr
5 years, 8 months ago (2015-04-07 19:52:45 UTC) #5
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
115caf812397a3347ca813dfec1a06b8e61f5494 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698