Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: base/trace_event/process_memory_dump.h

Issue 1419633004: [Tracing] Introduce HeapDumpWriter helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove WriteStackFrames, DISALLOW_COPY_AND_ASSIGN Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/trace_event/process_memory_dump.h
diff --git a/base/trace_event/process_memory_dump.h b/base/trace_event/process_memory_dump.h
index 4f7d141104dd3342a26c3263aa2686bf1f20eb5f..6d6a75e336fea5043bea63514168b04c72918e13 100644
--- a/base/trace_event/process_memory_dump.h
+++ b/base/trace_event/process_memory_dump.h
@@ -17,6 +17,7 @@
#include "base/trace_event/memory_dump_session_state.h"
#include "base/trace_event/process_memory_maps.h"
#include "base/trace_event/process_memory_totals.h"
+#include "base/trace_event/trace_event_argument.h"
Primiano Tucci (use gerrit) 2015/10/26 11:52:07 can't TracedValue be fwd declared here?
Ruud van Asseldonk 2015/10/26 14:51:27 Yes it can. Fixed.
// Define COUNT_RESIDENT_BYTES_SUPPORTED if platform supports counting of the
// resident memory.
@@ -47,6 +48,9 @@ class BASE_EXPORT ProcessMemoryDump {
using AllocatorDumpsMap =
SmallMap<hash_map<std::string, MemoryAllocatorDump*>>;
+ using HeapDumpsMap =
+ SmallMap<hash_map<std::string, scoped_refptr<TracedValue>>>;
+
#if defined(COUNT_RESIDENT_BYTES_SUPPORTED)
// Returns the total bytes resident for a virtual address range, with given
// |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The
@@ -95,6 +99,12 @@ class BASE_EXPORT ProcessMemoryDump {
// Returns the map of the MemoryAllocatorDumps added to this dump.
const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; }
+ // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue|
+ // must have the correct format. |trace_event::HeapDumper| will generate such
+ // a value from a |trace_event::AllocationRegister|.
+ void AddHeapDump(const std::string& absolute_name,
+ scoped_refptr<TracedValue> heap_dump);
+
// Adds an ownership relationship between two MemoryAllocatorDump(s) with the
// semantics: |source| owns |target|, and has the effect of attributing
// the memory usage of |target| to |source|. |importance| is optional and
@@ -155,6 +165,7 @@ class BASE_EXPORT ProcessMemoryDump {
bool has_process_mmaps_;
AllocatorDumpsMap allocator_dumps_;
+ HeapDumpsMap heap_dumps_;
// ProcessMemoryDump handles the memory ownership of all its belongings.
ScopedVector<MemoryAllocatorDump> allocator_dumps_storage_;

Powered by Google App Engine
This is Rietveld 408576698