diff options
author | primiano <primiano@chromium.org> | 2015-04-01 10:58:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-01 17:59:41 +0000 |
commit | 04f9de655915bfaf9fa2c90ee4848452ca71d89f (patch) | |
tree | 56c562213786d4045e0f3630a5e7c13c7d27d9cb /components/tracing/child_trace_message_filter.h | |
parent | 4542844b847c18f51a4da24aa2cf7a1229e67012 (diff) | |
download | chromium_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/child_trace_message_filter.h')
-rw-r--r-- | components/tracing/child_trace_message_filter.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/tracing/child_trace_message_filter.h b/components/tracing/child_trace_message_filter.h index 75ab067..d3d934097 100644 --- a/components/tracing/child_trace_message_filter.h +++ b/components/tracing/child_trace_message_filter.h @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/memory/ref_counted_memory.h" +#include "base/trace_event/memory_dump_request_args.h" #include "ipc/message_filter.h" namespace base { @@ -25,6 +26,10 @@ class ChildTraceMessageFilter : public IPC::MessageFilter { void OnFilterRemoved() override; bool OnMessageReceived(const IPC::Message& message) override; + void SendGlobalMemoryDumpRequest( + const base::trace_event::MemoryDumpRequestArgs& args, + const base::trace_event::MemoryDumpCallback& callback); + protected: ~ChildTraceMessageFilter() override; @@ -44,6 +49,9 @@ class ChildTraceMessageFilter : public IPC::MessageFilter { const std::string& event_name); void OnCancelWatchEvent(); void OnWatchEventMatched(); + void OnProcessMemoryDumpRequest( + const base::trace_event::MemoryDumpRequestArgs& args); + void OnGlobalMemoryDumpResponse(uint64 dump_guid, bool success); // Callback from trace subsystem. void OnTraceDataCollected( |