OLD | NEW |
---|---|
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_MEMORY_DUMP_MANAGER_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 uint64 GetTracingProcessId() const; | 97 uint64 GetTracingProcessId() const; |
98 | 98 |
99 // Returns the name for a the allocated_objects dump. Use this to declare | 99 // Returns the name for a the allocated_objects dump. Use this to declare |
100 // suballocator dumps from other dump providers. | 100 // suballocator dumps from other dump providers. |
101 // It will return nullptr if there is no dump provider for the system | 101 // It will return nullptr if there is no dump provider for the system |
102 // allocator registered (which is currently the case for Mac OS). | 102 // allocator registered (which is currently the case for Mac OS). |
103 const char* system_allocator_pool_name() const { | 103 const char* system_allocator_pool_name() const { |
104 return kSystemAllocatorPoolName; | 104 return kSystemAllocatorPoolName; |
105 }; | 105 }; |
106 | 106 |
107 // When true, calling |RegisterMemoryDumpProvider| is a no-op. | |
108 bool dumper_registrations_ignored_for_testing() const { | |
Primiano Tucci (use gerrit)
2015/10/13 13:35:50
there doesn't seem to be any use of this getter. p
Ruud van Asseldonk
2015/10/13 13:55:41
Done.
| |
109 return dumper_registrations_ignored_for_testing_; | |
110 } | |
111 | |
112 void set_dumper_registrations_ignored_for_testing(bool ignore) { | |
Primiano Tucci (use gerrit)
2015/10/13 13:35:50
s/ignore/ignored/ in the arg name
Ruud van Asseldonk
2015/10/13 13:55:41
Done.
| |
113 dumper_registrations_ignored_for_testing_ = ignore; | |
114 } | |
115 | |
107 private: | 116 private: |
108 friend struct DefaultDeleter<MemoryDumpManager>; // For the testing instance. | 117 friend struct DefaultDeleter<MemoryDumpManager>; // For the testing instance. |
109 friend struct DefaultSingletonTraits<MemoryDumpManager>; | 118 friend struct DefaultSingletonTraits<MemoryDumpManager>; |
110 friend class MemoryDumpManagerDelegate; | 119 friend class MemoryDumpManagerDelegate; |
111 friend class MemoryDumpManagerTest; | 120 friend class MemoryDumpManagerTest; |
112 | 121 |
113 // Descriptor struct used to hold information about registered MDPs. It is | 122 // Descriptor struct used to hold information about registered MDPs. It is |
114 // deliberately copyable, in order to allow it to be used as std::set value. | 123 // deliberately copyable, in order to allow it to be used as std::set value. |
115 struct MemoryDumpProviderInfo { | 124 struct MemoryDumpProviderInfo { |
116 MemoryDumpProviderInfo( | 125 MemoryDumpProviderInfo( |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 // dump_providers_enabled_ list) when tracing is not enabled. | 226 // dump_providers_enabled_ list) when tracing is not enabled. |
218 subtle::AtomicWord memory_tracing_enabled_; | 227 subtle::AtomicWord memory_tracing_enabled_; |
219 | 228 |
220 // For time-triggered periodic dumps. | 229 // For time-triggered periodic dumps. |
221 RepeatingTimer periodic_dump_timer_; | 230 RepeatingTimer periodic_dump_timer_; |
222 | 231 |
223 // The unique id of the child process. This is created only for tracing and is | 232 // The unique id of the child process. This is created only for tracing and is |
224 // expected to be valid only when tracing is enabled. | 233 // expected to be valid only when tracing is enabled. |
225 uint64 tracing_process_id_; | 234 uint64 tracing_process_id_; |
226 | 235 |
227 // Skips the auto-registration of the core dumpers during Initialize(). | 236 // When true, calling |RegisterMemoryDumpProvider| is a no-op. |
228 bool skip_core_dumpers_auto_registration_for_testing_; | 237 bool dumper_registrations_ignored_for_testing_; |
229 | 238 |
230 // Whether new memory dump providers should be told to enable heap profiling. | 239 // Whether new memory dump providers should be told to enable heap profiling. |
231 bool heap_profiling_enabled_; | 240 bool heap_profiling_enabled_; |
232 | 241 |
233 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManager); | 242 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManager); |
234 }; | 243 }; |
235 | 244 |
236 // The delegate is supposed to be long lived (read: a Singleton) and thread | 245 // The delegate is supposed to be long lived (read: a Singleton) and thread |
237 // safe (i.e. should expect calls from any thread and handle thread hopping). | 246 // safe (i.e. should expect calls from any thread and handle thread hopping). |
238 class BASE_EXPORT MemoryDumpManagerDelegate { | 247 class BASE_EXPORT MemoryDumpManagerDelegate { |
(...skipping 15 matching lines...) Expand all Loading... | |
254 } | 263 } |
255 | 264 |
256 private: | 265 private: |
257 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 266 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); |
258 }; | 267 }; |
259 | 268 |
260 } // namespace trace_event | 269 } // namespace trace_event |
261 } // namespace base | 270 } // namespace base |
262 | 271 |
263 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 272 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
OLD | NEW |