From 60b2c61f99522724d8093ea742dd934fb95c1b0e Mon Sep 17 00:00:00 2001 From: "piman@chromium.org" Date: Wed, 22 Aug 2012 22:39:57 +0000 Subject: Add traces for SyncChannel::SendWithTimeout BUG=None Review URL: https://chromiumcodereview.appspot.com/10831415 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152841 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/ipc_sync_channel.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ipc') diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc index 47d51b4..a300c0f 100644 --- a/ipc/ipc_sync_channel.cc +++ b/ipc/ipc_sync_channel.cc @@ -5,6 +5,7 @@ #include "ipc/ipc_sync_channel.h" #include "base/bind.h" +#include "base/debug/trace_event.h" #include "base/lazy_instance.h" #include "base/location.h" #include "base/logging.h" @@ -12,6 +13,8 @@ #include "base/synchronization/waitable_event_watcher.h" #include "base/thread_task_runner_handle.h" #include "base/threading/thread_local.h" +#include "ipc/ipc_logging.h" +#include "ipc/ipc_message_macros.h" #include "ipc/ipc_sync_message.h" using base::TimeDelta; @@ -428,6 +431,17 @@ bool SyncChannel::Send(Message* message) { } bool SyncChannel::SendWithTimeout(Message* message, int timeout_ms) { +#ifdef IPC_MESSAGE_LOG_ENABLED + Logging* logger = Logging::GetInstance(); + std::string name; + logger->GetMessageText(message->type(), &name, message, NULL); + TRACE_EVENT1("task", "SyncChannel::SendWithTimeout", + "name", name); +#else + TRACE_EVENT2("task", "SyncChannel::SendWithTimeout", + "class", IPC_MESSAGE_ID_CLASS(message->type()), + "line", IPC_MESSAGE_ID_LINE(message->type())); +#endif if (!message->is_sync()) { ChannelProxy::Send(message); return true; -- cgit v1.1