From: t3sserakt Date: Sat, 25 Nov 2017 16:22:29 +0000 (+0100) Subject: added logging X-Git-Tag: gnunet-0.11.0rc0~48^2~1^2~16^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7d957ddfa3ab1a45c38ba3345ef0972748a8a79b;p=oweals%2Fgnunet.git added logging --- 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! */