Handle exhaustive time_in_state snapshots

The cpu_freq_full marker in ProcessStats.Thread message is used to mark
whether a snapshot of time_in_state is exhaustive, i.e. at that point
the recorded ticks fully describe spent cpu time for a thread. Without
it aggregating across frequencies would undercount the time because
values for some frequencies could be skipped due to caching or being
zero.

Trace processor expands the marker to (frequency, 0) tuples for all
missing frequencies. That increases the volume of the data in all
exhaustive snapshots by few times (e.g. 8x on my test bonito). Such
snapshots only occur after incremental state clearing or for new
threads, so the overall impact is smaller.

Follow-up after: https://r.android.com/1316160

Bug: 157216280
Test: tools/diff_test_trace_processor.py
Change-Id: I8459a04ed4dd0d8a84db0e0b5bea82fd6233f6bb
5 files changed
tree: 97d096eebfd26cc0d32de732c79c333b1106f621
  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. .gitignore
  17. .gn
  18. .style.yapf
  19. Android.bp
  20. Android.bp.extras
  21. BUILD
  22. BUILD.extras
  23. BUILD.gn
  24. codereview.settings
  25. heapprofd.rc
  26. LICENSE
  27. METADATA
  28. MODULE_LICENSE_APACHE2
  29. OWNERS
  30. perfetto.rc
  31. PRESUBMIT.py
  32. README.chromium
  33. README.md
  34. TEST_MAPPING
  35. traced_perf.rc
  36. 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://docs.perfetto.dev or the /docs/ directory for documentation.