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
26 files changed
tree: 4780460cd6830fbb2d1eb6225f2c346abdafc3c5
  1. .github/
  2. bazel/
  3. build_overrides/
  4. buildtools/
  5. debian/
  6. docs/
  7. examples/
  8. gn/
  9. include/
  10. infra/
  11. protos/
  12. python/
  13. src/
  14. test/
  15. third_party/
  16. tools/
  17. ui/
  18. .bazelignore
  19. .bazelrc
  20. .clang-format
  21. .clang-tidy
  22. .git-blame-ignore-revs
  23. .gitattributes
  24. .gitignore
  25. .gn
  26. .style.yapf
  27. Android.bp
  28. Android.bp.extras
  29. BUILD
  30. BUILD.extras
  31. BUILD.gn
  32. CHANGELOG
  33. codereview.settings
  34. DIR_METADATA
  35. heapprofd.rc
  36. LICENSE
  37. meson.build
  38. METADATA
  39. MODULE_LICENSE_APACHE2
  40. OWNERS
  41. perfetto.rc
  42. PerfettoIntegrationTests.xml
  43. persistent_cfg.pbtxt
  44. PRESUBMIT.py
  45. README.chromium
  46. README.md
  47. TEST_MAPPING
  48. traced_perf.rc
  49. WATCHLISTS
  50. WORKSPACE
README.md

Perfetto - System profiling, app tracing and trace analysis

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.