From 12997f9148d918c434a4c4bae1549b250a78cac0 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Wed, 8 Nov 2017 20:07:06 +0100 Subject: changed log levels --- src/util/mq.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/util/mq.c') diff --git a/src/util/mq.c b/src/util/mq.c index 6ad6b82eb..793fd70ae 100644 --- a/src/util/mq.c +++ b/src/util/mq.c @@ -360,7 +360,7 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, GNUNET_assert (NULL == mq->envelope_head); mq->current_envelope = ev; - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mq: sending message of type %u, queue empty\n", ntohs(ev->mh->type)); @@ -460,8 +460,9 @@ impl_send_continue (void *cls) mq->envelope_tail, mq->current_envelope); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "mq: sending message of type %u from queue\n", ntohs(mq->current_envelope->mh->type)); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "mq: sending message of type %u from queue\n", + ntohs(mq->current_envelope->mh->type)); mq->send_impl (mq, mq->current_envelope->mh, @@ -946,8 +947,9 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev) mq->envelope_tail, mq->current_envelope); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "mq: sending canceled message of type %u queue\n", ntohs(ev->mh->type)); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "mq: sending canceled message of type %u queue\n", + ntohs(ev->mh->type)); mq->send_impl (mq, mq->current_envelope->mh, -- cgit v1.2.3 From 7d957ddfa3ab1a45c38ba3345ef0972748a8a79b Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Sat, 25 Nov 2017 17:22:29 +0100 Subject: 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(-) (limited to 'src/util/mq.c') 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! */ -- cgit v1.2.3 From 1522bb78401dd739299cc507e7237df32f239a3f Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Sat, 25 Nov 2017 18:03:03 +0100 Subject: tried to print out stacktrace, not working. removed. --- src/util/mq.c | 36 ++++++++++++++++++++++++++++++++++++ src/util/service.c | 48 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 72 insertions(+), 12 deletions(-) (limited to 'src/util/mq.c') diff --git a/src/util/mq.c b/src/util/mq.c index 58aba7797..4984df76c 100644 --- a/src/util/mq.c +++ b/src/util/mq.c @@ -28,6 +28,30 @@ #define LOG(kind,...) GNUNET_log_from (kind, "util-mq",__VA_ARGS__) +//#if HAVE_EXECINFO_H +//#include "execinfo.h" + +///** +// * Use lsof to generate file descriptor reports on select error? +// * (turn off for stable releases). +// */ +//#define USE_LSOF GNUNET_NO + +///** +// * Obtain trace information for all scheduler calls that schedule tasks. +// */ +//#define EXECINFO GNUNET_NO + +///** +// * Check each file descriptor before adding +// */ +//#define DEBUG_FDS GNUNET_NO + +///** +// * Depth of the traces collected via EXECINFO. +// */ +//#define MAX_TRACE_DEPTH 50 +//#endif struct GNUNET_MQ_Envelope { @@ -866,6 +890,18 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "MQ destroy drops current message of type %u\n", ntohs (mq->current_envelope->mh->type)); +//#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 GNUNET_MQ_discard (mq->current_envelope); mq->current_envelope = NULL; GNUNET_assert (0 < mq->queue_length); diff --git a/src/util/service.c b/src/util/service.c index b4eb33caa..c204f1f87 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -36,6 +36,30 @@ #include "gauger.h" #endif +//#if HAVE_EXECINFO_H +//#include "execinfo.h" + +///** +// * Use lsof to generate file descriptor reports on select error? +// * (turn off for stable releases). +// */ +//#define USE_LSOF GNUNET_NO + +///** +// * Obtain trace information for all scheduler calls that schedule tasks. +// */ +//#define EXECINFO GNUNET_NO + +///** +// * Check each file descriptor before adding +// */ +//#define DEBUG_FDS GNUNET_NO + +///** +// * Depth of the traces collected via EXECINFO. +// */ +//#define MAX_TRACE_DEPTH 50 +//#endif #define LOG(kind,...) GNUNET_log_from (kind, "util-service", __VA_ARGS__) @@ -2529,18 +2553,18 @@ GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c) 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 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) { -- cgit v1.2.3