How to log IPC messages on Windows

485 views
Skip to first unread message

Marshall Greenblatt

unread,
Jun 12, 2015, 12:15:20 PM6/12/15
to chromium-dev
Hi All,

What is the currently recommended approach for logging and viewing IPC messages on Windows? The chome://ipc functionality no longer exists [1] and I can't find any updated instructions for Windows. I'm using a Debug build of Chromium.

Thanks,
Marshall

Antoine Labour

unread,
Jun 12, 2015, 1:21:42 PM6/12/15
to Marshall Greenblatt, chromium-dev
On Fri, Jun 12, 2015 at 9:13 AM, Marshall Greenblatt <magree...@gmail.com> wrote:
Hi All,

What is the currently recommended approach for logging and viewing IPC messages on Windows? The chome://ipc functionality no longer exists [1] and I can't find any updated instructions for Windows. I'm using a Debug build of Chromium.

Depending on what you're doing, using about:tracing can be a very effective tool at debugging/viewing IPCs. On a debug build you should get full logging of IPCs there. On a release build, you can get IPC type/line information.

Antoine

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Marshall Greenblatt

unread,
Jun 12, 2015, 1:39:00 PM6/12/15
to chromium-dev
On Fri, Jun 12, 2015 at 12:13 PM, Marshall Greenblatt <magree...@gmail.com> wrote:
Hi All,

What is the currently recommended approach for logging and viewing IPC messages on Windows? The chome://ipc functionality no longer exists [1] and I can't find any updated instructions for Windows. I'm using a Debug build of Chromium.

OK, this is what works if you want to log IPC messages to file:

1. In chrome\common\chrome_logging.cc remove the defined(OS_POSIX) condition from line 17 [1]. Otherwise all IPC messages will be reported as "unknown type".

2. Create a Debug build of chrome or explicitly set IPC_MESSAGE_LOG_ENABLED to true in ipc/ipc_message.h.

3. Set the CHROME_IPC_LOGGING environment variable. This causes IPC::Logging::Enabled() to return true so the appropriate IPC::Logging methods will be called.

4. IPC messages will be written only to stderr by IPC::Logging::Log because an IPC::Logging::Consumer is never assigned. You can redirect the stderr output to file by running chrome.exe follows:

chrome.exe 2> output.err

5. See output like:


Marshall Greenblatt

unread,
Jun 12, 2015, 1:44:12 PM6/12/15
to Antoine Labour, chromium-dev
On Fri, Jun 12, 2015 at 1:20 PM, Antoine Labour <pi...@google.com> wrote:
On Fri, Jun 12, 2015 at 9:13 AM, Marshall Greenblatt <magree...@gmail.com> wrote:
Hi All,

What is the currently recommended approach for logging and viewing IPC messages on Windows? The chome://ipc functionality no longer exists [1] and I can't find any updated instructions for Windows. I'm using a Debug build of Chromium.

Depending on what you're doing, using about:tracing can be a very effective tool at debugging/viewing IPCs. On a debug build you should get full logging of IPCs there. On a release build, you can get IPC type/line information.

What about:tracing categories and/or command-line flags would I use if I wanted to see all IPC messages related to the ppapi process, for example?

Antoine Labour

unread,
Jun 12, 2015, 2:49:33 PM6/12/15
to Marshall Greenblatt, chromium-dev
On Fri, Jun 12, 2015 at 10:43 AM, Marshall Greenblatt <magree...@gmail.com> wrote:
On Fri, Jun 12, 2015 at 1:20 PM, Antoine Labour <pi...@google.com> wrote:
On Fri, Jun 12, 2015 at 9:13 AM, Marshall Greenblatt <magree...@gmail.com> wrote:
Hi All,

What is the currently recommended approach for logging and viewing IPC messages on Windows? The chome://ipc functionality no longer exists [1] and I can't find any updated instructions for Windows. I'm using a Debug build of Chromium.

Depending on what you're doing, using about:tracing can be a very effective tool at debugging/viewing IPCs. On a debug build you should get full logging of IPCs there. On a release build, you can get IPC type/line information.

What about:tracing categories and/or command-line flags would I use if I wanted to see all IPC messages related to the ppapi process, for example?

I don't think we have an ability to filter tracing based on IPC types, but:
- you would want to select the "ipc" category (together with other categories you're interested in - or not).
- you'll see a bunch of traces with "SyncChannel::Send" - that's the thread sending a message, and "ChannelProxy::Context::OnDispatchMessage" - that's the thread receiving a message. Either one also contains information about the message
- in Release the trace only contains class/lines for messages. |class| is the value of the IPCMessageStart enum (in ipc/ipc_message_start.h) for the message, that's referenced at the top of the *_messages.h file that defines the message. |line| is the line in the same *_messages.h file where the message is defined
- in Debug (or if IPC_MESSAGE_LOG_ENABLED) we trace the full contents of the message.
- you can always parse the trace file (it's json) to find what you're looking for, but that's a lot more involved.

Antoine
Reply all
Reply to author
Forward
0 new messages