[sdlib]: Add logical binder breakdowns

Historically, we've reasoned about binder transaction latency in terms
of thread_states (and kernel blocking functions) or monitor contention.

This disjointed view hides the real picture, for instance from a
thread_state perspective, while a binder reply is Sleeping in the
'S' state, it could broadly be doing any of the:
following:
1. Sleeping due to some timer or interrupt.
2. Blocked on a lock (in Java or CPP).
4. Making another binder transaction.

From a monitor contention perspective, a binder txn could be actually
sleeping or contending for CPU. In the later case, waiting on CPU is the
more interesting 'reason'.

Now, we intersect the slice (flattened) and thread_state to deduce
a logical reason in every intersecting partition. This new reason doesn't
suffer from the examples above and we can more accurately identify stall
reasons during a binder txn on the client and server side.

Test: tools/diff_test_trace_processor.py out/android/trace_processor_shell --name-filter '.*binder.*'
Change-Id: I621a6cb7bf761e5148654a73e58dc5d0ae214e37
5 files changed
tree: 8f4de27a412fd25fc90a691b2f41fe39c8d0ff52
  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. .bazelrc
  20. .clang-format
  21. .clang-tidy
  22. .git-blame-ignore-revs
  23. .gitattributes
  24. .gitignore
  25. .gn
  26. .style.yapf
  27. Android.bp
  28. Android.bp.extras
  29. BUILD
  30. BUILD.extras
  31. BUILD.gn
  32. CHANGELOG
  33. codereview.settings
  34. DIR_METADATA
  35. heapprofd.rc
  36. LICENSE
  37. meson.build
  38. METADATA
  39. MODULE_LICENSE_APACHE2
  40. OWNERS
  41. perfetto.rc
  42. PerfettoIntegrationTests.xml
  43. persistent_cfg.pbtxt
  44. PRESUBMIT.py
  45. README.chromium
  46. README.md
  47. TEST_MAPPING
  48. traced_perf.rc
  49. WATCHLISTS
  50. 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.