metrics: Allow chrome metric protos to be compiled in

After this CL, we can add chrome metric protos to the metrics/chrome
directory. As an example, console error metric is checked in.

Previously, TraceMetrics and all its imports were being compiled to
protozero because it was part of ComputeMetricResult in
trace_processor.proto. However, we do not use the generated protozero
files anywhere, and it was preventing us from including the chrome
metrics because protozero struggled to process custom options. The
type of ComputeMetricResult.metrics has now been changed from
TraceMetrics to Bytes, so we do not have to generate any protozero code
for metrics. The UI can easily decode those bytes into TraceMetrics
proto if it has a TraceMetrics decoder.

All the chrome metrics will be listed in
metrics/chrome/all_chrome_metrics.proto. This file lists them as
extensions to TraceMetrics. We use metric extensions instead of directly
including them in TraceMetrics because it will make it simpler to copy
the metrics directly from chromium repo to perfetto in the future. To
prevent classes, we reserved extension range 1001 to 2000 for chrome
metrics in metrics.proto so there is no surprise clash.

Since we import custom_options.proto in all_chrome_metrics.proto, we
no longer need to generate binary descriptors for it separately.

Bug: 155480437
Change-Id: I5aba18984e272c0768830e619d158bf9fd11f9cc
22 files changed
tree: b5c1e09b82a539a22b0595c6ff21426dd743f0d6
  1. bazel/
  2. build_overrides/
  3. buildtools/
  4. debian/
  5. docs/
  6. examples/
  7. gn/
  8. include/
  9. infra/
  10. protos/
  11. src/
  12. test/
  13. tools/
  14. ui/
  15. .clang-format
  16. .clang-tidy
  17. .gitignore
  18. .gn
  19. .style.yapf
  20. Android.bp
  21. Android.bp.extras
  22. BUILD
  23. BUILD.extras
  24. BUILD.gn
  25. CHANGELOG
  26. codereview.settings
  27. heapprofd.rc
  28. LICENSE
  29. METADATA
  30. MODULE_LICENSE_APACHE2
  31. OWNERS
  32. perfetto.rc
  33. PRESUBMIT.py
  34. README.chromium
  35. README.md
  36. TEST_MAPPING
  37. traced_perf.rc
  38. 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.