Add a new "restricted" metric name to reduce noise.

Currently our breakdown metric grabs trace event names and concatenates
them to form detailed names, but often trace events aren't informative
or they are optional and will break up our aggregation into different
rows.

This new restricted_metric_name is more opiniated about which trace
events to include. It always includes the top level slice name, and if
its a PostTask where it was posted from. After that it includes only one
additional trace event using a priority list of categories from the
descendant slices.

1) mojom
2) toplevel
3) java

If there is multiple for a given category the first is used.

If there is no matching categories for the descendants (if they have
any) we will append "UnknownEvent" to ensure un classified events don't
become super common.

The test has some UnknownEvents because its missing the toplevel
category which would normally make most events not be tagged as
UnknownEvents.

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