diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-04-29 13:17:46 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-04-29 13:17:46 +0000 |
commit | 78991b0944fc0bf27fb66be0b84df0d00b06f334 (patch) | |
tree | f312f7ea244c4ac8a6932677cf0ea2e02a3d73a9 /src/ats/gnunet-ats-solver-eval.c | |
parent | 49a2ed15bd67052f98813644eb3967dcb2e0f4f5 (diff) | |
download | gnunet-78991b0944fc0bf27fb66be0b84df0d00b06f334.tar.gz gnunet-78991b0944fc0bf27fb66be0b84df0d00b06f334.zip |
optional timestamp
Diffstat (limited to 'src/ats/gnunet-ats-solver-eval.c')
-rw-r--r-- | src/ats/gnunet-ats-solver-eval.c | 33 |
1 files changed, 29 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 | ||
288 | void | 288 | void |
289 | GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l) | 289 | GNUNET_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) |