added logging
authort3sserakt <t3ss@posteo.de>
Sat, 25 Nov 2017 16:22:29 +0000 (17:22 +0100)
committert3sserakt <t3ss@posteo.de>
Sat, 25 Nov 2017 16:22:29 +0000 (17:22 +0100)
src/multicast/gnunet-service-multicast.c
src/util/client.c
src/util/mq.c
src/util/service.c

index 11f3c08b70a8604d7548a35f96922163dfd70ac7..e7143acf6d5bd317a5b72317de12066f5ee5c3df 100644 (file)
@@ -559,8 +559,9 @@ client_send_group_keep_envelope (const struct Group *grp,
   struct ClientList *cli = grp->clients_head;
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "%p Sending message to all clients of the group.\n",
-              grp);
+              "%p Sending message of type %u to all clients of the group.\n",
+              grp,
+              ntohs (env->mh->type));
   while (NULL != cli)
   {
     GNUNET_MQ_send_copy (GNUNET_SERVICE_client_get_mq (cli->client),
index ded32f577216d8828803fd6daadf65a45b7181e1..e5bf7e17698d1592dbb49b5c6f39ec5c200b89bb 100644 (file)
@@ -274,7 +274,8 @@ transmit_ready (void *cls)
   if (-1 == ret)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "client: error during sending message of type %u\n", ntohs(cstate->msg->type));
+                "client: error during sending message of type %u\n",
+                ntohs(cstate->msg->type));
     if (EINTR == errno){
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "client: retrying message of type %u\n",
index 793fd70aeccd2c870eba51919501e565bbe151fc..58aba7797a901afd89fd2c185970c294efe65b4e 100644 (file)
@@ -361,8 +361,9 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
   mq->current_envelope = ev;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "mq: sending message of type %u, queue empty\n",
-              ntohs(ev->mh->type));
+              "mq: sending message of type %u, queue empty (MQ: %p)\n",
+              ntohs(ev->mh->type),
+              mq);
 
   mq->send_impl (mq,
                 ev->mh,
@@ -863,7 +864,7 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
      * are not queued! */
     mq->current_envelope->parent_queue = NULL;
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "MQ destroy drops message of type %u\n",
+                "MQ destroy drops current message of type %u\n",
                 ntohs (mq->current_envelope->mh->type));
     GNUNET_MQ_discard (mq->current_envelope);
     mq->current_envelope = NULL;
index 782adf5c5369d25dd1b355219b9a18387f0113ff..b4eb33caacccf03c76058c3dc2f35ce59bfd46bf 100644 (file)
@@ -1932,6 +1932,11 @@ do_send (void *cls)
   size_t left;
   const char *buf;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "service: sending message with type %u",
+       ntohs(client->msg->type));
+
+
   client->send_task = NULL;
   buf = (const char *) client->msg;
   left = ntohs (client->msg->size) - client->msg_pos;
@@ -1941,6 +1946,8 @@ do_send (void *cls)
   GNUNET_assert (ret <= (ssize_t) left);
   if (0 == ret)
   {
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "no data send");
     GNUNET_MQ_inject_error (client->mq,
                            GNUNET_MQ_ERROR_WRITE);
     return;
@@ -1958,6 +1965,9 @@ do_send (void *cls)
       if (EPIPE != errno)
         GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
                              "send");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "socket send returned with error code %i",
+           errno);
       GNUNET_MQ_inject_error (client->mq,
                              GNUNET_MQ_ERROR_WRITE);
       return;
@@ -2518,6 +2528,20 @@ GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c)
               "Client dropped: %p (MQ: %p)\n",
               c,
               c->mq);
+
+#if EXECINFO
+  void *backtrace_array[MAX_TRACE_DEPTH];
+  int num_backtrace_strings = backtrace (backtrace_array, MAX_TRACE_DEPTH);
+    char **backtrace_strings =
+        backtrace_symbols (backtrace_array,
+         t->num_backtrace_strings);
+    for (unsigned int i = 0; i < num_backtrace_strings; i++)
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+     "client drop trace %u: %s\n",
+     i,
+     backtrace_strings[i]);
+#endif
+
   if (NULL != c->drop_task)
   {
     /* asked to drop twice! */