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/optional.h" | 17 #include "base/optional.h" |
18 #include "base/process/process_handle.h" | 18 #include "base/process/process_handle.h" |
| 19 #include "base/trace_event/process_memory_totals.h" |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 namespace trace_event { | 22 namespace trace_event { |
22 | 23 |
23 // Captures the reason why a memory dump is being requested. This is to allow | 24 // Captures the reason why a memory dump is being requested. This is to allow |
24 // selective enabling of dumps, filtering and post-processing. Keep this | 25 // selective enabling of dumps, filtering and post-processing. Keep this |
25 // consistent with memory_instrumentation.mojo and | 26 // consistent with memory_instrumentation.mojo and |
26 // memory_instrumentation_struct_traits.{h,cc} | 27 // memory_instrumentation_struct_traits.{h,cc} |
27 enum class MemoryDumpType { | 28 enum class MemoryDumpType { |
28 PERIODIC_INTERVAL, // Dumping memory at periodic intervals. | 29 PERIODIC_INTERVAL, // Dumping memory at periodic intervals. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 MemoryDumpLevelOfDetail level_of_detail; | 77 MemoryDumpLevelOfDetail level_of_detail; |
77 }; | 78 }; |
78 | 79 |
79 // TODO(hjd): Not used yet, see crbug.com/703184 | 80 // TODO(hjd): Not used yet, see crbug.com/703184 |
80 // Summarises information about memory use as seen by a single process. | 81 // Summarises information about memory use as seen by a single process. |
81 // This information will eventually be passed to a service to be colated | 82 // This information will eventually be passed to a service to be colated |
82 // and reported. | 83 // and reported. |
83 struct BASE_EXPORT MemoryDumpCallbackResult { | 84 struct BASE_EXPORT MemoryDumpCallbackResult { |
84 struct OSMemDump { | 85 struct OSMemDump { |
85 uint32_t resident_set_kb = 0; | 86 uint32_t resident_set_kb = 0; |
| 87 ProcessMemoryTotals::PlatformPrivateFootprint platform_private_footprint; |
86 }; | 88 }; |
87 struct ChromeMemDump { | 89 struct ChromeMemDump { |
88 uint32_t malloc_total_kb = 0; | 90 uint32_t malloc_total_kb = 0; |
89 uint32_t partition_alloc_total_kb = 0; | 91 uint32_t partition_alloc_total_kb = 0; |
90 uint32_t blink_gc_total_kb = 0; | 92 uint32_t blink_gc_total_kb = 0; |
91 uint32_t v8_total_kb = 0; | 93 uint32_t v8_total_kb = 0; |
92 }; | 94 }; |
93 | 95 |
94 // These are for the current process. | 96 // These are for the current process. |
95 OSMemDump os_dump; | 97 OSMemDump os_dump; |
(...skipping 23 matching lines...) Expand all Loading... |
119 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString( | 121 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString( |
120 const MemoryDumpLevelOfDetail& level_of_detail); | 122 const MemoryDumpLevelOfDetail& level_of_detail); |
121 | 123 |
122 BASE_EXPORT MemoryDumpLevelOfDetail | 124 BASE_EXPORT MemoryDumpLevelOfDetail |
123 StringToMemoryDumpLevelOfDetail(const std::string& str); | 125 StringToMemoryDumpLevelOfDetail(const std::string& str); |
124 | 126 |
125 } // namespace trace_event | 127 } // namespace trace_event |
126 } // namespace base | 128 } // namespace base |
127 | 129 |
128 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ | 130 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ |
OLD | NEW |