tree: fbfec002e1bd1b43371f0e2274aa4c12207a8d24 [path history] [tgz]
  1. consumer_host.cc
  2. consumer_host.h
  3. consumer_host_unittest.cc
  4. json_trace_exporter.cc
  5. json_trace_exporter.h
  6. json_trace_exporter_unittest.cc
  7. perfetto_integration_unittest.cc
  8. perfetto_service.cc
  9. perfetto_service.h
  10. perfetto_tracing_coordinator.cc
  11. perfetto_tracing_coordinator.h
  12. perfetto_tracing_coordinator_unittest.cc
  13. producer_host.cc
  14. producer_host.h
  15. README.md
  16. test_utils.cc
  17. test_utils.h
  18. track_event_json_exporter.cc
  19. track_event_json_exporter.h
  20. track_event_json_exporter_unittest.cc
services/tracing/perfetto/README.md

Perfetto in Chrome

Overview

Perfetto is a project intended to provide a common platform for performance instrumentation and logging across Chrome and Android, and this directory contains the code integrating the Perfetto library into Chrome. Specifically it provides a Mojo-based transportation layer which any individual new data source can build on to send logging protos to Perfetto, and an implementation which lets about://tracing generate a Chrome Tracing trace (TRACE_EVENT0, etc) using Perfetto rather than /base/trace_event/trace_log.cc as a backend.

The library itself lives in AOSP and is rolled in /third_party/chrome/.

Perfetto Documentation

Project page

Life of a Perfetto tracing Session

Internal documentation

Directory Structure

//services/tracing/                   <-- Perfetto is embedded by the tracing service
              /perfetto/              <-- Internal service implementation code
              /public/
                     /cpp/perfetto    <-- C++ client libraries used by the data source providers.
                     /mojom/          <-- Mojom interfaces
//third_party/perfetto/               <-- DEPS-rolled external library

Adding a new data source

A data source is a provider of a specific type of data in the form of protobufs, like Chrome Trace Events, memory-infra memory dumps, netlog, etc. It registers itself with Perfetto with a given string identifier (e.g. org.chromium.trace-event) and if enabled by the central Perfetto service, writes its protos into the provided Perfetto TraceWriter(s).

These data source providers can live in any child process, and the Mojo transportation layer will take care of the details of passing them to the central service through shared memory buffers.

To add a new data source:

Contact

For any questions about Perfetto in Chrome or adding a new data source, please start a thread on tracing@chromium.org.