commit | ee3986dc7034c863e4f76b1a25398708badafdba | [log] [tgz] |
---|---|---|
author | Primiano Tucci <primiano@google.com> | Mon Aug 20 11:39:02 2018 +0200 |
committer | Primiano Tucci <primiano@google.com> | Mon Aug 20 11:39:02 2018 +0200 |
tree | 7a2b452e43f759d068741e5ee9b804ef9eb118d1 | |
parent | c6b2cf82b09b883eb8fb142854bd85a7f1a3e021 [diff] |
TraceProcessor: Add magic ts_lower_bound to sched table This CL introduces a new hidden column to the sched table called ts_lower_bound. It allows to express lower-bound searches on the table, without requiring full table scans. The problem it solves is the following: imagine to have 4 slices in the storage and a visible time range in the UI as follows: [ Slice A ][ Slice B ][ Slice C ][ Slice D] |------------------------------| X (Visible time range) Y The UI wants to see also the remainder of Slice A. In order to do so, it cannot do a simple ts >= X query, because that will miss Slice A. The right query would be "WHERE ts + dur >= X AND ts <= y" Unfortunately this query cannot use indices, due to the presence of two columns (|ts| and |dur|) in the same constraint. In order to achieve this, this CL introduces a |ts_lower_bound| hidden column. When set, it has the following semantics: it filters all slices with a timestamp greater or equal to: - The greatest timestamp < |ts_lower_bound|, if it exists - The smallest timestmap >= |ts_lower_bound| otherwise. So the UI can instead query: "WHERE ts_lower_bound = X and ts <= y" Test: perfetto_unittests --gtest_filter=SchedSliceTableTest.* Change-Id: I3857fac37d713a126749194db965b84f537512dd
Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.
It consists of:
A portable, high efficiency, user-space tracing library
designed for tracing of multi-process systems, based on zero-alloc zero-copy zero-syscall (on fast-paths) writing of protobufs over shared memory.
OS-wide Linux/Android probes for platform debugging
Web-based frontend
A UI for inspection and analysis of traces (coming soon).
Batch processing of traces
A python / C++ (TBD) library for trace-based metrics (coming soon).
Perfetto is building the next-gen unified tracing ecosystem for:
The goal is to create an open, portable and developer friendly tracing ecosystem for app and platform performance debugging.
Designed for production
Perfetto's tracing library and daemons are designed for use in production. Privilege isolation is a key design goal:
See docs/security-model.md for more details.
Long traces
Pefetto aims at supporting hours-long / O(100GB) traces, both in terms of recording backend and UI frontend.
Interoperability
Perfetto traces (output) and configuration (input) consists of protobuf messages, in order to allow interoperability with several languages.
See docs/trace-format.md for more details.
Composability
As Perfetto is designed both for OS-level tracing and app-level tracing, its design allows to compose several instances of the Perfetto tracing library, allowing to nest multiple layers of tracing and drive then with the same frontend. This allows powerful blending of app-specific and OS-wide trace events. See docs/multi-layer-tracing.md for more details.
Portability
The only dependencies of Perfetto's tracing libraries are C++11 and Protobuf lite (plus google-test, google-benchmark, libprotobuf-full for testing).
Extensibility
Perfetto allows third parties to defined their own protobufs for:
Allowing apps to define their own strongly-typed input and output schema. See docs/trace-format.md for more details.