add function conv param string
[oweals/gnunet.git] / src / consensus / gnunet-consensus-profiler.c
index 345e2244c1093de8265943e1be7995074083a639..290263d9535ad1b62c801d9ed408d723954ce28c 100644 (file)
@@ -57,8 +57,16 @@ static unsigned int peers_done = 0;
 
 static unsigned *results_for_peer;
 
+/**
+ * The profiler will write statistics
+ * for all peers to the file with this name.
+ */
 static char *statistics_filename;
 
+/**
+ * The profiler will write statistics
+ * for all peers to this file.
+ */
 static FILE *statistics_file;
 
 static int verbose;
@@ -90,7 +98,7 @@ controller_cb (void *cls,
 
 
 static void
-statistics_done_db (void *cls,
+statistics_done_cb (void *cls,
                     struct
                     GNUNET_TESTBED_Operation
                     *op,
@@ -100,6 +108,7 @@ statistics_done_db (void *cls,
   GNUNET_TESTBED_operation_done (op);
   if (NULL != statistics_file)
     fclose (statistics_file);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "got statistics, shutting down\n");
   GNUNET_SCHEDULER_shutdown ();
 }
 
@@ -112,8 +121,8 @@ statistics_done_db (void *cls,
  * @param subsystem name of subsystem that created the statistic
  * @param name the name of the datum
  * @param value the current value
- * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
- * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not
+ * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
  */
 static int
 statistics_cb (void *cls,
@@ -132,7 +141,7 @@ statistics_cb (void *cls,
 
 
 static void
-destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *ctx)
+destroy (void *cls)
 {
   struct GNUNET_CONSENSUS_Handle *consensus = cls;
 
@@ -154,7 +163,7 @@ destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *ctx)
       statistics_file = fopen (statistics_filename, "w");
     GNUNET_TESTBED_get_statistics (num_peers, peers, NULL, NULL,
                                    statistics_cb,
-                                   statistics_done_db,
+                                   statistics_done_cb,
                                    NULL);
   }
 }
@@ -174,7 +183,7 @@ conclude_cb (void *cls)
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "consensus %d done\n",
-              chp - consensus_handles);
+              (int) (chp - consensus_handles));
   GNUNET_SCHEDULER_add_now (destroy, *chp);
 }
 
@@ -341,6 +350,8 @@ static void
 disconnect_adapter(void *cls, void *op_result)
 {
   /* FIXME: what to do here? */
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "disconnect adapter called\n");
 }
 
 
@@ -513,4 +524,3 @@ main (int argc, char **argv)
                      options, &run, NULL, GNUNET_YES);
   return 0;
 }
-