From: lurchi Date: Sat, 30 Dec 2017 19:39:39 +0000 (+0100) Subject: Revert "tried to print out stacktrace, not working. removed." X-Git-Tag: gnunet-0.11.0rc0~48^2~1^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8412625bb5191040389610364167c768bb55efb4;p=oweals%2Fgnunet.git Revert "tried to print out stacktrace, not working. removed." This reverts commit 1522bb78401dd739299cc507e7237df32f239a3f. --- diff --git a/src/util/mq.c b/src/util/mq.c index 3c1fba149..8d71359ac 100644 --- a/src/util/mq.c +++ b/src/util/mq.c @@ -28,30 +28,6 @@ #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 { @@ -888,18 +864,6 @@ 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 c204f1f87..b4eb33caa 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -36,30 +36,6 @@ #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__) @@ -2553,18 +2529,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) {