summaryrefslogtreecommitdiffstats
path: root/dbus/object_proxy.cc
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 21:03:29 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 21:03:29 +0000
commit3ebd384a5bbbac045e7ae7e07f8c8d9934dd7c69 (patch)
tree176514ecc364a5aa376aca2fc60e2440d5817384 /dbus/object_proxy.cc
parent42774e4a2cffae20a5ab38ed43ed79ef9376e2fd (diff)
downloadchromium_src-3ebd384a5bbbac045e7ae7e07f8c8d9934dd7c69.zip
chromium_src-3ebd384a5bbbac045e7ae7e07f8c8d9934dd7c69.tar.gz
chromium_src-3ebd384a5bbbac045e7ae7e07f8c8d9934dd7c69.tar.bz2
Add DBusStatistics and DBusLogSource to log and show dbus stats
The intention of this is to provide low overhead detailed logging to ensure that dbus call counts remain reasonable as we migrate NetworkLibrary and other systtems from src/chrome to src/chromeos. We already have UMA stats which provide high level numbers that we can watch, but this will make detailed debugging available for advanced users and in feedback reports. BUG=159635 For chrome/chrome_browser_chromeos.gypi: TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11363173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167742 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/object_proxy.cc')
-rw-r--r--dbus/object_proxy.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/dbus/object_proxy.cc b/dbus/object_proxy.cc
index 5e9bf5b..87950d1 100644
--- a/dbus/object_proxy.cc
+++ b/dbus/object_proxy.cc
@@ -12,6 +12,7 @@
#include "base/stringprintf.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
+#include "dbus/dbus_statistics.h"
#include "dbus/message.h"
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
@@ -25,7 +26,7 @@ const char kErrorServiceUnknown[] = "org.freedesktop.DBus.Error.ServiceUnknown";
const int kSuccessRatioHistogramMaxValue = 2;
// The path of D-Bus Object sending NameOwnerChanged signal.
-const char kDbusSystemObjectPath[] = "/org/freedesktop/DBus";
+const char kDBusSystemObjectPath[] = "/org/freedesktop/DBus";
// Gets the absolute signal name by concatenating the interface name and
// the signal name. Used for building keys for method_table_ in
@@ -83,6 +84,9 @@ Response* ObjectProxy::CallMethodAndBlock(MethodCall* method_call,
UMA_HISTOGRAM_ENUMERATION("DBus.SyncMethodCallSuccess",
response_message ? 1 : 0,
kSuccessRatioHistogramMaxValue);
+ statistics::AddBlockingSentMethodCall(service_name_,
+ method_call->GetInterface(),
+ method_call->GetMember());
if (!response_message) {
LogMethodCallFailure(method_call->GetInterface(),
@@ -144,6 +148,10 @@ void ObjectProxy::CallMethodWithErrorCallback(MethodCall* method_call,
callback,
error_callback,
start_time);
+ statistics::AddSentMethodCall(service_name_,
+ method_call->GetInterface(),
+ method_call->GetMember());
+
// Wait for the response in the D-Bus thread.
bus_->PostTaskToDBusThread(FROM_HERE, task);
}
@@ -433,7 +441,7 @@ DBusHandlerResult ObjectProxy::HandleMessage(
// allow other object proxies to handle instead.
const dbus::ObjectPath path = signal->GetPath();
if (path != object_path_) {
- if (path.value() == kDbusSystemObjectPath &&
+ if (path.value() == kDBusSystemObjectPath &&
signal->GetMember() == "NameOwnerChanged") {
// Handle NameOwnerChanged separately
return HandleNameOwnerChanged(signal.Pass());
@@ -444,6 +452,8 @@ DBusHandlerResult ObjectProxy::HandleMessage(
const std::string interface = signal->GetInterface();
const std::string member = signal->GetMember();
+ statistics::AddReceivedSignal(service_name_, interface, member);
+
// Check if we know about the signal.
const std::string absolute_signal_name = GetAbsoluteSignalName(
interface, member);