traced_probes: Put all statsd atoms into a single batch

The main change is that rather than ending up with a packet per atom
we now end up with many atoms in a single packet.

There are a couple of small tweaks to achieve this:
- Now the root timestamp on the packet is always the time we
  are *receiving* the atom batch in boot time. This aids sorting
  in trace_processor until we sort out some special sorting for atoms.
- Remove [packed=true] from ShellData timestamp_nanos. statsd does not
  actually pack this field and protozero is quite picky about
  packed field which makes it hard to parse. We don't actually need to
  parse it after this change but I didn't want to leave it around to
  trip up the next person.
- Rather than parsing each ShellData one atom at a time and inserting
  them into the trace individually now we take all whole contents of
  ShellData and put it in a StatsdAtom track packet (whose format
  matches exactly precisely so this was possible.)

$ adb push test/configs/statsd.cfg /data/misc/perfetto-configs/statsd.cfg
$ adb shell perfetto --txt -c /data/misc/perfetto-configs/statsd.cfg -o /data/misc/perfetto-traces/statsd.pb
$ adb pull /data/misc/perfetto-traces/statsd.pb statsd.pb
$ ninja -C out/r traceconv && out/r/traceconv text statsd.pb

Test: See above.
Change-Id: I48ebb10c56ffbfbca14eb4db3962218a740fbb19
4 files changed
tree: b77c52dcd94e2351dce3a60036da0bed9edf5fec
  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. PRESUBMIT.py
  42. README.chromium
  43. README.md
  44. TEST_MAPPING
  45. traced_perf.rc
  46. 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.