Trace Redaction - Implement thread merge strategy

To implement thread merging, there are only a few interfaces that
need to be implemented. These are the same interfaces that other
redactions are based one.

A simple example of this is the thread sched modification interface.
The thread merging implementation replaces the pid value with the cpu
pid value.

It is through these simple strategies that thread merging can be
implemented while requiring very little (to no) risk.

As implemented, there are some some small issues:

  1. The process tree contains removed threads and processes. The
     names have been removed, but the pids and tids are present.

  2. The process tree does not contain the new per-cpu threads.

  3. In some cases, threads split and one gets orphaned. In case,
     a thread which started at time X and ended at time Y gets
     split into two threads, one starting at time X and never
     ends, and another that always existed and never ends.

Bug: 339504266
Bug: 336807771
Change-Id: Icec4b7625c2decc8466b15aecd53b626f86644e3
21 files changed
tree: fdb546e13488a07e92dc8b40a036779fe0199682
  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. .clang-format
  20. .clang-tidy
  21. .git-blame-ignore-revs
  22. .gitattributes
  23. .gitignore
  24. .gn
  25. .style.yapf
  26. Android.bp
  27. Android.bp.extras
  28. BUILD
  29. BUILD.extras
  30. BUILD.gn
  31. CHANGELOG
  32. codereview.settings
  33. DIR_METADATA
  34. heapprofd.rc
  35. LICENSE
  36. meson.build
  37. METADATA
  38. MODULE_LICENSE_APACHE2
  39. OWNERS
  40. perfetto.rc
  41. PerfettoIntegrationTests.xml
  42. persistent_cfg.pbtxt
  43. PRESUBMIT.py
  44. README.chromium
  45. README.md
  46. TEST_MAPPING
  47. traced_perf.rc
  48. WATCHLISTS
  49. 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.