[tracing] Add support to pre-load and merge ProcessMemoryDump(s).
commitc7336081e09ad57bc7e5c5c5d4076db2b6b9d4ee
authorprimiano <primiano@chromium.org>
Thu, 21 May 2015 10:07:28 +0000 (21 03:07 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 21 May 2015 10:08:00 +0000 (21 10:08 +0000)
tree0e2b28c34cb90dda8e7610d1a1805d4884e2a100
parent2d93642c4820e676dacf311d81a8e33aa2d1cc1d
[tracing] Add support to pre-load and merge ProcessMemoryDump(s).

Allows MemoryDumpProvider(s) with dump-time constraints (mostly GC
allocators) to create out-of-band MemoryAllocatorDump(s) and merge
them during the onMemoryDump callback.

So far, the architecture of MemoryDumpProvider expected to never
instantiate ProcessMemoryDump(s) directly, but just fill up the
one passed as argument to the onMemoryDump(ProcessMemoryDump*)
callback.
This, however, doesn't cover the cases of dumpers that cannot dump
at arbitrary times (i.e. during onMemoryDump callback) and
need to pre-fill the dump stats before the actual callback
comes.
A concrete case of this are dump providers for garbage-collected
allocators (specifically BlinkGC) where some of the stats can be
collected only during the GC.

BUG=466141

Review URL: https://codereview.chromium.org/1151603004

Cr-Commit-Position: refs/heads/master@{#330924}
base/trace_event/BUILD.gn
base/trace_event/process_memory_dump.cc
base/trace_event/process_memory_dump.h
base/trace_event/process_memory_dump_unittest.cc [new file with mode: 0644]
base/trace_event/trace_event.gypi