profiling: Improve bookeeping.

Now keep a callstack -> (allocated, freed, alloc cnt, free cnt) mapping
in the HeapTracker.

Keep track of allocated and freed bytes. This allows to infer short
lived allocations.

This is needed for incremental dumps supporting multiple concurrent
profiling sessions for the same process.

Test: m
Test: flash walleye
Test: profile system_server

samples: {      # (perfetto.protos.ProfilePacket.HeapSample) size=17B
	callstack_id: 0x0000007be6974ce0
	cumulative_allocated: 0x0000000000000180      # 384
	cumulative_freed    : 0x0000000000000120      # 288
	alloc_count : 0x0000000000000004
	free_count  : 0x0000000000000003
}

Change-Id: I4f1a4caba6a0b2937bc096cd5b1fee549eefcf7c
4 files changed
tree: 5cbacce590bbcc268116d93409860fa50b1e723d
  1. build_overrides/
  2. buildtools/
  3. debian/
  4. docs/
  5. gn/
  6. include/
  7. infra/
  8. protos/
  9. src/
  10. test/
  11. tools/
  12. ui/
  13. .clang-format
  14. .gitignore
  15. .gn
  16. .travis.yml
  17. Android.bp
  18. Android.bp.extras
  19. BUILD.gn
  20. codereview.settings
  21. heapprofd.rc
  22. MODULE_LICENSE_APACHE2
  23. NOTICE
  24. OWNERS
  25. perfetto.rc
  26. PRESUBMIT.py
  27. README.chromium
  28. README.md
README.md

Perfetto - Performance instrumentation and tracing

Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.

See www.perfetto.dev for docs.

Bugs

  • For bugs affecting Android or the tracing internals use the internal bug tracker (go/perfetto-bugs).
  • For bugs affecting Chrome use http://crbug.com, Component:Speed>Tracing label:Perfetto.