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

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

Issue 1995573003: [tracing] Introduce BACKGROUND mode in MemoryInfra (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use nullptr to mark end. Created 4 years, 6 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_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
(...skipping 10 matching lines...) Expand all
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.
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 LAST = EXPLICITLY_TRIGGERED // For IPC macros.
28 }; 28 };
29 29
30 // Tells the MemoryDumpProvider(s) how much detailed their dumps should be. 30 // Tells the MemoryDumpProvider(s) how much detailed their dumps should be.
31 // MemoryDumpProvider instances must guarantee that level of detail does not
32 // affect the total size reported in the root node, but only the granularity of
33 // the child MemoryAllocatorDump(s).
34 enum class MemoryDumpLevelOfDetail { 31 enum class MemoryDumpLevelOfDetail {
35 LIGHT, // Few entries, typically a fixed number, per dump. 32 // For background tracing mode. The dump time is quick, and typically just the
36 DETAILED, // Unrestricted amount of entries per dump. 33 // totals are expected. Suballocations need not be specified. Dump name must
37 LAST = DETAILED // For IPC Macros. 34 // contain only pre-defined strings and string arguments cannot be added.
35 BACKGROUND,
36
37 // For the levels below, MemoryDumpProvider instances must guarantee that the
38 // total size reported in the root node is consistent. Only the granularity of
39 // the child MemoryAllocatorDump(s) differs with the levels.
40
41 // Few entries, typically a fixed number, per dump.
42 LIGHT,
43
44 // Unrestricted amount of entries per dump.
45 DETAILED,
46
47 // For IPC Macros.
48 LAST = DETAILED
38 }; 49 };
39 50
40 // Initial request arguments for a global memory dump. (see 51 // Initial request arguments for a global memory dump. (see
41 // MemoryDumpManager::RequestGlobalMemoryDump()). 52 // MemoryDumpManager::RequestGlobalMemoryDump()).
42 struct BASE_EXPORT MemoryDumpRequestArgs { 53 struct BASE_EXPORT MemoryDumpRequestArgs {
43 // Globally unique identifier. In multi-process dumps, all processes issue a 54 // Globally unique identifier. In multi-process dumps, all processes issue a
44 // local dump with the same guid. This allows the trace importers to 55 // local dump with the same guid. This allows the trace importers to
45 // reconstruct the global dump. 56 // reconstruct the global dump.
46 uint64_t dump_guid; 57 uint64_t dump_guid;
47 58
48 MemoryDumpType dump_type; 59 MemoryDumpType dump_type;
49 MemoryDumpLevelOfDetail level_of_detail; 60 MemoryDumpLevelOfDetail level_of_detail;
50 }; 61 };
51 62
52 using MemoryDumpCallback = Callback<void(uint64_t dump_guid, bool success)>; 63 using MemoryDumpCallback = Callback<void(uint64_t dump_guid, bool success)>;
53 64
54 BASE_EXPORT const char* MemoryDumpTypeToString(const MemoryDumpType& dump_type); 65 BASE_EXPORT const char* MemoryDumpTypeToString(const MemoryDumpType& dump_type);
55 66
56 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString( 67 BASE_EXPORT const char* MemoryDumpLevelOfDetailToString(
57 const MemoryDumpLevelOfDetail& level_of_detail); 68 const MemoryDumpLevelOfDetail& level_of_detail);
58 69
59 BASE_EXPORT MemoryDumpLevelOfDetail 70 BASE_EXPORT MemoryDumpLevelOfDetail
60 StringToMemoryDumpLevelOfDetail(const std::string& str); 71 StringToMemoryDumpLevelOfDetail(const std::string& str);
61 72
62 } // namespace trace_event 73 } // namespace trace_event
63 } // namespace base 74 } // namespace base
64 75
65 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_ 76 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_REQUEST_ARGS_H_
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | base/trace_event/memory_dump_request_args.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698