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 <string> | 12 #include <string> |
13 | 13 |
14 #include "base/base_export.h" | 14 #include "base/base_export.h" |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 namespace trace_event { | 18 namespace trace_event { |
19 | 19 |
20 // Captures the reason why a memory dump is being requested. This is to allow | 20 // Captures the reason why a memory dump is being requested. This is to allow |
21 // selective enabling of dumps, filtering and post-processing. | 21 // selective enabling of dumps, filtering and post-processing. |
22 enum class MemoryDumpType { | 22 enum class MemoryDumpType { |
23 TASK_BEGIN, // Dumping memory at the beginning of a message-loop task. | 23 TASK_BEGIN, // Dumping memory at the beginning of a message-loop task. |
Primiano Tucci (use gerrit)
2016/12/15 15:40:43
since you are touching this, can you plz remove TA
ssid
2016/12/15 19:48:06
Done.
| |
24 TASK_END, // Dumping memory at the ending of a message-loop task. | 24 TASK_END, // Dumping memory at the ending of a message-loop task. |
25 PERIODIC_INTERVAL, // Dumping memory at periodic intervals. | 25 PERIODIC_INTERVAL, // Dumping memory at periodic intervals. |
26 EXPLICITLY_TRIGGERED, // Non maskable dump request. | 26 EXPLICITLY_TRIGGERED, // Non maskable dump request. |
27 LAST = EXPLICITLY_TRIGGERED // For IPC macros. | 27 PEAK_MEMORY_USAGE, // Dumping memory at detected peak total memory usage. |
28 LAST = PEAK_MEMORY_USAGE // For IPC macros. | |
28 }; | 29 }; |
29 | 30 |
30 // Tells the MemoryDumpProvider(s) how much detailed their dumps should be. | 31 // Tells the MemoryDumpProvider(s) how much detailed their dumps should be. |
31 enum class MemoryDumpLevelOfDetail : uint32_t { | 32 enum class MemoryDumpLevelOfDetail : uint32_t { |
32 FIRST, | 33 FIRST, |
33 | 34 |
34 // 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 |
35 // totals are expected. Suballocations need not be specified. Dump name must | 36 // totals are expected. Suballocations need not be specified. Dump name must |
36 // contain only pre-defined strings and string arguments cannot be added. | 37 // contain only pre-defined strings and string arguments cannot be added. |
37 BACKGROUND = FIRST, | 38 BACKGROUND = FIRST, |
(...skipping 27 matching lines...) Expand all Loading... | |
65 // providers. Dump providers are expected to read the args for creating dumps. | 66 // providers. Dump providers are expected to read the args for creating dumps. |
66 struct MemoryDumpArgs { | 67 struct MemoryDumpArgs { |
67 // Specifies how detailed the dumps should be. | 68 // Specifies how detailed the dumps should be. |
68 MemoryDumpLevelOfDetail level_of_detail; | 69 MemoryDumpLevelOfDetail level_of_detail; |
69 }; | 70 }; |
70 | 71 |
71 using MemoryDumpCallback = Callback<void(uint64_t dump_guid, bool success)>; | 72 using MemoryDumpCallback = Callback<void(uint64_t dump_guid, bool success)>; |
72 | 73 |
73 BASE_EXPORT const char* MemoryDumpTypeToString(const MemoryDumpType& dump_type); | 74 BASE_EXPORT const char* MemoryDumpTypeToString(const MemoryDumpType& dump_type); |
74 | 75 |
76 BASE_EXPORT MemoryDumpType StringToMemoryDumpType(const std::string& str); | |
77 | |
75 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString( | 78 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString( |
76 const MemoryDumpLevelOfDetail& level_of_detail); | 79 const MemoryDumpLevelOfDetail& level_of_detail); |
77 | 80 |
78 BASE_EXPORT MemoryDumpLevelOfDetail | 81 BASE_EXPORT MemoryDumpLevelOfDetail |
79 StringToMemoryDumpLevelOfDetail(const std::string& str); | 82 StringToMemoryDumpLevelOfDetail(const std::string& str); |
80 | 83 |
81 } // namespace trace_event | 84 } // namespace trace_event |
82 } // namespace base | 85 } // namespace base |
83 | 86 |
84 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ | 87 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ |
OLD | NEW |