commit | 661b4f34268a7a728989958612e59376af04bafe | [log] [tgz] |
---|---|---|
author | Primiano Tucci <primiano@google.com> | Mon Feb 20 17:01:14 2023 +0000 |
committer | Primiano Tucci <primiano@google.com> | Mon Feb 20 17:01:14 2023 +0000 |
tree | 31a911b6105f22d025ce4793032a8a6d3099829f | |
parent | 0d180f46481a96cbe8340734fa5cdce3bba636c8 [diff] |
traced: add perfer_suspend_clock_for_duration option By default traced uses CLOCK_MONOTONIC for the duration_ms timer. That comes all the way down from poll() used by PostDelayedTask(). In some cases, this is unideal as CLOCK_MONO isn't suspend-aware. On mobile phones a trace with a 24h duration might end up lasting weeks if suspend gets in the way, causing consequent trace losses if the devce is rebooted. This CL adds an option to use CLOCK_BOOTTIME for duration_ms. When enabled, it uses PeriodicTask (without the "periodic" bit) which under the hoods uses timerfd. Bug: 269589525 Test: manual: - Start a config with perfer_suspend_clock_for_duration:true - Force the workstation to suspend (echo mem | sudo tee /sys/power/state) - Wait for longer than duration_ms - Observe that the tracing session is stopped immediately after resume. Change-Id: Ic05db218596f0a21d7c440eb5b96a56529c8a909
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://perfetto.dev/docs or the /docs/ directory for documentation.