README.chromium
README.md
1# Perfetto - Performance instrumentation and tracing
2
3Perfetto is an open-source project for performance instrumentation and tracing
4of Linux/Android/Chrome platforms and user-space apps.
5It consists of:
6
7**A portable, high efficiency, user-space tracing library**
8designed for tracing of multi-process systems, based on zero-alloc zero-copy
9zero-syscall (on fast-paths) writing of protobufs over shared memory.
10
11**OS-wide Linux/Android probes for platform debugging**
12* Kernel tracing: a daemon that converts Kernel [Ftrace][ftrace] events into
13 API-stable protobufs, on device, with low overhead.
14* I/O tracing
15* Many new probes coming soon: heap profiling, perf sampling, syscall tracing.
16
17**Web-based frontend**
18A UI for inspection and analysis of traces (coming soon).
19
20**Batch processing of traces**
21A python / C++ (TBD) library for trace-based metrics (coming soon).
22
23
24![Perfetto Stack](https://storage.googleapis.com/perfetto/markdown_img/perfetto-stack.png)
25
26Goals
27-----
28Perfetto is building the next-gen unified tracing ecosystem for:
29- Android platform tracing ([Systrace][systrace])
30- Chrome platform tracing ([chrome://tracing][chrome-tracing])
31- App-defined user-space tracing (including support for non-Android apps).
32
33The goal is to create an open, portable and developer friendly tracing ecosystem
34for app and platform performance debugging.
35
36Key features
37------------
38**Designed for production**
39Perfetto's tracing library and daemons are designed for use in production.
40Privilege isolation is a key design goal:
41* The interface for writing trace events are decoupled from the interface for
42 read-back and control and can be subjected to different ACLs.
43* Despite being based on shared memory, Perfetto is designed to prevent
44 cross-talk between data sources, even in case of arbitrary code execution
45 (memory is shared point-to-point, memory is never shared between processes).
46* Perfetto daemons are designed following to the principle of least privilege,
47 in order to allow strong sandboxing (via SELinux on Android).
48
49See [docs/security-model.md](docs/security-model.md) for more details.
50
51**Long traces**
52Pefetto aims at supporting hours-long / O(100GB) traces, both in terms of
53recording backend and UI frontend.
54
55**Interoperability**
56Perfetto traces (output) and configuration (input) consists of protobuf
57messages, in order to allow interoperability with several languages.
58
59See [docs/trace-format.md](docs/trace-format.md) for more details.
60
61**Composability**
62As Perfetto is designed both for OS-level tracing and app-level tracing, its
63design allows to compose several instances of the Perfetto tracing library,
64allowing to nest multiple layers of tracing and drive then with the same
65frontend. This allows powerful blending of app-specific and OS-wide trace
66events.
67See [docs/multi-layer-tracing.md](docs/multi-layer-tracing.md) for more details.
68
69**Portability**
70The only dependencies of Perfetto's tracing libraries are C++11 and [Protobuf lite][protobuf] (plus google-test, google-benchmark, libprotobuf-full for testing).
71
72**Extensibility**
73Perfetto allows third parties to defined their own protobufs for:
74* [(input) Configuration](/protos/perfetto/config/data_source_config.proto#52)
75* [(output) Trace packets](/protos/perfetto/trace/trace_packet.proto#36)
76
77Allowing apps to define their own strongly-typed input and output schema.
78See [docs/trace-format.md](docs/trace-format.md) for more details.
79
80
81Docs
82----
83* [Contributing](docs/contributing.md)
84* [Build instructions](docs/build-instructions.md)
85* [Running tests](docs/testing.md)
86* [Running Perfetto](docs/running.md)
87* [Key concepts and architecture](docs/architecture.md)
88* [Life of a tracing session](docs/life-of-a-tracing-session.md)
89* [Ftrace interop](docs/ftrace.md)
90* [Performance benchmarks](docs/benchmarks.md)
91* [Trace config](docs/trace-config.md)
92* [Trace format](docs/trace-format.md)
93* [Multi-layer tracing](docs/multi-layer-tracing.md)
94* [Security model](docs/security-model.md)
95* [Embedding Perfetto in your own project](docs/embedder-guide.md)
96* [ProtoZero internals](docs/protozero.md)
97* [IPC internals](docs/ipc.md)
98
99[ftrace]: https://www.kernel.org/doc/Documentation/trace/ftrace.txt
100[systrace]: https://developer.android.com/studio/command-line/systrace.html
101[chrome-tracing]: https://www.chromium.org/developers/how-tos/trace-event-profiling-tool
102[protobuf]: https://developers.google.com/protocol-buffers/
103