aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-04-29 13:17:46 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-04-29 13:17:46 +0000
commit78991b0944fc0bf27fb66be0b84df0d00b06f334 (patch)
treef312f7ea244c4ac8a6932677cf0ea2e02a3d73a9 /src
parent49a2ed15bd67052f98813644eb3967dcb2e0f4f5 (diff)
downloadgnunet-78991b0944fc0bf27fb66be0b84df0d00b06f334.tar.gz
gnunet-78991b0944fc0bf27fb66be0b84df0d00b06f334.zip
optional timestamp
Diffstat (limited to 'src')
-rw-r--r--src/ats/gnunet-ats-solver-eval.c33
-rw-r--r--src/ats/gnunet-ats-solver-eval.h3
2 files changed, 32 insertions, 4 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 8566b03a7..8de573251 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -286,7 +286,8 @@ find_logging_file_handle (struct LoggingFileHandle *lf_head,
286} 286}
287 287
288void 288void
289GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l) 289GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int add_time_stamp,
290 char *output_dir)
290{ 291{
291 struct LoggingTimeStep *lts; 292 struct LoggingTimeStep *lts;
292 struct LoggingPeer *log_p; 293 struct LoggingPeer *log_p;
@@ -326,8 +327,14 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l)
326 cur->aid = log_a->aid; 327 cur->aid = log_a->aid;
327 cur->pid = log_p->id; 328 cur->pid = log_p->id;
328 329
329 GNUNET_asprintf (&filename, "%s_%s_%u_%u_%llu.log", e->log_prefix, opt_solver, 330 if (GNUNET_YES == add_time_stamp)
330 cur->aid, cur->pid, l->head->timestamp.abs_value_us); 331 GNUNET_asprintf (&filename, "%s_%s_%u_%u_%llu.log",
332 e->log_prefix, opt_solver,
333 cur->aid, cur->pid, l->head->timestamp.abs_value_us);
334 else
335 GNUNET_asprintf (&filename, "%s_%s_%u_%u.log",
336 e->log_prefix, opt_solver,
337 cur->aid, cur->pid);
331 338
332 fprintf (stderr, "Add writing log data for %i %i to file `%s'\n", 339 fprintf (stderr, "Add writing log data for %i %i to file `%s'\n",
333 cur->pid, cur->aid, filename); 340 cur->pid, cur->aid, filename);
@@ -2476,6 +2483,23 @@ GNUNET_ATS_solvers_experimentation_load (char *filename)
2476 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment logging prefix: `%s'\n", 2483 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment logging prefix: `%s'\n",
2477 e->log_prefix); 2484 e->log_prefix);
2478 2485
2486 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string(cfg, "experiment",
2487 "log_output_dir", &e->log_output_dir))
2488 {
2489 e->log_output_dir = NULL;
2490 }
2491 else
2492 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment logging output directory: `%s'\n",
2493 e->log_output_dir);
2494
2495
2496 if (GNUNET_SYSERR == (e->log_append_time_stamp = GNUNET_CONFIGURATION_get_value_yesno(cfg,
2497 "experiment", "log_append_time_stamp")))
2498 e->log_append_time_stamp = GNUNET_NO;
2499 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment logging output directory: `%s'\n",
2500 (GNUNET_YES == e->log_append_time_stamp) ? "yes" : "no");
2501
2502
2479 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_filename (cfg, "experiment", 2503 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_filename (cfg, "experiment",
2480 "cfg_file", &e->cfg_file)) 2504 "cfg_file", &e->cfg_file))
2481 { 2505 {
@@ -2987,7 +3011,8 @@ done ()
2987 if (opt_save) 3011 if (opt_save)
2988 { 3012 {
2989 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "== Saving log information \n"); 3013 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "== Saving log information \n");
2990 GNUNET_ATS_solver_logging_write_to_disk (l); 3014 GNUNET_ATS_solver_logging_write_to_disk (l, e->log_append_time_stamp,
3015 e->log_output_dir);
2991 } 3016 }
2992 3017
2993 if (NULL != l) 3018 if (NULL != l)
diff --git a/src/ats/gnunet-ats-solver-eval.h b/src/ats/gnunet-ats-solver-eval.h
index 0a7270bef..6a4220685 100644
--- a/src/ats/gnunet-ats-solver-eval.h
+++ b/src/ats/gnunet-ats-solver-eval.h
@@ -236,6 +236,9 @@ struct Experiment
236 char *name; 236 char *name;
237 char *log_prefix; 237 char *log_prefix;
238 char *cfg_file; 238 char *cfg_file;
239 char *log_output_dir;
240 int log_append_time_stamp;
241
239 struct GNUNET_TIME_Relative log_freq; 242 struct GNUNET_TIME_Relative log_freq;
240 struct GNUNET_TIME_Relative max_duration; 243 struct GNUNET_TIME_Relative max_duration;
241 struct GNUNET_TIME_Relative total_duration; 244 struct GNUNET_TIME_Relative total_duration;