diff options
author | rbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 15:51:48 +0000 |
---|---|---|
committer | rbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 15:51:48 +0000 |
commit | e7ca8dd2ef98a042b7cc7437419067c43cadf1b0 (patch) | |
tree | b5d309ff8d2cce994697e1ab04562149aeafc2db /ipc/ipc_channel_proxy.cc | |
parent | f1d34fd99329613bb174cb9907f2dea2eb2ba666 (diff) | |
download | chromium_src-e7ca8dd2ef98a042b7cc7437419067c43cadf1b0.zip chromium_src-e7ca8dd2ef98a042b7cc7437419067c43cadf1b0.tar.gz chromium_src-e7ca8dd2ef98a042b7cc7437419067c43cadf1b0.tar.bz2 |
Add simple trace logging of received IPC messages
Adds an entry to chrome://tracing for processing IPC messages that includes the IPC message type ID (which can be matched to a name with the ipclist tool), and in DEBUG builds (or other builds where IPC_MESSAGE_LOG_ENABLED has been set), the message name.
Also adds shell_messages.h to the message generator headers (per the rules in ipc_message_macros.h) to fix broken IPC message logging.
BUG=79942
TEST=
Review URL: http://codereview.chromium.org/9389020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_proxy.cc')
-rw-r--r-- | ipc/ipc_channel_proxy.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc index f542eae..0c26267 100644 --- a/ipc/ipc_channel_proxy.cc +++ b/ipc/ipc_channel_proxy.cc @@ -1,9 +1,10 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/bind.h" #include "base/compiler_specific.h" +#include "base/debug/trace_event.h" #include "base/location.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" @@ -238,13 +239,23 @@ void ChannelProxy::Context::AddFilter(MessageFilter* filter) { // Called on the listener's thread void ChannelProxy::Context::OnDispatchMessage(const Message& message) { +#ifdef IPC_MESSAGE_LOG_ENABLED + Logging* logger = Logging::GetInstance(); + std::string name; + logger->GetMessageText(message.type(), &name, &message, NULL); + TRACE_EVENT1("task", "ChannelProxy::Context::OnDispatchMessage", + "name", name); +#else + TRACE_EVENT1("task", "ChannelProxy::Context::OnDispatchMessage", + "type", message.type()); +#endif + if (!listener_) return; OnDispatchConnected(); #ifdef IPC_MESSAGE_LOG_ENABLED - Logging* logger = Logging::GetInstance(); if (message.type() == IPC_LOGGING_ID) { logger->OnReceivedLoggingMessage(message); return; |