gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29373 - gnunet/src/ats-tests


From: gnunet
Subject: [GNUnet-SVN] r29373 - gnunet/src/ats-tests
Date: Wed, 18 Sep 2013 14:46:26 +0200

Author: wachs
Date: 2013-09-18 14:46:26 +0200 (Wed, 18 Sep 2013)
New Revision: 29373

Added:
   gnunet/src/ats-tests/perf_ats_logging.c
   gnunet/src/ats-tests/perf_ats_logging.h
Modified:
   gnunet/src/ats-tests/Makefile.am
   gnunet/src/ats-tests/perf_ats.c
Log:
remove unused variable
added basic files for logging


Modified: gnunet/src/ats-tests/Makefile.am
===================================================================
--- gnunet/src/ats-tests/Makefile.am    2013-09-18 12:03:52 UTC (rev 29372)
+++ gnunet/src/ats-tests/Makefile.am    2013-09-18 12:46:26 UTC (rev 29373)
@@ -48,7 +48,7 @@
 endif
 
 perf_ats_proportional_core_none_SOURCES = \
-  perf_ats.c  
+  perf_ats.c perf_ats_logging.c
 perf_ats_proportional_core_none_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/testbed/libgnunettestbed.la \
@@ -57,7 +57,7 @@
   $(top_builddir)/src/transport/libgnunettransport.la    
 
 perf_ats_proportional_transport_none_SOURCES = \
-  perf_ats.c  
+  perf_ats.c perf_ats_logging.c
 perf_ats_proportional_transport_none_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/testbed/libgnunettestbed.la \

Modified: gnunet/src/ats-tests/perf_ats.c
===================================================================
--- gnunet/src/ats-tests/perf_ats.c     2013-09-18 12:03:52 UTC (rev 29372)
+++ gnunet/src/ats-tests/perf_ats.c     2013-09-18 12:46:26 UTC (rev 29373)
@@ -28,6 +28,7 @@
 #include "gnunet_testbed_service.h"
 #include "gnunet_ats_service.h"
 #include "gnunet_core_service.h"
+#include "perf_ats_logging.h"
 
 #define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 
10)
 #define BENCHMARK_DURATION GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 5)
@@ -264,6 +265,11 @@
  */
 static int result;
 
+/**
+ * Test result logging
+ */
+static int logging;
+
 /**Test core (GNUNET_YES) or transport (GNUNET_NO)
  */
 static int test_core;
@@ -353,6 +359,9 @@
   int c_s;
   int c_op;
 
+  if (GNUNET_YES == logging)
+    perf_logging_stop();
+
   shutdown_task = GNUNET_SCHEDULER_NO_TASK;
   if (GNUNET_SCHEDULER_NO_TASK != progress_task)
   {
@@ -604,6 +613,8 @@
     if (pref_val != GNUNET_ATS_PREFERENCE_END)
       mps[c_m].ats_task = GNUNET_SCHEDULER_add_now (&ats_pref_task, &mps[c_m]);
   }
+  if (GNUNET_YES == logging)
+    perf_logging_start();
 }
 
 static void
@@ -953,8 +964,6 @@
                    const struct GNUNET_PeerIdentity * peer,
                    const struct GNUNET_MessageHeader * message)
 {
-  struct BenchmarkPeer *me = cls;
-
   if (TEST_MESSAGE_SIZE != ntohs (message->size) ||
       (TEST_MESSAGE_TYPE_PING != ntohs (message->type) &&
       TEST_MESSAGE_TYPE_PONG != ntohs (message->type)))
@@ -1352,6 +1361,14 @@
   else
     num_masters = DEFAULT_MASTERS_NUM;
 
+  logging = GNUNET_NO;
+  for (c = 0; c < argc; c++)
+  {
+    if (0 == strcmp (argv[c], "-l"))
+      logging = GNUNET_YES;
+  }
+
+
   if (num_slaves < num_masters)
   {
     fprintf (stderr, "Number of master peers is lower than slaves! exit...\n");
@@ -1376,7 +1393,7 @@
   event_mask = 0;
   event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
   event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
-  (void) GNUNET_TESTBED_test_run ("perf_ats", conf_name,
+  (void) GNUNET_TESTBED_test_run ("perf-ats", conf_name,
       num_slaves + num_masters, event_mask, &controller_event_cb, NULL,
       &main_run, NULL );
 

Added: gnunet/src/ats-tests/perf_ats_logging.c
===================================================================
--- gnunet/src/ats-tests/perf_ats_logging.c                             (rev 0)
+++ gnunet/src/ats-tests/perf_ats_logging.c     2013-09-18 12:46:26 UTC (rev 
29373)
@@ -0,0 +1,34 @@
+/*
+ This file is part of GNUnet.
+ (C) 2010-2013 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING.  If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+/**
+ * @file ats/perf_ats_logging.c
+ * @brief ats benchmark: logging for performance tests
+ * @author Christian Grothoff
+ * @author Matthias Wachs
+ */
+#include "platform.h"
+#include "gnunet_util_lib.h"
+
+void
+perf_logging_stop ();
+
+void
+perf_logging_start ();
+/* end of file perf_ats_logging.c */

Added: gnunet/src/ats-tests/perf_ats_logging.h
===================================================================
--- gnunet/src/ats-tests/perf_ats_logging.h                             (rev 0)
+++ gnunet/src/ats-tests/perf_ats_logging.h     2013-09-18 12:46:26 UTC (rev 
29373)
@@ -0,0 +1,43 @@
+/*
+ This file is part of GNUnet.
+ (C) 2010-2013 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING.  If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+/**
+ * @file ats/perf_ats_logging.c
+ * @brief ats benchmark: logging for performance tests
+ * @author Christian Grothoff
+ * @author Matthias Wachs
+ */
+#include "platform.h"
+#include "gnunet_util_lib.h"
+
+void
+perf_logging_stop ()
+{
+  GNUNET_log(GNUNET_ERROR_TYPE_INFO,
+      _("Start logging\n"));
+}
+
+void
+perf_logging_start ()
+{
+  GNUNET_log(GNUNET_ERROR_TYPE_INFO,
+      _("Start logging\n"));
+}
+
+/* end of file perf_ats_logging.c */




reply via email to

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