Chromium Code Reviews| 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_REQUEST_ARGS_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ |
| 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ |
| 7 | 7 |
| 8 // This file defines the types and structs used to issue memory dump requests. | 8 // This file defines the types and structs used to issue memory dump requests. |
| 9 // These are also used in the IPCs for coordinating inter-process memory dumps. | 9 // These are also used in the IPCs for coordinating inter-process memory dumps. |
| 10 | 10 |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 #include <map> | 12 #include <map> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/base_export.h" | 15 #include "base/base_export.h" |
| 16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/process/process_handle.h" | 17 #include "base/process/process_handle.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 namespace trace_event { | 20 namespace trace_event { |
| 21 | 21 |
| 22 // Captures the reason why a memory dump is being requested. This is to allow | 22 // Captures the reason why a memory dump is being requested. This is to allow |
| 23 // selective enabling of dumps, filtering and post-processing. Important: this | 23 // selective enabling of dumps, filtering and post-processing. |
| 24 // must be kept consistent with | |
| 25 // services/resource_coordinator/public/cpp/memory/memory_infra_traits.cc. | |
|
Primiano Tucci (use gerrit)
2017/03/31 10:47:20
As hjd pointed out, this is just moved to services
fmeawad
2017/03/31 15:07:27
Do you want to replace it or remove it? That file
Primiano Tucci (use gerrit)
2017/03/31 17:04:01
Ah I see we need to update both really. I'd just k
fmeawad
2017/03/31 18:48:40
Done.
| |
| 26 enum class MemoryDumpType { | 24 enum class MemoryDumpType { |
| 27 PERIODIC_INTERVAL, // Dumping memory at periodic intervals. | 25 PERIODIC_INTERVAL, // Dumping memory at periodic intervals. |
| 28 EXPLICITLY_TRIGGERED, // Non maskable dump request. | 26 EXPLICITLY_TRIGGERED, // Non maskable dump request. |
| 29 PEAK_MEMORY_USAGE, // Dumping memory at detected peak total memory usage. | 27 PEAK_MEMORY_USAGE, // Dumping memory at detected peak total memory usage. |
| 30 LAST = PEAK_MEMORY_USAGE // For IPC macros. | 28 LAST = PEAK_MEMORY_USAGE // For IPC macros. |
| 31 }; | 29 }; |
| 32 | 30 |
| 33 // Tells the MemoryDumpProvider(s) how much detailed their dumps should be. | 31 // Tells the MemoryDumpProvider(s) how much detailed their dumps should be. |
| 34 // Important: this must be kept consistent with | |
| 35 // services/resource_Coordinator/public/cpp/memory/memory_infra_traits.cc. | |
| 36 enum class MemoryDumpLevelOfDetail : uint32_t { | 32 enum class MemoryDumpLevelOfDetail : uint32_t { |
| 37 FIRST, | 33 FIRST, |
| 38 | 34 |
| 39 // For background tracing mode. The dump time is quick, and typically just the | 35 // For background tracing mode. The dump time is quick, and typically just the |
| 40 // totals are expected. Suballocations need not be specified. Dump name must | 36 // totals are expected. Suballocations need not be specified. Dump name must |
| 41 // contain only pre-defined strings and string arguments cannot be added. | 37 // contain only pre-defined strings and string arguments cannot be added. |
| 42 BACKGROUND = FIRST, | 38 BACKGROUND = FIRST, |
| 43 | 39 |
| 44 // For the levels below, MemoryDumpProvider instances must guarantee that the | 40 // For the levels below, MemoryDumpProvider instances must guarantee that the |
| 45 // total size reported in the root node is consistent. Only the granularity of | 41 // total size reported in the root node is consistent. Only the granularity of |
| 46 // the child MemoryAllocatorDump(s) differs with the levels. | 42 // the child MemoryAllocatorDump(s) differs with the levels. |
| 47 | 43 |
| 48 // Few entries, typically a fixed number, per dump. | 44 // Few entries, typically a fixed number, per dump. |
| 49 LIGHT, | 45 LIGHT, |
| 50 | 46 |
| 51 // Unrestricted amount of entries per dump. | 47 // Unrestricted amount of entries per dump. |
| 52 DETAILED, | 48 DETAILED, |
| 53 | 49 |
| 54 LAST = DETAILED | 50 LAST = DETAILED |
| 55 }; | 51 }; |
| 56 | 52 |
| 57 // Initial request arguments for a global memory dump. (see | 53 // Initial request arguments for a global memory dump. (see |
| 58 // MemoryDumpManager::RequestGlobalMemoryDump()). Important: this must be kept | 54 // MemoryDumpManager::RequestGlobalMemoryDump()). |
| 59 // consistent with services/memory_infra/public/cpp/memory_infra_traits.cc. | |
| 60 struct BASE_EXPORT MemoryDumpRequestArgs { | 55 struct BASE_EXPORT MemoryDumpRequestArgs { |
| 61 // Globally unique identifier. In multi-process dumps, all processes issue a | 56 // Globally unique identifier. In multi-process dumps, all processes issue a |
| 62 // local dump with the same guid. This allows the trace importers to | 57 // local dump with the same guid. This allows the trace importers to |
| 63 // reconstruct the global dump. | 58 // reconstruct the global dump. |
| 64 uint64_t dump_guid; | 59 uint64_t dump_guid; |
| 65 | 60 |
| 66 MemoryDumpType dump_type; | 61 MemoryDumpType dump_type; |
| 67 MemoryDumpLevelOfDetail level_of_detail; | 62 MemoryDumpLevelOfDetail level_of_detail; |
| 68 }; | 63 }; |
| 69 | 64 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString( | 105 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString( |
| 111 const MemoryDumpLevelOfDetail& level_of_detail); | 106 const MemoryDumpLevelOfDetail& level_of_detail); |
| 112 | 107 |
| 113 BASE_EXPORT MemoryDumpLevelOfDetail | 108 BASE_EXPORT MemoryDumpLevelOfDetail |
| 114 StringToMemoryDumpLevelOfDetail(const std::string& str); | 109 StringToMemoryDumpLevelOfDetail(const std::string& str); |
| 115 | 110 |
| 116 } // namespace trace_event | 111 } // namespace trace_event |
| 117 } // namespace base | 112 } // namespace base |
| 118 | 113 |
| 119 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ | 114 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ |
| OLD | NEW |