summaryrefslogtreecommitdiffstats
path: root/components/tracing/tracing_messages.h
diff options
context:
space:
mode:
authorprimiano <primiano@chromium.org>2015-04-01 10:58:31 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-01 17:59:41 +0000
commit04f9de655915bfaf9fa2c90ee4848452ca71d89f (patch)
tree56c562213786d4045e0f3630a5e7c13c7d27d9cb /components/tracing/tracing_messages.h
parent4542844b847c18f51a4da24aa2cf7a1229e67012 (diff)
downloadchromium_src-04f9de655915bfaf9fa2c90ee4848452ca71d89f.zip
chromium_src-04f9de655915bfaf9fa2c90ee4848452ca71d89f.tar.gz
chromium_src-04f9de655915bfaf9fa2c90ee4848452ca71d89f.tar.bz2
[tracing] IPC messages and stubs for inter-process memory dumps
This CL introduces the four IPC messages and the message filter stubs that will be used by the upcoming CLs to coordinate memory dumps across processes. The global coordination policy is simple: all the global dumps must be orchestrated and handled by the browser process' MemoryDumpManager. Memory dumps initiated by a child process must be routed through the browser's MDM. In other words this reads as: all the Chrome processes have a MDM, but the browser's MDM is a more senior and responsible manager. This CL introduces a total of four IPC messages: (request, response) x (process, global), as follows: Request local (i.e. current process) dumps to children: (browser -> child) TracingMsg_ProcessMemoryDumpRequest (child -> browser) TracingHostMsg_ProcessMemoryDumpResponse Initiate global dumps from a child process: (child -> browser) TracingHostMsg_GlobalMemoryDumpRequest (browser -> child) TracingMsg_GlobalMemoryDumpResponse If the global dump is initiated by the browser process, a total of N_children x 2 (req/resp) IPC messages occur to perform the dump. If the global dump is initiated by a child process, a further couple of IPC messages (GlobalMemoryDump{Request,Response}) is required in order to, respectively, tell the browser's MDM to initiate the dump and get the final result back (all the child processes succeed / the global dump was aborted because another one was in progress). More context and design doc are available in the attached BUG. BUG=462930 Review URL: https://codereview.chromium.org/1042723002 Cr-Commit-Position: refs/heads/master@{#323284}
Diffstat (limited to 'components/tracing/tracing_messages.h')
-rw-r--r--components/tracing/tracing_messages.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/components/tracing/tracing_messages.h b/components/tracing/tracing_messages.h
index 6cd6b27..d9ba630 100644
--- a/components/tracing/tracing_messages.h
+++ b/components/tracing/tracing_messages.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/sync_socket.h"
+#include "base/trace_event/memory_dump_request_args.h"
#include "base/trace_event/trace_event_impl.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
@@ -21,6 +22,15 @@ IPC_STRUCT_TRAITS_MEMBER(event_capacity)
IPC_STRUCT_TRAITS_MEMBER(event_count)
IPC_STRUCT_TRAITS_END()
+IPC_STRUCT_TRAITS_BEGIN(base::trace_event::MemoryDumpRequestArgs)
+IPC_STRUCT_TRAITS_MEMBER(dump_guid)
+IPC_STRUCT_TRAITS_MEMBER(dump_type)
+IPC_STRUCT_TRAITS_END()
+
+IPC_ENUM_TRAITS_MAX_VALUE(
+ base::trace_event::MemoryDumpType,
+ static_cast<int>(base::trace_event::MemoryDumpType::LAST))
+
// Sent to all child processes to enable trace event recording.
IPC_MESSAGE_CONTROL3(TracingMsg_BeginTracing,
std::string /* category_filter_str */,
@@ -53,6 +63,16 @@ IPC_MESSAGE_CONTROL2(TracingMsg_SetWatchEvent,
// Sent to all child processes to clear watch event.
IPC_MESSAGE_CONTROL0(TracingMsg_CancelWatchEvent)
+// Sent to all child processes to request a local (current process) memory dump.
+IPC_MESSAGE_CONTROL1(TracingMsg_ProcessMemoryDumpRequest,
+ base::trace_event::MemoryDumpRequestArgs)
+
+// Reply to TracingHostMsg_GlobalMemoryDumpRequest, sent by the browser process.
+// This is to get the result of a global dump initiated by a child process.
+IPC_MESSAGE_CONTROL2(TracingMsg_GlobalMemoryDumpResponse,
+ uint64 /* dump_guid */,
+ bool /* success */)
+
// Sent everytime when a watch event is matched.
IPC_MESSAGE_CONTROL0(TracingHostMsg_WatchEventMatched)
@@ -79,3 +99,12 @@ IPC_MESSAGE_CONTROL1(TracingHostMsg_MonitoringTraceDataCollected,
IPC_MESSAGE_CONTROL1(
TracingHostMsg_TraceLogStatusReply,
base::trace_event::TraceLogStatus /*status of the trace log*/)
+
+// Sent to the browser to initiate a global memory dump from a child process.
+IPC_MESSAGE_CONTROL1(TracingHostMsg_GlobalMemoryDumpRequest,
+ base::trace_event::MemoryDumpRequestArgs)
+
+// Reply to TracingMsg_ProcessMemoryDumpRequest.
+IPC_MESSAGE_CONTROL2(TracingHostMsg_ProcessMemoryDumpResponse,
+ uint64 /* dump_guid */,
+ bool /* success */)