summaryrefslogtreecommitdiff
path: root/bus/driver.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-02-08 15:33:35 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-06-24 16:00:49 +0100
commit206fff7ee60706a803cc8da23bdaf9caa9f2fda1 (patch)
treee54de1d2e05458ff4c810a8193682e50fc1ecb40 /bus/driver.c
parentbc212b72b29caea8d73b4c9a5d3884257c700250 (diff)
downloaddbus-206fff7ee60706a803cc8da23bdaf9caa9f2fda1.tar.gz
Add a stub .Debug.Stats interface if --enable-stats
There are no actual statistics yet, just a count of how many times the method has been called, and (for the per-connection stats) the unique name. Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040
Diffstat (limited to 'bus/driver.c')
-rw-r--r--bus/driver.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/bus/driver.c b/bus/driver.c
index 425a3d5a..9ecfd55f 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -30,6 +30,7 @@
#include "services.h"
#include "selinux.h"
#include "signals.h"
+#include "stats.h"
#include "utils.h"
#include <dbus/dbus-string.h>
#include <dbus/dbus-internals.h>
@@ -1743,6 +1744,14 @@ static const MessageHandler introspectable_message_handlers[] = {
{ NULL, NULL, NULL, NULL }
};
+#ifdef DBUS_ENABLE_STATS
+static const MessageHandler stats_message_handlers[] = {
+ { "GetStats", "", "a{sv}", bus_stats_handle_get_stats },
+ { "GetConnectionStats", "s", "a{sv}", bus_stats_handle_get_connection_stats },
+ { NULL, NULL, NULL, NULL }
+};
+#endif
+
typedef struct {
const char *name;
const MessageHandler *message_handlers;
@@ -1765,6 +1774,9 @@ static InterfaceHandler interface_handlers[] = {
" <arg type=\"s\"/>\n"
" </signal>\n" },
{ DBUS_INTERFACE_INTROSPECTABLE, introspectable_message_handlers, NULL },
+#ifdef DBUS_ENABLE_STATS
+ { BUS_INTERFACE_STATS, stats_message_handlers, NULL },
+#endif
{ NULL, NULL, NULL }
};