commit | acb6ca3981434fe0ae629395171b16c3ab8657a6 | [log] [tgz] |
---|---|---|
author | Primiano Tucci <primiano@google.com> | Wed Aug 19 13:27:52 2020 +0200 |
committer | Primiano Tucci <primiano@google.com> | Wed Aug 19 13:27:52 2020 +0200 |
tree | be13fdc3730fa12136d52820bc01fd38ca23a593 | |
parent | a4cba6578f09d606d32fe32bb0a0c6283ea6d198 [diff] |
Protozero: fall back on the heap when nesting too deep This CL lifts the historic restriction on the max nesting of protozero messages. It does so by removing the stack-based |nested_message_arena_| hack and instead using an explicit MessgeArena object that is responsible for memory ownership of protozero Message objects. The difference between root and nested messages is made explicit by introducing RootMessage<T> (as opposite to just Message<T>), which owns the storage for all the submessages. This CL still maintains the property of "(mostly) zero allocations": the MessageArena 0th block is allocated when the TraceWriterImpl is constructed an in most cases never expanded. It gets expanded allocating new blocks only when writing a message that is nested too deep. Turns out the change is quite self-contained as most tracing obtains Message objects via TraceWriter::NewTracePacket(). The places that require code changes are very limited. Bug: 163125063 Bug: 125322557 Bug: crbug.com/960303 Change-Id: I8d7a313d81d0c407ef2c549ff5bc9febb30a54a0
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.