summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>2015-05-29 09:48:11 +0200
committerUmut Tezduyar Lindskog <umuttl@axis.com>2015-06-10 09:22:32 +0200
commitf9f97ca6927af3a23d9c27e4edf65532ebf23e1e (patch)
tree6409348d5a3252802b8996a8200c94f49d731df4
parentfba3d902b49e1f4654b36c9d4311def4a084c3a7 (diff)
sd-bus: dump sync messages in debug mode
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index edc27aef87..147e6f0376 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -49,6 +49,20 @@
#include "bus-track.h"
#include "bus-slot.h"
+#define log_debug_bus_message(m) do { \
+ sd_bus_message *_m = (m); \
+ log_debug("1Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", \
+ bus_message_type_to_string(_m->header->type), \
+ strna(sd_bus_message_get_sender(_m)), \
+ strna(sd_bus_message_get_destination(_m)), \
+ strna(sd_bus_message_get_path(_m)), \
+ strna(sd_bus_message_get_interface(_m)), \
+ strna(sd_bus_message_get_member(_m)), \
+ BUS_MESSAGE_COOKIE(_m), \
+ _m->reply_cookie, \
+ strna(_m->error.message)); \
+ } while (false)
+
static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec);
static int attach_io_events(sd_bus *b);
static void detach_io_events(sd_bus *b);
@@ -1992,6 +2006,7 @@ _public_ int sd_bus_call(
memmove(bus->rqueue + i, bus->rqueue + i + 1, sizeof(sd_bus_message*) * (bus->rqueue_size - i - 1));
bus->rqueue_size--;
+ log_debug_bus_message(incoming);
if (incoming->header->type == SD_BUS_MESSAGE_METHOD_RETURN) {
@@ -2480,16 +2495,7 @@ static int process_message(sd_bus *bus, sd_bus_message *m) {
bus->current_message = m;
bus->iteration_counter++;
- log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s",
- bus_message_type_to_string(m->header->type),
- strna(sd_bus_message_get_sender(m)),
- strna(sd_bus_message_get_destination(m)),
- strna(sd_bus_message_get_path(m)),
- strna(sd_bus_message_get_interface(m)),
- strna(sd_bus_message_get_member(m)),
- BUS_MESSAGE_COOKIE(m),
- m->reply_cookie,
- strna(m->error.message));
+ log_debug_bus_message(m);
r = process_hello(bus, m);
if (r != 0)