Details
Description
IPC logging can be enabled with the CHROME_IPC_LOGGING macro for debug build. For example,
$ CHROME_IPC_LOGGING=color ./demobrowser
The generated log looks like this:
ipc 19096.0.1287003967 2147483647 [unknown type 1835095] 1479479079.66858 1479479079.71308 1479479079.71309 ipc 19096.0.1287003967 2147483647 [unknown type 852149] 1479479079.71316 1479479079.71321 1479479079.71326 ipc 19096.0.1287003967 2147483647 [unknown type 852084] 1479479079.66958 1479479079.71311 1479479079.71322 ipc 19096.0.1287003967 2147483647 [unknown type 852096] 1479479079.66960 1479479079.71323 1479479079.71338 ipc 19096.0.1287003967 2147483647 [unknown type 852153] 1479479079.71336 1479479079.71344 1479479079.71348 ipc 19096.0.1287003967 2147483647 [unknown type 1835100]
The correct log should be something like this:
ipc 2147483647 ChildProcessHostMsg_SetThreadPriority 3, 2 1479483568.76056 1479483568.77083 1479483568.77090 ipc 2147483647 ChildProcessHostMsg_SetThreadPriority 2, 2 1479483568.77375 1479483568.77455 1479483568.77460 ipc 2147483647 ChildProcessHostMsg_SetThreadPriority 7, 0 1479483568.77378 1479483568.77474 1479483568.77477 ipc 2 PageMsg_WasShown 1479483568.69146 1479483568.77694 1479483568.77697 ipc 1 ViewMsg_UpdateWebPreferences (<std::map>, <std::map>, <std::map>, <std::map>, <std::map>, <std::map>, 16, 13, 0, 6, ISO-8859-1, false, true, true, true, true, true, true, false, true, true, false, true, false, true, true, true, false, true, true, true, true, false, true, false, false, true, true, false, false, false, true, true, true, false, true, false, false, true, 65792, false, false, true, 0, false, false, false, false, false, false, false, false, false, false, false, true, false, true, false, false, true, true, 0, 4, 4, 4, 4, true, false, false, 4, 2, true, false, false, false, 0, false, true, false, true, true, false, 0, false, 0, true, 0.000000e+00, -1.000000e+00, -1.000000e+00, -1.000000e+00, -1.000000e+00, , 1.000000e+00, 4.000000e+00, false) 1479483568.70045 1479483568.77725 1479483568.77738 ipc 2 PageMsg_UpdateWindowScreenRect (2242, 37, 804, 640) 1479483568.70276 1479483568.77762 1479483568.77764 ipc 1 InputMsg_CursorVisibilityChange true 1479483568.70284 1479483568.77788 1479483568.77789 ipc 2 PageMsg_UpdateWindowScreenRect (2242, 37, 804, 640)
As you can see the actual result is not really meaningful. The message names are unknown and "unknown type" is generated in the log.
The message names should be registered by
g_LoggerRegisterHelper##msg_name
objects generated by the IPC_MESSAGE_EXTRA macro. This macro is defined in chromium/ipc/ipc_message_macros.h.
The macro is called during the debug build and generates the register helper object instantiations. The symbols of the genereted objects exist:
$ nm -a src/core/Debug/obj/src/3rdparty/chromium/content/common/content_common.content_ipc_logging.o ... 0000000000000318 B g_LoggerRegisterHelperViewMsg_WasShown 0000000000000336 B g_LoggerRegisterHelperViewMsg_WorkerConnected 0000000000000334 B g_LoggerRegisterHelperViewMsg_WorkerCreated 0000000000000335 B g_LoggerRegisterHelperViewMsg_WorkerScriptLoadFailed 000000000000031e B g_LoggerRegisterHelperViewMsg_Zoom 00000000000001f1 B g_LoggerRegisterHelperWebRTCEventLogMsg_DisableEventLog 00000000000001ef B g_LoggerRegisterHelperWebRTCEventLogMsg_EnableEventLog ...
However, the corresponding constructors (which should do the IPC message name registration) are never called. Most probably the constructor calls of these unused objects are optimized out during the build.