tp: Parsing device_pm_callback_[start|end] ftrace events

This patch does the following:
- Parses `device_pm_callback_[start|end]` ftrace events to capture
  information about the device, associated driver, type of callback etc.
- Creates perfetto slices to visualize device PM callbacks executed
  during a suspend / resume cycle and adds them to the "Suspend / Resume
  Latency" UI track.
- The display name format for the slices is:
  "<driver name> <device name> <event type>[:<callback phase>]"

A 60s trace with ~9 suspend/resume cycles was used to measure the load
times on the UI (via the `perfetto.AsyncSlices` plugin). The size of the
trace was 41MB.

Load times (averaged across 3 runs)
With this change: 51 ms
Without this change: 28 ms

The increase in ftrace_event table entries processed for the "Suspend /
Resume Latency" track correspond to `device_pm_callback_[start|end]`
events.

```
$ select COUNT(*) from ftrace_event where name like "device_pm_callback%";
91622

$ select COUNT(*) from ftrace_event where name like "suspend_resume%";
502
```

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