commit | 38e23cc44e46bd8f96f1250c3be9c8460cf51ed6 | [log] [tgz] |
---|---|---|
author | Lalit Maganti <lalitm@google.com> | Wed Oct 30 21:04:12 2024 +0000 |
committer | Lalit Maganti <lalitm@google.com> | Wed Oct 30 21:04:12 2024 +0000 |
tree | 4780460cd6830fbb2d1eb6225f2c346abdafc3c5 | |
parent | dfc1541486d2567ecf5b0814fe0f0f3c615307d3 [diff] |
perfetto: rework proto descriptor gen to inform gn about deps The state before today: 1) All the non descriptor rules (lite, zero, gen, ipc) all need to know about all the recursive proto deps to ensure rebuilds when files are changeds (even though techincally the protoc compiler does not actually look at this info) 2) For descriptor rules, we actually rely on protoc to do all the lookups on its side. 3) For Bazel/Android.bp, we hacked soemthing custom to propogate the depenendencies instead of using gn properly (at the time I did not understand gn enough to write the correct templates) The problem: If we are using RBE, we need GN to know about deps so that scheduling of compile actions can correctly figure out which sources are necessary to build which others. We cannot just rely on protoc for this The solution: Unhack a bunch of custom stufff around how we handle descriptors to teach GN properly about the deps. This involes the following: 1) Make source_sets groups instead of actions which allows proper propogation of deps (which was something badly missing with action) 2) Remove source_set and descriptor from being proto_generators: proto_generators now strictly corresponds to C++ codegen. 3) Always generate a source_set target (behind the scenes) to allow depending on it from any other proto target (this is very similar to how Bazel/Blaze work) 4) Make descriptors just rely on generate_descriptor option and specify the top level proto with descriptor_root_source (which is what will be passed to protoc in the end) This should have a minimal diff for bazel/gn which fixing the RBE problem. It also reduces the complexity of a bunch of random proto build rules throughout the codebase. Really as hard as it is to believe, this is noop change... Change-Id: Ieab7ea58efe75ad919d45763965529b3cda02751
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.