diff options
author | primiano <primiano@chromium.org> | 2015-05-21 03:07:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-21 10:08:00 +0000 |
commit | c7336081e09ad57bc7e5c5c5d4076db2b6b9d4ee (patch) | |
tree | 0e2b28c34cb90dda8e7610d1a1805d4884e2a100 /base/trace_event/process_memory_dump.h | |
parent | 2d93642c4820e676dacf311d81a8e33aa2d1cc1d (diff) | |
download | chromium_src-c7336081e09ad57bc7e5c5c5d4076db2b6b9d4ee.zip chromium_src-c7336081e09ad57bc7e5c5c5d4076db2b6b9d4ee.tar.gz chromium_src-c7336081e09ad57bc7e5c5c5d4076db2b6b9d4ee.tar.bz2 |
[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}
Diffstat (limited to 'base/trace_event/process_memory_dump.h')
-rw-r--r-- | base/trace_event/process_memory_dump.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/trace_event/process_memory_dump.h b/base/trace_event/process_memory_dump.h index 889356d..cd70b9c 100644 --- a/base/trace_event/process_memory_dump.h +++ b/base/trace_event/process_memory_dump.h @@ -41,6 +41,14 @@ class BASE_EXPORT ProcessMemoryDump { // Called at trace generation time to populate the TracedValue. void AsValueInto(TracedValue* value) const; + // Merges all MemoryAllocatorDump(s) contained in |other| inside this + // ProcessMemoryDump, transferring their ownership to this instance. + // |other| will be an empty ProcessMemoryDump after this method returns. + // This is to allow dump providers to pre-populate ProcessMemoryDump instances + // and later move their contents into the ProcessMemoryDump passed as argument + // of the MemoryDumpProvider::OnMemoryDump(ProcessMemoryDump*) callback. + void TakeAllDumpsFrom(ProcessMemoryDump* other); + ProcessMemoryTotals* process_totals() { return &process_totals_; } bool has_process_totals() const { return has_process_totals_; } void set_has_process_totals() { has_process_totals_ = true; } |