commit | 94204c6f237de4199535655489700bf1c5134836 | [log] [tgz] |
---|---|---|
author | Alexander Timin <altimin@google.com> | Mon Mar 14 16:57:32 2022 +0000 |
committer | Alexander Timin <altimin@google.com> | Mon Mar 14 16:57:32 2022 +0000 |
tree | 90879c621e54e79f7802354ab26fb3bd096736f1 | |
parent | 8735b22d37bb7ac7863f786234e3d795268d3b39 [diff] |
[Reland] Allow typed proto messages to be written into TracedValue. This is a reland of r.android.com/1699768, caused by a lack of `const` modifier on a WriteIntoTrace function in Chrome, which was fixed by crrev.com/c/3500621. ===== This patch adds TracedValue::WriteProto<proto::pbzero::MessageType>() method, which can be used to write structured proto inside TracedValue. Also TracedProto now gets an implicit constructor from TracedValue, which means that if a C++ class implements Foo::WriteIntoTrace(TracedProto<...>) method, it can be used in all places where a class implementing Foo::WriteIntoTrace(TracedValue) can be used, including: - being passed as an untyped argument to TRACE_EVENT: TRACE_EVENT(..., "arg", Foo()); - being passed to TracedDictionary::Add / TracedArray::Append. This patch also adds MessageType::GetName() method to the protozero bindings, which is needed for implementation of WriteProto method. R=eseckler@google.com,skyostil@google.com CC=primiano@google.com Bug: b/184558843 Change-Id: I85956dd889780efd1ccf8fd943edee76ab99d820
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.