gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24495 - in gnunet: . src/statistics


From: gnunet
Subject: [GNUnet-SVN] r24495 - in gnunet: . src/statistics
Date: Tue, 23 Oct 2012 20:42:46 +0200

Author: grothoff
Date: 2012-10-23 20:42:46 +0200 (Tue, 23 Oct 2012)
New Revision: 24495

Modified:
   gnunet/configure.ac
   gnunet/src/statistics/statistics_api.c
Log:
-add option to make expensive heap stat gathering optional

Modified: gnunet/configure.ac
===================================================================
--- gnunet/configure.ac 2012-10-23 18:29:31 UTC (rev 24494)
+++ gnunet/configure.ac 2012-10-23 18:42:46 UTC (rev 24495)
@@ -999,6 +999,15 @@
 AC_MSG_RESULT($enable_experimental)
 AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
 
+# should memory statistics be kept (very expensive CPU-wise!)
+AC_MSG_CHECKING(whether to create expensive statistics on memory use)
+AC_ARG_ENABLE([heapstats],
+   [AS_HELP_STRING([--enable-heapstats], [enable expensive heap statistics])],
+   [enable_heapstats=1],
+   [enable_heapstats=0])
+AC_MSG_RESULT($enable_heapstats)
+AC_DEFINE_UNQUOTED([ENABLE_HEAP_STATISTICS],$enable_heapstats,[enable 
expensive heap statistics])
+
 # should code be enabled that works around missing OS functionality on Windows?
 # used for test cases
 if test $build_target = "mingw"

Modified: gnunet/src/statistics/statistics_api.c
===================================================================
--- gnunet/src/statistics/statistics_api.c      2012-10-23 18:29:31 UTC (rev 
24494)
+++ gnunet/src/statistics/statistics_api.c      2012-10-23 18:42:46 UTC (rev 
24495)
@@ -271,6 +271,7 @@
 static void
 update_memory_statistics (struct GNUNET_STATISTICS_Handle *h)
 {
+#if ENABLE_HEAP_STATISTICS
   uint64_t current_heap_size = 0;
   uint64_t current_rss = 0;
 
@@ -304,6 +305,7 @@
     h->peak_rss = current_rss;
     GNUNET_STATISTICS_set (h, "# peak resident set size", current_rss, 
GNUNET_NO);
   }
+#endif
 }
 
 




reply via email to

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