commit | b7fa544858e572df889bdab7ddb970bd236dc202 | [log] [tgz] |
---|---|---|
author | Hector Dearman <hjd@google.com> | Thu Nov 08 18:39:32 2018 +0000 |
committer | Hector Dearman <hjd@google.com> | Thu Nov 08 18:39:32 2018 +0000 |
tree | 0b9488290ec266118c2be1401940f19606b54f03 | |
parent | 2d061b16ea6c8934ec4ff74e6871b783e365c81d [diff] |
perfetto_cmd: Teach perfetto_cmd to parse pbtxt configs Adds the ability for perfetto_cmd to understand pbtxt configs (this is controlled by the -t/--txt flag). This is somewhat complicated by perfetto_cmd only having access to protobuf lite. - Add a cut down version of descriptor.proto - Use this to generate a (lite) descriptor.pb.h/descriptor.pb.cc - Convert perfetto_config.proto into a FileSetDescriptor (perfetto_config.descriptor) - Encode perfetto_config.descriptor as a C++ constant named kPerfettoConfigDescriptor (perfetto_config.descriptor.h) - Use descriptor.pb.h to parse the kPerfettoConfigDescriptor - Manually parse the incoming config based on the descriptor and use protozero to write the proto encoding into a buffer which is then parsed as normal. Converting perfetto_config.proto to a descriptor happens at commit time to avoid having to teach google3 and Android build systems how to convert a proto descriptor into a .h file of the correct format. This is not a stable API. Backwards and forwards compatible proto format changes such as renaming a field or removing an optional field are breaking changes to the proto text format (we can't distinguish between a typo'ed field and an optional field) so this format is only really designed for local testing. Several smaller clean ups: - Move scattered_stream_memory_delegate.{h,cc} to be part of protozero proper - Remove the (now empty) src/protozero:test_support target - Remove unused code in tools/gen_merged_protos - Remove trailing whitespace in PRESUBMIT.py Change-Id: Ic59b1338bd83421f68d4e12b4e01b9aaf5aa99be
Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.
See www.perfetto.dev for docs.