aboutsummaryrefslogtreecommitdiff
path: root/src/nse
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-23 13:35:03 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-23 13:35:03 +0000
commit458cb34da45e855162c96fc4735f168e36a323c9 (patch)
tree092435daf6fb14609d4f1441858c5f9eda714640 /src/nse
parentbcad355380c32637dd47feec84c23faed30e0eea (diff)
downloadgnunet-458cb34da45e855162c96fc4735f168e36a323c9.tar.gz
gnunet-458cb34da45e855162c96fc4735f168e36a323c9.zip
make writing data_output optional and disable by default
Diffstat (limited to 'src/nse')
-rw-r--r--src/nse/gnunet-nse-profiler.c29
-rw-r--r--src/nse/nse_profiler_test.conf2
2 files changed, 13 insertions, 18 deletions
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index a18a13fbd..ecd594e86 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -137,8 +137,6 @@ static GNUNET_SCHEDULER_TaskIdentifier churn_task;
137 137
138static char *topology_file; 138static char *topology_file;
139 139
140static char *data_filename;
141
142static uint64_t clock_skew; 140static uint64_t clock_skew;
143 141
144/** 142/**
@@ -540,6 +538,7 @@ run (void *cls, char *const *args, const char *cfgfile,
540 char *temp_str; 538 char *temp_str;
541 unsigned long long temp_wait; 539 unsigned long long temp_wait;
542 struct GNUNET_TESTING_Host *hosts; 540 struct GNUNET_TESTING_Host *hosts;
541 char *data_filename;
543 542
544 ok = 1; 543 ok = 1;
545 testing_cfg = GNUNET_CONFIGURATION_create (); 544 testing_cfg = GNUNET_CONFIGURATION_create ();
@@ -584,14 +583,21 @@ run (void *cls, char *const *args, const char *cfgfile,
584 return; 583 return;
585 } 584 }
586 585
587 if (GNUNET_OK != 586 if (GNUNET_OK ==
588 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler", 587 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
589 "data_output_file", 588 "data_output_file",
590 &data_filename)) 589 &data_filename))
591 { 590 {
592 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 591 data_file =
593 "Option nse-profiler:data_output_file is required!\n"); 592 GNUNET_DISK_file_open (data_filename,
594 return; 593 GNUNET_DISK_OPEN_READWRITE |
594 GNUNET_DISK_OPEN_CREATE,
595 GNUNET_DISK_PERM_USER_READ |
596 GNUNET_DISK_PERM_USER_WRITE);
597 if (data_file == NULL)
598 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
599 data_filename);
600 GNUNET_free (data_filename);
595 } 601 }
596 602
597 if (GNUNET_YES == 603 if (GNUNET_YES ==
@@ -605,17 +611,6 @@ run (void *cls, char *const *args, const char *cfgfile,
605 } 611 }
606 612
607 613
608 data_file =
609 GNUNET_DISK_file_open (data_filename,
610 GNUNET_DISK_OPEN_READWRITE |
611 GNUNET_DISK_OPEN_CREATE,
612 GNUNET_DISK_PERM_USER_READ |
613 GNUNET_DISK_PERM_USER_WRITE);
614 if (data_file == NULL)
615 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
616 data_filename);
617 GNUNET_free (data_filename);
618
619 wait_time = 614 wait_time =
620 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_wait); 615 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_wait);
621 616
diff --git a/src/nse/nse_profiler_test.conf b/src/nse/nse_profiler_test.conf
index ad113b24f..411bad9f0 100644
--- a/src/nse/nse_profiler_test.conf
+++ b/src/nse/nse_profiler_test.conf
@@ -98,7 +98,7 @@ DELETE_FILES = NO
98[nse-profiler] 98[nse-profiler]
99#OUTPUT_FILE = nse_output_100_peers.dat 99#OUTPUT_FILE = nse_output_100_peers.dat
100TOPOLOGY_OUTPUT_FILE = nse_topo_100_peers 100TOPOLOGY_OUTPUT_FILE = nse_topo_100_peers
101DATA_OUTPUT_FILE = nse_topo_100_peers_stats 101#DATA_OUTPUT_FILE = nse_topo_100_peers_stats
102#ROUND0 = 90 102#ROUND0 = 90
103#ROUND1 = 100 103#ROUND1 = 100
104#ROUND2 = 50 104#ROUND2 = 50