summaryrefslogtreecommitdiffstats
path: root/mboxd_dbus.c
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2017-04-27 14:48:58 +1000
committerAndrew Jeffery <andrew@aj.id.au>2017-05-04 01:20:23 +0000
commit2851959877213f23fe5317b9a738d06db41a6666 (patch)
treeefaa77cff69a17ae7b97a943fb7a25062c5cf46d /mboxd_dbus.c
parent5a3a0664b63feba8aff288a5691a9f873e4ea6eb (diff)
downloadphosphor-mboxd-2851959877213f23fe5317b9a738d06db41a6666.tar.gz
phosphor-mboxd-2851959877213f23fe5317b9a738d06db41a6666.zip
mboxd: Introduce a new DEBUG log level
Currently there is no output on the console unless -v is specified on the command line which enables error output. A second -v will provide info output. We probably want error output irrespective of whether a -v was given on the command line because people generally want to know why their program stopped working. Make error output unconditional. A single -v will give minimal informational output which is a good level to see what the daemon is doing without barfing all over the console. A second -v will enable debug output which will print highly verbose information which will be useful for debugging. Probably don't enable this under normal circumstances. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Change-Id: I3da25f7e4e9e976c17389fcceb1d85ef98de7e0a
Diffstat (limited to 'mboxd_dbus.c')
-rw-r--r--mboxd_dbus.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mboxd_dbus.c b/mboxd_dbus.c
index a72e48b..6673ca6 100644
--- a/mboxd_dbus.c
+++ b/mboxd_dbus.c
@@ -159,7 +159,7 @@ static int dbus_handle_kill(struct mbox_context *context,
{
context->terminate = 1;
- MSG_OUT("DBUS Kill - Exiting...\n");
+ MSG_INFO("DBUS Kill - Exiting...\n");
return 0;
}
@@ -276,7 +276,7 @@ static int method_cmd(sd_bus_message *m, void *userdata,
struct mbox_dbus_msg req = { 0 }, resp = { 0 };
struct mbox_context *context;
sd_bus_message *n;
- int rc;
+ int rc, i;
context = (struct mbox_context *) userdata;
if (!context) {
@@ -292,6 +292,7 @@ static int method_cmd(sd_bus_message *m, void *userdata,
rc = -E_DBUS_INTERNAL;
goto out;
}
+ MSG_DBG("DBUS request: %u\n", req.cmd);
/* Read the args */
rc = sd_bus_message_read_array(m, 'y', (const void **) &req.args,
@@ -301,6 +302,10 @@ static int method_cmd(sd_bus_message *m, void *userdata,
rc = -E_DBUS_INTERNAL;
goto out;
}
+ MSG_DBG("DBUS num_args: %u\n", (unsigned) req.num_args);
+ for (i = 0; i < req.num_args; i++) {
+ MSG_DBG("DBUS arg[%d]: %u\n", i, req.args[i]);
+ }
/* Handle the command */
if (req.cmd >= NUM_DBUS_CMDS) {
@@ -332,6 +337,12 @@ out:
goto cleanup;
}
+ MSG_DBG("DBUS response: %u\n", resp.cmd);
+ MSG_DBG("DBUS num_args: %u\n", (unsigned) resp.num_args);
+ for (i = 0; i < resp.num_args; i++) {
+ MSG_DBG("DBUS arg[%d]: %u\n", i, resp.args[i]);
+ }
+
rc = sd_bus_send(NULL, n, NULL); /* Send response */
if (rc < 0)
MSG_ERR("sd_bus_send failed: %d\n", rc);
OpenPOWER on IntegriCloud