remove send on connect
[oweals/gnunet.git] / src / nse / nse-profiler.c
1 /*
2      This file is part of GNUnet.
3      (C) 2011 Christian Grothoff (and other contributing authors)
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20 /**
21  * @file nse/nse-profiler.c
22  *
23  * @brief Profiling driver for the network size estimation service.
24  *        Generally, the profiler starts a given number of peers,
25  *        then churns some off, waits a certain amount of time, then
26  *        churns again, and repeats.
27  */
28 #include "platform.h"
29 #include "gnunet_testing_lib.h"
30 #include "gnunet_nse_service.h"
31
32 #define VERBOSE GNUNET_NO
33
34 struct NSEPeer
35 {
36   struct NSEPeer *prev;
37
38   struct NSEPeer *next;
39
40   struct GNUNET_TESTING_Daemon *daemon;
41
42   struct GNUNET_NSE_Handle *nse_handle;
43 };
44
45 struct StatsContext
46 {
47   GNUNET_SCHEDULER_Task task;
48   GNUNET_SCHEDULER_TaskIdentifier *task_id;
49   void *task_cls;
50   unsigned long long total_nse_bytes;
51 };
52
53 static struct NSEPeer *peer_head;
54
55 static struct NSEPeer *peer_tail;
56
57 /**
58  * How long until we give up on connecting the peers?
59  */
60 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1500)
61
62 static int ok;
63
64 /**
65  * Be verbose
66  */
67 static int verbose;
68
69 /**
70  * Total number of peers in the test.
71  */
72 static unsigned long long num_peers;
73
74 /**
75  * Global configuration file
76  */
77 static struct GNUNET_CONFIGURATION_Handle *testing_cfg;
78
79 /**
80  * Total number of currently running peers.
81  */
82 static unsigned long long peers_running;
83
84 /**
85  * Current round we are in.
86  */
87 static unsigned long long current_round;
88
89 /**
90  * Peers desired in the next round.
91  */
92 static unsigned long long peers_next_round;
93
94 /**
95  * Maximum number of connections to NSE services.
96  */
97 static unsigned long long connection_limit;
98
99 /**
100  * Total number of connections in the whole network.
101  */
102 static unsigned int total_connections;
103
104 /**
105  * The currently running peer group.
106  */
107 static struct GNUNET_TESTING_PeerGroup *pg;
108
109 /**
110  * File to report results to.
111  */
112 static struct GNUNET_DISK_FileHandle *output_file;
113
114 /**
115  * File to log connection info, statistics to.
116  */
117 static struct GNUNET_DISK_FileHandle *data_file;
118
119 /**
120  * How many data points to capture before triggering next round?
121  */
122 static struct GNUNET_TIME_Relative wait_time;
123
124 /**
125  * Task called to disconnect peers.
126  */
127 static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
128
129 /**
130  * Task called to shutdown test.
131  */
132 static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
133
134 /**
135  * Task used to churn the network.
136  */
137 static GNUNET_SCHEDULER_TaskIdentifier churn_task;
138
139 static char *topology_file;
140
141 static char *data_filename;
142
143 static uint64_t clock_skew;
144
145 /**
146  * Check whether peers successfully shut down.
147  */
148 static void
149 shutdown_callback (void *cls, const char *emsg)
150 {
151   if (emsg != NULL)
152     {
153 #if VERBOSE
154       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n");
155 #endif
156       if (ok == 0)
157         ok = 666;
158     }
159   else
160     {
161 #if VERBOSE
162       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
163                   "All peers successfully shut down!\n");
164 #endif
165       ok = 0;
166     }
167 }
168
169 static void
170 shutdown_task (void *cls,
171                const struct GNUNET_SCHEDULER_TaskContext *tc)
172 {
173   struct NSEPeer *pos;
174 #if VERBOSE
175   fprintf(stderr, "Ending test.\n");
176 #endif
177
178   if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
179     {
180       GNUNET_SCHEDULER_cancel(disconnect_task);
181       disconnect_task = GNUNET_SCHEDULER_NO_TASK;
182     }
183   while (NULL != (pos = peer_head))
184     {
185       if (pos->nse_handle != NULL)
186         GNUNET_NSE_disconnect(pos->nse_handle);
187       GNUNET_CONTAINER_DLL_remove(peer_head, peer_tail, pos);
188       GNUNET_free(pos);
189     }
190
191   if (data_file != NULL)
192     GNUNET_DISK_file_close(data_file);
193   GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
194 }
195
196 /**
197  * Callback to call when network size estimate is updated.
198  *
199  * @param cls closure
200  * @param estimate the value of the current network size estimate
201  * @param std_dev standard deviation (rounded down to nearest integer)
202  *                of the size estimation values seen
203  *
204  */
205 static void
206 handle_estimate (void *cls, double estimate, double std_dev)
207 {
208   struct NSEPeer *peer = cls;
209   char *output_buffer;
210   size_t size;
211
212   if (output_file != NULL)
213     {
214       size = GNUNET_asprintf(&output_buffer, 
215                              "%s %u %f %f %f\n",
216                              GNUNET_i2s(&peer->daemon->id),
217                              peers_running,
218                              pow(2, estimate),
219                              estimate, 
220                              std_dev);
221       if (size != GNUNET_DISK_file_write(output_file, output_buffer, size))
222         GNUNET_log(GNUNET_ERROR_TYPE_WARNING, 
223                    "Unable to write to file!\n");
224       GNUNET_free (output_buffer);
225     }
226   else
227     fprintf(stderr,
228             "Received network size estimate from peer %s. Size: %f std.dev. %f\n", 
229             GNUNET_i2s(&peer->daemon->id),
230             estimate,
231             std_dev);
232
233 }
234
235 static void
236 connect_nse_service (void *cls,
237                      const struct GNUNET_SCHEDULER_TaskContext *tc)
238 {
239   struct NSEPeer *current_peer;
240   unsigned int i;
241
242 #if VERBOSE
243   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
244               "Connecting to nse service of peers\n");
245 #endif
246   for (i = 0; i < num_peers; i++)
247     {
248       if ((connection_limit > 0) && (i % (num_peers / connection_limit) != 0))
249         continue;
250 #if VERBOSE
251       GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "nse-profiler: connecting to nse service of peer %d\n", i);
252 #endif
253       current_peer = GNUNET_malloc(sizeof(struct NSEPeer));
254       current_peer->daemon = GNUNET_TESTING_daemon_get(pg, i);
255       if (GNUNET_YES == GNUNET_TESTING_daemon_running(GNUNET_TESTING_daemon_get(pg, i)))
256         {
257           current_peer->nse_handle = GNUNET_NSE_connect (current_peer->daemon->cfg,
258                                                          &handle_estimate, 
259                                                          current_peer);
260           GNUNET_assert(current_peer->nse_handle != NULL);
261         }
262       GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer);
263     }
264 }
265
266
267 static void
268 churn_peers (void *cls,
269              const struct GNUNET_SCHEDULER_TaskContext *tc);
270
271
272 /**
273  * Continuation called by the "get_all" and "get" functions.
274  *
275  * @param cls struct StatsContext
276  * @param success GNUNET_OK if statistics were
277  *        successfully obtained, GNUNET_SYSERR if not.
278  */
279 static void 
280 stats_finished_callback (void *cls, int success)
281 {
282   struct StatsContext *stats_context = (struct StatsContext *)cls;
283   char *buf;
284   int buf_len;
285
286   if ((GNUNET_OK == success) && (data_file != NULL)) /* Stats lookup successful, write out data */
287     {
288       buf = NULL;
289       buf_len = GNUNET_asprintf(&buf,
290                                 "TOTAL_NSE_BYTES: %u\n", 
291                                 stats_context->total_nse_bytes);
292       if (buf_len > 0)
293         {
294           GNUNET_DISK_file_write(data_file, buf, buf_len);
295         }
296       GNUNET_free_non_null(buf);
297     }
298
299   if (stats_context->task != NULL)
300     *stats_context->task_id = GNUNET_SCHEDULER_add_now(stats_context->task,
301                                                        stats_context->task_cls);
302   GNUNET_free(stats_context);
303 }
304
305
306 /**
307  * Callback function to process statistic values.
308  *
309  * @param cls struct StatsContext
310  * @param peer the peer the statistics belong to
311  * @param subsystem name of subsystem that created the statistic
312  * @param name the name of the datum
313  * @param value the current value
314  * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
315  * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
316  */
317 static int 
318 statistics_iterator (void *cls,
319                      const struct GNUNET_PeerIdentity *peer,
320                      const char *subsystem,
321                      const char *name,
322                      uint64_t value,
323                      int is_persistent)
324 {
325   struct StatsContext *stats_context = cls;
326
327   if ((0 == strstr(subsystem, "nse")) && (0 == strstr(name, "# flood messages received")))
328     {
329       stats_context->total_nse_bytes += value;
330     }
331
332   return GNUNET_OK;
333 }
334
335
336 /**
337  * @param cls struct StatsContext
338  * @param tc task context
339  */
340 static void
341 get_statistics (void *cls,
342                 const struct GNUNET_SCHEDULER_TaskContext *tc)
343 {
344   struct StatsContext *stats_context = cls;
345
346   GNUNET_TESTING_get_statistics(pg, 
347                                 &stats_finished_callback, 
348                                 &statistics_iterator, 
349                                 stats_context);
350 }
351
352
353 static void
354 disconnect_nse_peers (void *cls,
355                       const struct GNUNET_SCHEDULER_TaskContext *tc)
356 {
357   struct NSEPeer *pos;
358   char *buf;
359   struct StatsContext *stats_context;
360   disconnect_task = GNUNET_SCHEDULER_NO_TASK;
361   pos = peer_head;
362
363   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
364               "disconnecting nse service of peers\n");
365   while (NULL != (pos = peer_head))
366     {
367       if (pos->nse_handle != NULL)
368         {
369           GNUNET_NSE_disconnect(pos->nse_handle);
370           pos->nse_handle = NULL;
371         }
372       GNUNET_CONTAINER_DLL_remove(peer_head, peer_tail, pos);
373       GNUNET_free(pos);
374     }
375
376   GNUNET_asprintf(&buf, 
377                   "round%llu", 
378                   current_round);
379   if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number (testing_cfg, 
380                                                           "nse-profiler",
381                                                           buf, 
382                                                           &peers_next_round))
383     {
384       current_round++;
385       GNUNET_assert(churn_task == GNUNET_SCHEDULER_NO_TASK);
386       churn_task = GNUNET_SCHEDULER_add_now(&churn_peers, NULL);
387     }
388   else /* No more rounds, let's shut it down! */
389     {
390       stats_context = GNUNET_malloc(sizeof(struct StatsContext));
391       GNUNET_SCHEDULER_cancel(shutdown_handle);
392       shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
393       stats_context->task = &shutdown_task;
394       stats_context->task_cls = NULL;
395       stats_context->task_id = &shutdown_handle;
396       GNUNET_SCHEDULER_add_now(&get_statistics, stats_context);
397       //shutdown_handle = GNUNET_SCHEDULER_add_now(&shutdown_task, NULL);
398     }
399   GNUNET_free(buf);
400 }
401
402
403 /**
404  * Prototype of a function that will be called when a
405  * particular operation was completed the testing library.
406  *
407  * @param cls unused
408  * @param emsg NULL on success
409  */
410 static void 
411 topology_output_callback (void *cls, const char *emsg)
412 {
413   struct StatsContext *stats_context;
414   stats_context = GNUNET_malloc(sizeof(struct StatsContext));
415
416   disconnect_task = GNUNET_SCHEDULER_add_delayed(wait_time, &disconnect_nse_peers, NULL);
417   GNUNET_SCHEDULER_add_now(&connect_nse_service, NULL);
418 }
419
420
421 /**
422  * Prototype of a function that will be called when a
423  * particular operation was completed the testing library.
424  *
425  * @param cls closure
426  * @param emsg NULL on success
427  */
428 static void
429 churn_callback (void *cls, const char *emsg)
430 {
431   char *temp_output_file;
432
433   if (emsg == NULL) /* Everything is okay! */
434     {
435       peers_running = peers_next_round;
436       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
437                   "Round %lu, churn finished successfully.\n",
438                   current_round);
439       GNUNET_assert(disconnect_task == GNUNET_SCHEDULER_NO_TASK);
440       GNUNET_asprintf(&temp_output_file, 
441                       "%s_%lu.dot",
442                       topology_file, 
443                       current_round);
444       GNUNET_TESTING_peergroup_topology_to_file(pg,
445                                                 temp_output_file,
446                                                 &topology_output_callback,
447                                                 NULL);
448       GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
449                  "Writing topology to file %s\n",
450                  temp_output_file);
451       GNUNET_free(temp_output_file);
452     }
453   else
454     {
455       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
456                   "Round %lu, churn FAILED!!\n",
457                   current_round);
458       GNUNET_SCHEDULER_cancel(shutdown_handle);
459       GNUNET_SCHEDULER_add_now(&shutdown_task, NULL);
460     }
461 }
462
463
464 static void
465 churn_peers (void *cls,
466              const struct GNUNET_SCHEDULER_TaskContext *tc)
467 {
468   /* peers_running = GNUNET_TESTING_daemons_running(pg); */
469   churn_task = GNUNET_SCHEDULER_NO_TASK;
470   if (peers_next_round == peers_running)
471     {
472       /* Nothing to do... */
473       GNUNET_SCHEDULER_add_now(&connect_nse_service, NULL);
474       GNUNET_assert(disconnect_task == GNUNET_SCHEDULER_NO_TASK);
475       disconnect_task = GNUNET_SCHEDULER_add_delayed(wait_time, 
476                                                      &disconnect_nse_peers, NULL);
477       GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
478                  "Round %lu, doing nothing!\n", 
479                  current_round);
480     }
481   else
482     {
483       if (peers_next_round > num_peers)
484         {
485           GNUNET_log(GNUNET_ERROR_TYPE_ERROR, 
486                      "Asked to turn on more peers than we have!!\n");
487           GNUNET_SCHEDULER_cancel(shutdown_handle);
488           GNUNET_SCHEDULER_add_now(&shutdown_task, NULL);
489         }
490       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
491                   "Round %lu, turning off %lu peers, turning on %lu peers!\n",
492                   current_round,
493                   (peers_running > peers_next_round) ? peers_running
494                       - peers_next_round : 0,
495                   (peers_next_round > peers_running) ? peers_next_round
496                       - peers_running : 0);
497       GNUNET_TESTING_daemons_churn (pg, "nse",
498                                     (peers_running > peers_next_round) ? peers_running
499                                         - peers_next_round
500                                         : 0,
501                                     (peers_next_round > peers_running) ? peers_next_round
502                                         - peers_running
503                                         : 0, wait_time, &churn_callback,
504                                     NULL);
505     }
506 }
507
508
509 static void
510 my_cb (void *cls,
511        const char *emsg)
512 {
513   char *buf;
514   int buf_len;
515   if (emsg != NULL)
516     {
517       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
518                   "Peergroup callback called with error, aborting test!\n");
519       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n");
520       ok = 1;
521       GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
522       return;
523     }
524 #if VERBOSE
525   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
526               "Peer Group started successfully, connecting to NSE service for each peer!\n");
527 #endif
528   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
529               "Have %u connections\n", total_connections);
530   if (data_file != NULL)
531     {
532       buf = NULL;
533       buf_len = GNUNET_asprintf(&buf, 
534                                 "CONNECTIONS_0: %u\n",
535                                 total_connections);
536       if (buf_len > 0)
537         GNUNET_DISK_file_write(data_file, buf, buf_len);
538       GNUNET_free (buf);
539     }
540   peers_running = GNUNET_TESTING_daemons_running(pg);
541   GNUNET_SCHEDULER_add_now(&connect_nse_service, NULL);
542   disconnect_task = GNUNET_SCHEDULER_add_delayed(wait_time, &disconnect_nse_peers, NULL);
543 }
544
545
546 /**
547  * Function that will be called whenever two daemons are connected by
548  * the testing library.
549  *
550  * @param cls closure
551  * @param first peer id for first daemon
552  * @param second peer id for the second daemon
553  * @param distance distance between the connected peers
554  * @param first_cfg config for the first daemon
555  * @param second_cfg config for the second daemon
556  * @param first_daemon handle for the first daemon
557  * @param second_daemon handle for the second daemon
558  * @param emsg error message (NULL on success)
559  */
560 static void 
561 connect_cb (void *cls,
562             const struct GNUNET_PeerIdentity *first,
563             const struct GNUNET_PeerIdentity *second,
564             uint32_t distance,
565             const struct GNUNET_CONFIGURATION_Handle *first_cfg,
566             const struct GNUNET_CONFIGURATION_Handle *second_cfg,
567             struct GNUNET_TESTING_Daemon *first_daemon,
568             struct GNUNET_TESTING_Daemon *second_daemon,
569             const char *emsg)
570 {
571   if (emsg == NULL)
572     total_connections++;
573 }
574
575
576 static void
577 run (void *cls,
578      char *const *args,
579      const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
580 {
581   char *temp_str;
582   unsigned long long temp_wait;
583   struct GNUNET_TESTING_Host *hosts;
584
585   ok = 1;
586   testing_cfg = GNUNET_CONFIGURATION_create();
587   GNUNET_assert(GNUNET_OK == GNUNET_CONFIGURATION_load(testing_cfg, cfgfile));
588 #if VERBOSE
589   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n");
590   GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
591                                            "use_progressbars",
592                                            "YES");
593 #endif
594   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (testing_cfg, 
595                                                           "testing",
596                                                           "num_peers", &num_peers))
597     {
598       GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Option TESTING:NUM_PEERS is required!\n");
599       return;
600     }
601
602   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (testing_cfg, 
603                                                           "nse-profiler", 
604                                                           "wait_time",
605                                                           &temp_wait))
606     {
607       GNUNET_log(GNUNET_ERROR_TYPE_ERROR, 
608                  "Option nse-profiler:wait_time is required!\n");
609       return;
610     }
611
612   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (testing_cfg, 
613                                                           "nse-profiler", "connection_limit",
614                                                           &connection_limit))
615     {
616       connection_limit = 0;
617     }
618
619   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (testing_cfg, 
620                                                           "nse-profiler", "topology_output_file", 
621                                                           &topology_file))
622     {
623       GNUNET_log(GNUNET_ERROR_TYPE_ERROR, 
624                  "Option nse-profiler:topology_output_file is required!\n");
625       return;
626     }
627
628   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (testing_cfg, 
629                                                           "nse-profiler", "data_output_file",
630                                                           &data_filename))
631     {
632       GNUNET_log(GNUNET_ERROR_TYPE_ERROR, 
633                  "Option nse-profiler:data_output_file is required!\n");
634       return;
635     }
636
637   if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (testing_cfg, 
638                                                           "nse-profiler", 
639                                                           "skew_clock"))
640     {
641       GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
642                  "Setting our clock as skewed...\n");
643       clock_skew = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, 
644                                             GNUNET_TIME_UNIT_MINUTES.rel_value);
645     }
646
647
648   data_file = GNUNET_DISK_file_open (data_filename,
649                                      GNUNET_DISK_OPEN_READWRITE
650                                      | GNUNET_DISK_OPEN_CREATE,
651                                      GNUNET_DISK_PERM_USER_READ |
652                                      GNUNET_DISK_PERM_USER_WRITE);
653   if (data_file == NULL)
654     GNUNET_log(GNUNET_ERROR_TYPE_WARNING, 
655                "Failed to open %s for output!\n", 
656                data_filename);
657   GNUNET_free(data_filename);
658
659   wait_time = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, temp_wait);
660
661   if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_string(cfg,
662                                                           "nse-profiler", 
663                                                           "output_file",
664                                                           &temp_str))
665     {
666       output_file = GNUNET_DISK_file_open (temp_str, GNUNET_DISK_OPEN_READWRITE
667                                                       | GNUNET_DISK_OPEN_CREATE,
668                                                       GNUNET_DISK_PERM_USER_READ |
669                                                       GNUNET_DISK_PERM_USER_WRITE);
670       if (output_file == NULL)
671         GNUNET_log(GNUNET_ERROR_TYPE_WARNING, 
672                    "Failed to open %s for output!\n",
673                    temp_str);
674     }
675   GNUNET_free_non_null(temp_str);
676
677   hosts = GNUNET_TESTING_hosts_load (testing_cfg);
678
679   pg = GNUNET_TESTING_peergroup_start(testing_cfg,
680                                       num_peers,
681                                       TIMEOUT,
682                                       &connect_cb,
683                                       &my_cb, NULL,
684                                       hosts);
685   GNUNET_assert (pg != NULL);
686   shutdown_handle = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever(),
687                                                   &shutdown_task,
688                                                   NULL);
689 }
690
691
692
693 /**
694  * nse-profiler command line options
695  */
696 static struct GNUNET_GETOPT_CommandLineOption options[] = {
697   {'V', "verbose", NULL,
698    gettext_noop ("be verbose (print progress information)"),
699    0, &GNUNET_GETOPT_set_one, &verbose},
700   GNUNET_GETOPT_OPTION_END
701 };
702
703
704 int
705 main (int argc, char *argv[])
706 {
707   int ret;
708
709   GNUNET_log_setup ("nse-profiler",
710 #if VERBOSE
711                     "DEBUG",
712 #else
713                     "WARNING",
714 #endif
715                     NULL);
716   ret = 1;
717   GNUNET_PROGRAM_run (argc,
718                       argv, "nse-profiler", gettext_noop
719                       ("Run a test of the NSE service."),
720                       options, &run, &ok);
721   GNUNET_DISK_directory_remove ("/tmp/nse-profiler");
722   return ret;
723 }
724
725 /* end of nse-profiler.c */