Prevent traced from blocking on a unresponsive producer.


Previously traced would block indefinitely if a producer
stop draining the IPC channel. This would result in eventually
the sendmsg call blocking and android's Watchdog killing traced
for being unresponsive, if some producer in a long trace was
unresponsive.

We add an integration test which exposed this issue to prevent
regressions, and set a timeout on the producer sockets and disconnect
the producer on timeouts.

We don't set the timeout on the consumer socket on the assumption
that the consumer is trusted and to minimize changes to our
behaviour as S is finalizing.

Bug: 169051440
Change-Id: I63988f79b63977ae27eedd126a2bbdcaaa520e78
12 files changed
tree: a13b065f0515f12a21a9567eedc406670cb6e133
  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.