Add new dynamic table to look up ancestors of CPU stack samples.

This removes the need for a recursive query which is a significant
performance bottle neck.

I validated the results on a test trace with results here:
https://docs.google.com/spreadsheets/d/1whwjzHbU7QQ1iaR3W-dqLRRBxl5LAY5NKnBeRmidFCk/edit?usp=sharing&resourcekey=0-5u4EtMsfmDyD1X_lvLi9CA

The new method just skips a row in the validation which was repeated
in the recursive query (I think this was a bug? please double check
though).

Trying on the example trace in the bug and selecting a stack sample
from ChromeIOThread over the IOHandler::OnIOCompleted the performance
was similar. This does not bode well for this fix.

Bug: 168056830
Change-Id: I89f2e042d0d4dc43f424272e71aced4c0c426346
8 files changed
tree: 7c2c9569f03518f1b6d11d344a65caa4c4a06754
  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. .gitignore
  19. .gn
  20. .style.yapf
  21. Android.bp
  22. Android.bp.extras
  23. BUILD
  24. BUILD.extras
  25. BUILD.gn
  26. CHANGELOG
  27. codereview.settings
  28. heapprofd.rc
  29. LICENSE
  30. METADATA
  31. MODULE_LICENSE_APACHE2
  32. OWNERS
  33. perfetto.rc
  34. PRESUBMIT.py
  35. README.chromium
  36. README.md
  37. TEST_MAPPING
  38. traced_perf.rc
  39. 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.