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

Issue 769963004: Add tracing service and make the shell+sky_viewer+services talk to it (Closed)

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

Description

Add tracing service and make the shell+sky_viewer+services talk to it This adds a tracing service that can aggregate tracing data from multiple sources and write a json file out to disk that trace-viewer can understand. This also teaches the shell, sky_viewer, and various other services how to register themselves with the tracing service and provide tracing data on demand. Finally, this teaches the skydb prompt to tell the tracing service to start/stop tracing when the 'trace' command is issued. The tracing service exposes two APIs, a collector interface and a coordinator interface. The collector interface allows different entities to register themselves as being capable of producing tracing data. The coordinator interface allows asking the service to collect data from all registered sources and flushing the collected data to disk. The service keeps track of all open connections to registered sources and broadcasts a request for data whenever the coordinator's Start method is called, then aggregates all data send back into a single trace file. In this patch, the tracing service simply gives all sources 1 second to return data then flushes to disk. Ideally it would keep track of how many requests it sent out and give each source a certain amount of time to respond but this is simple and works for most cases. The tracing service can talk to any source that is capable of producing data that the trace-viewer can handle, which is a broad set, but in practice many programs will want to use //base/debug's tracing to produce trace data. This adds code at //mojo/common:tracing_impl that registers a collector hooked up to //base/debug's tracing system. This can be dropped in to the mojo::ApplicationDelegate::Initialize() implementation for most services and applications to easily enable base tracing. Programs that don't use //base, or that want to register additional data sources that can talk to trace viewer (perhaps providing data that's more easily available from another thread, say) may want to create additional connections to the tracing service. R=eseidel@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/85ccf05073474c97e09c6729b2307cebac45b162

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -99 lines) Patch
M mojo/common/BUILD.gn View 1 chunk +2 lines, -5 lines 0 comments Download
M mojo/common/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
D mojo/common/tracing.mojom View 1 chunk +0 lines, -10 lines 0 comments Download
M mojo/common/tracing_impl.h View 1 chunk +25 lines, -9 lines 0 comments Download
M mojo/common/tracing_impl.cc View 1 chunk +34 lines, -44 lines 0 comments Download
M mojo/services/native_viewport/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/native_viewport/main.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M mojo/services/surfaces/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/surfaces/surfaces_service_application.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/surfaces/surfaces_service_application.cc View 2 chunks +5 lines, -0 lines 0 comments Download
M mojo/services/view_manager/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/view_manager/view_manager_app.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/view_manager/view_manager_app.cc View 2 chunks +5 lines, -0 lines 0 comments Download
M mojo/services/window_manager/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/window_manager/main.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M mojo/shell/BUILD.gn View 1 chunk +3 lines, -0 lines 0 comments Download
M mojo/shell/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/shell/context.cc View 3 chunks +8 lines, -0 lines 0 comments Download
M services/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A + services/tracing/BUILD.gn View 1 chunk +7 lines, -16 lines 0 comments Download
A services/tracing/main.cc View 1 chunk +88 lines, -0 lines 0 comments Download
A services/tracing/trace_data_sink.h View 1 chunk +31 lines, -0 lines 0 comments Download
A services/tracing/trace_data_sink.cc View 1 chunk +41 lines, -0 lines 0 comments Download
A services/tracing/tracing.mojom View 1 chunk +31 lines, -0 lines 0 comments Download
M sky/tools/debugger/prompt/BUILD.gn View 1 chunk +1 line, -1 line 0 comments Download
M sky/tools/debugger/prompt/prompt.cc View 3 chunks +5 lines, -5 lines 0 comments Download
M sky/viewer/viewer.cc View 3 chunks +3 lines, -9 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
jamesr
6 years ago (2014-12-01 23:02:45 UTC) #2
eseidel
lgtm
6 years ago (2014-12-02 00:23:54 UTC) #3
jamesr
6 years ago (2014-12-02 00:31:09 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
85ccf05073474c97e09c6729b2307cebac45b162 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698