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

Side by Side Diff: base/trace_event/process_memory_dump.h

Issue 1583483002: [tracing] Add method to create "weak" global dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ 5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_
6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 MemoryAllocatorDump* GetOrCreateAllocatorDump( 91 MemoryAllocatorDump* GetOrCreateAllocatorDump(
92 const std::string& absolute_name); 92 const std::string& absolute_name);
93 93
94 // Creates a shared MemoryAllocatorDump, to express cross-process sharing. 94 // Creates a shared MemoryAllocatorDump, to express cross-process sharing.
95 // Shared allocator dumps are allowed to have duplicate guids within the 95 // Shared allocator dumps are allowed to have duplicate guids within the
96 // global scope, in order to reference the same dump from multiple processes. 96 // global scope, in order to reference the same dump from multiple processes.
97 // See the design doc goo.gl/keU6Bf for reference usage patterns. 97 // See the design doc goo.gl/keU6Bf for reference usage patterns.
98 MemoryAllocatorDump* CreateSharedGlobalAllocatorDump( 98 MemoryAllocatorDump* CreateSharedGlobalAllocatorDump(
99 const MemoryAllocatorDumpGuid& guid); 99 const MemoryAllocatorDumpGuid& guid);
100 100
101 // Creates a shared MemoryAllocatorDump as CreateSharedGlobalAllocatorDump,
102 // but with a WEAK flag. A weak dump will be removed unless a non-weak dump
Primiano Tucci (use gerrit) 2016/01/19 17:07:11 s/removed/discarded/ also below
ssid 2016/01/20 18:58:34 Done.
103 // is created using CreateSharedGlobalAllocatorDump by at least one process
104 // (order of creation does not matter). All owners and children of the removed
105 // dump will also be removed transitively.
106 MemoryAllocatorDump* CreateWeakSharedGlobalAllocatorDump(
Primiano Tucci (use gerrit) 2016/01/19 17:07:11 You want to clarify that: The Weak flag applies on
ssid 2016/01/20 18:58:34 Done.
107 const MemoryAllocatorDumpGuid& guid);
108
101 // Looks up a shared MemoryAllocatorDump given its guid. 109 // Looks up a shared MemoryAllocatorDump given its guid.
102 MemoryAllocatorDump* GetSharedGlobalAllocatorDump( 110 MemoryAllocatorDump* GetSharedGlobalAllocatorDump(
103 const MemoryAllocatorDumpGuid& guid) const; 111 const MemoryAllocatorDumpGuid& guid) const;
104 112
105 // Returns the map of the MemoryAllocatorDumps added to this dump. 113 // Returns the map of the MemoryAllocatorDumps added to this dump.
106 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } 114 const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; }
107 115
108 // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue| 116 // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue|
109 // must have the correct format. |trace_event::HeapDumper| will generate such 117 // must have the correct format. |trace_event::HeapDumper| will generate such
110 // a value from a |trace_event::AllocationRegister|. 118 // a value from a |trace_event::AllocationRegister|.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Keeps track of relationships between MemoryAllocatorDump(s). 190 // Keeps track of relationships between MemoryAllocatorDump(s).
183 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; 191 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_;
184 192
185 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); 193 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump);
186 }; 194 };
187 195
188 } // namespace trace_event 196 } // namespace trace_event
189 } // namespace base 197 } // namespace base
190 198
191 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ 199 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698