gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 42/64: added logging


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 42/64: added logging
Date: Sat, 30 Dec 2017 20:58:27 +0100

This is an automated email from the git hooks/post-receive script.

lurchi pushed a commit to branch master
in repository gnunet.

commit 7d957ddfa3ab1a45c38ba3345ef0972748a8a79b
Author: t3sserakt <address@hidden>
AuthorDate: Sat Nov 25 17:22:29 2017 +0100

    added logging
---
 src/multicast/gnunet-service-multicast.c |  5 +++--
 src/util/client.c                        |  3 ++-
 src/util/mq.c                            |  7 ++++---
 src/util/service.c                       | 24 ++++++++++++++++++++++++
 4 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/src/multicast/gnunet-service-multicast.c 
b/src/multicast/gnunet-service-multicast.c
index 11f3c08b7..e7143acf6 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -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),
diff --git a/src/util/client.c b/src/util/client.c
index ded32f577..e5bf7e176 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -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",
diff --git a/src/util/mq.c b/src/util/mq.c
index 793fd70ae..58aba7797 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -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;
diff --git a/src/util/service.c b/src/util/service.c
index 782adf5c5..b4eb33caa 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -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! */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]