commit | 19e28c8d8eca081e11f893c5635ee5583bb5ab44 | [log] [tgz] |
---|---|---|
author | Sami Kyostila <skyostil@chromium.org> | Thu Jan 14 17:15:27 2021 +0000 |
committer | Sami Kyostila <skyostil@chromium.org> | Thu Jan 14 17:15:27 2021 +0000 |
tree | f0d259069212cffc6ab1cb30484616399c619682 | |
parent | 51e1fea7385f810e7d08c2fb333112d00fbfcd0e [diff] |
tracing: Log more user-friendly warning when tracing is uninitialized If tracing is uninitialized and the user tries to use it, log a more helpful error message instead of crashing on a null pointer dereference somewhere deep in the the codebase. To avoid introducing null checks to hot code paths, we instead introduce a fake tracing muxer/platform which will explicitly fail all operations. These fake objects will be replaced with real ones at initialization time. We also add a perfetto::Tracing::IsInitialized query to check if tracing was initialized or not. Note that data sources and TRACE_EVENT trace points will still silently act as if tracing is disabled if the client library hasn't been initialized. This is by design to avoid races during initialization where it can be hard to guarantee no TRACE_EVENT is encountered before Perfetto is initialized. Change-Id: Iba1424f7040dda4d04da7b84752b1f4ad3b4d3b2
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.