Hello,

currently "gnunet-service-transport" logs the time it took to send some
bytes to a certain peer.  The problem with this logging is that it
floods the logfile with a lot of essentially useless informations.

Aside not really telling anything useful to users (the timing is really
interesting only to those people measuring the performance of the
service/network), it generates a lot of disk writing and easily fill up
disk space (after something like 30 minutes of my peer being active, I
get a log file of several megabytes.)

Another downside is that it actually hides other informations that might
actually be important: for example right now I'm getting a lot of
protocol violation messages within CADET; they were hidden by transport
before (or anyway hard to find.)

The attached patch adds an option to configure.ac to control the
logging. It's disabled by default so normal users don't have to change
their "configure" incantation and people actually interested in
transport performance can opt-in without too much hassle (the option
name is long on purpose.)

When TNG is ready to take over, the option can be removed or even
recycled for the new code. In the meantime, it will avoid a lot of noise
and disk activity.

Thanks,
A.V.

>From 86819deb0a6c2e680bdc33f273a865e62ec807be Mon Sep 17 00:00:00 2001
From: Alessio Vanni <vanni...@firemail.cc>
Date: Thu, 24 Sep 2020 22:04:17 +0200
Subject: [PATCH] Disable some diagnostic until TNG is available

---
 configure.ac                             | 10 ++++++++++
 src/transport/gnunet-service-transport.c |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index 3cf7e6cb6..03c77e986 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1817,6 +1817,16 @@ AC_MSG_RESULT($use_gcov)
 AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
 
 
+# Temporarily disable a specific piece of code until TNG is out.
+AC_ARG_ENABLE([transport-timing-diagnostic],
+              [AS_HELP_STRING([--enable-transport-timing-diagnostic],
+                              [enable logging of transport (not TNG) sending times])],
+              [enable_ttd=yes],
+              [enable_ttd=no])
+AS_IF([test "x$enable_ttd" = "xyes"],
+      [AC_DEFINE([ENABLE_TTD], [1], [Define if transport (not TNG) should warn about sending times.])])
+
+
 # version info
 # TODO: git blame says this predates our switch to git.
 # git-svn should be adjusted to simply git, or
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 207c17f2f..92e37a91c 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -700,6 +700,7 @@ handle_send_transmit_continuation (void *cls,
 
   delay = GNUNET_TIME_absolute_get_duration (stcc->send_time);
   addr = GST_neighbour_get_current_address (&stcc->target);
+#ifdef ENABLE_TTD
   if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "It took us %s to send %u/%u bytes to %s (%d, %s)\n",
@@ -718,6 +719,7 @@ handle_send_transmit_continuation (void *cls,
                 GNUNET_i2s (&stcc->target),
                 success,
                 (NULL != addr) ? addr->transport_name : "%");
+#endif
 
   if (GNUNET_NO == stcc->down)
   {
-- 
2.26.2

Reply via email to