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 3d66f78e56dabff61480102060a0e8f1cb4c9d36..bd9c5434ddabfc624b0a804c1c5744104a180f5d 100644 |
--- a/base/trace_event/process_memory_dump.h |
+++ b/base/trace_event/process_memory_dump.h |
@@ -30,6 +30,8 @@ class MemoryDumpSessionState; |
// dump point time. |
class BASE_EXPORT ProcessMemoryDump { |
public: |
+ // Maps allocator dumps absolute names (allocator_name/heap/subheap) to |
+ // MemoryAllocatorDump instances. |
using AllocatorDumpsMap = |
SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; |
@@ -48,16 +50,26 @@ class BASE_EXPORT ProcessMemoryDump { |
void set_has_process_mmaps() { has_process_mmaps_ = true; } |
// Creates a new MemoryAllocatorDump with the given name and returns the |
- // empty object back to the caller. The |name| must be unique in the dump. |
- // ProcessMemoryDump handles the memory ownership of the created object. |
- // |parent| can be used to specify a hierarchical relationship of the |
- // allocator dumps. |
- MemoryAllocatorDump* CreateAllocatorDump(const std::string& name); |
- MemoryAllocatorDump* CreateAllocatorDump(const std::string& name, |
- MemoryAllocatorDump* parent); |
- |
- // Returns a MemoryAllocatorDump given its name or nullptr if not found. |
- MemoryAllocatorDump* GetAllocatorDump(const std::string& name) const; |
+ // empty object back to the caller. |
+ // Arguments: |
+ // allocator_name: a name that univocally identifies allocator dumps |
+ // produced by this provider. It acts as a type w.r.t. the allocator |
+ // attributes, in the sense that all the MAD with the same allocator_name |
+ // are expected to have the same attributes. |
+ // heap_name, either: |
+ // - kRootHeap: if the allocator has only one default heap. |
+ // - a string identifing a heap name (e.g., isolate1, isolate2 ...). It is |
+ // possible to specify nesting by using a path-like string (e.g., |
+ // isolate1/heap_spaceX, isolate1/heap_spaceY, isolate2/heap_spaceX). |
+ // The tuple (|allocator_name|, |heap_name|) is unique inside a PMD. |
+ // ProcessMemoryDump handles the memory ownership of its MemoryAllocatorDumps. |
+ MemoryAllocatorDump* CreateAllocatorDump(const std::string& allocator_name, |
+ const std::string& heap_name); |
+ |
+ // Looks up a MemoryAllocatorDump given its allocator and heap names, or |
+ // nullptr if not found. |
+ MemoryAllocatorDump* GetAllocatorDump(const std::string& allocator_name, |
+ const std::string& heap_name) const; |
// Returns the map of the MemoryAllocatorDumps added to this dump. |
const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } |