diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-12-05 19:33:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-12-05 19:33:59 +0000 |
commit | fbdce8d7a2ec33531a6c1f27bfccf81865bc9a7d (patch) | |
tree | e153f3d1176949c5c4dc938b0ca0b1d85d8c2f62 /src | |
parent | 8fc100cd5192d0fb082c94dbe8283f82875a93bd (diff) | |
download | gnunet-fbdce8d7a2ec33531a6c1f27bfccf81865bc9a7d.tar.gz gnunet-fbdce8d7a2ec33531a6c1f27bfccf81865bc9a7d.zip |
-more logging
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/fs_api.c | 29 | ||||
-rw-r--r-- | src/fs/fs_api.h | 5 | ||||
-rw-r--r-- | src/fs/fs_download.c | 9 | ||||
-rw-r--r-- | src/fs/fs_search.c | 13 |
4 files changed, 47 insertions, 9 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index f03cdb8e4..678187a27 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -61,6 +61,10 @@ start_job (struct GNUNET_FS_QueueEntry *qe) | |||
61 | qe->h->active_blocks += qe->blocks; | 61 | qe->h->active_blocks += qe->blocks; |
62 | qe->h->active_downloads++; | 62 | qe->h->active_downloads++; |
63 | qe->start_time = GNUNET_TIME_absolute_get (); | 63 | qe->start_time = GNUNET_TIME_absolute_get (); |
64 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
65 | "Starting job %p (%u active)\n", | ||
66 | qe, | ||
67 | qe->h->active_downloads); | ||
64 | GNUNET_CONTAINER_DLL_remove (qe->h->pending_head, qe->h->pending_tail, qe); | 68 | GNUNET_CONTAINER_DLL_remove (qe->h->pending_head, qe->h->pending_tail, qe); |
65 | GNUNET_CONTAINER_DLL_insert_after (qe->h->running_head, qe->h->running_tail, | 69 | GNUNET_CONTAINER_DLL_insert_after (qe->h->running_head, qe->h->running_tail, |
66 | qe->h->running_tail, qe); | 70 | qe->h->running_tail, qe); |
@@ -85,6 +89,10 @@ stop_job (struct GNUNET_FS_QueueEntry *qe) | |||
85 | GNUNET_TIME_relative_add (qe->run_time, | 89 | GNUNET_TIME_relative_add (qe->run_time, |
86 | GNUNET_TIME_absolute_get_duration | 90 | GNUNET_TIME_absolute_get_duration |
87 | (qe->start_time)); | 91 | (qe->start_time)); |
92 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
93 | "Stopping job %p (%u active)\n", | ||
94 | qe, | ||
95 | qe->h->active_downloads); | ||
88 | GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); | 96 | GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); |
89 | GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, | 97 | GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, |
90 | qe->h->pending_tail, qe); | 98 | qe->h->pending_tail, qe); |
@@ -318,24 +326,31 @@ GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, | |||
318 | if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) | 326 | if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) |
319 | GNUNET_SCHEDULER_cancel (h->queue_job); | 327 | GNUNET_SCHEDULER_cancel (h->queue_job); |
320 | h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); | 328 | h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); |
329 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
330 | "Queueing job %p\n", | ||
331 | qe); | ||
321 | return qe; | 332 | return qe; |
322 | } | 333 | } |
323 | 334 | ||
324 | 335 | ||
325 | /** | 336 | /** |
326 | * Dequeue a job from the queue. | 337 | * Dequeue a job from the queue. |
327 | * @param qh handle for the job | 338 | * |
339 | * @param qe handle for the job | ||
328 | */ | 340 | */ |
329 | void | 341 | void |
330 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh) | 342 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe) |
331 | { | 343 | { |
332 | struct GNUNET_FS_Handle *h; | 344 | struct GNUNET_FS_Handle *h; |
333 | 345 | ||
334 | h = qh->h; | 346 | h = qe->h; |
335 | if (NULL != qh->client) | 347 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
336 | stop_job (qh); | 348 | "Dequeueing job %p\n", |
337 | GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qh); | 349 | qe); |
338 | GNUNET_free (qh); | 350 | if (NULL != qe->client) |
351 | stop_job (qe); | ||
352 | GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qe); | ||
353 | GNUNET_free (qe); | ||
339 | if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) | 354 | if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) |
340 | GNUNET_SCHEDULER_cancel (h->queue_job); | 355 | GNUNET_SCHEDULER_cancel (h->queue_job); |
341 | h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); | 356 | h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); |
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h index d4b7aa202..d728c59a0 100644 --- a/src/fs/fs_api.h +++ b/src/fs/fs_api.h | |||
@@ -633,10 +633,11 @@ GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, | |||
633 | 633 | ||
634 | /** | 634 | /** |
635 | * Dequeue a job from the queue. | 635 | * Dequeue a job from the queue. |
636 | * @param qh handle for the job | 636 | * |
637 | * @param qe handle for the job | ||
637 | */ | 638 | */ |
638 | void | 639 | void |
639 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | 640 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe); |
640 | 641 | ||
641 | 642 | ||
642 | /** | 643 | /** |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index ee301d4d0..c4863fbd2 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -2081,6 +2081,11 @@ create_download_context (struct GNUNET_FS_Handle *h, | |||
2081 | return NULL; | 2081 | return NULL; |
2082 | } | 2082 | } |
2083 | dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext)); | 2083 | dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext)); |
2084 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2085 | "Starting download %p, %u bytes at offset %llu\n", | ||
2086 | dc, | ||
2087 | (unsigned long long) length, | ||
2088 | (unsigned long long) offset); | ||
2084 | dc->h = h; | 2089 | dc->h = h; |
2085 | dc->uri = GNUNET_FS_uri_dup (uri); | 2090 | dc->uri = GNUNET_FS_uri_dup (uri); |
2086 | dc->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); | 2091 | dc->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); |
@@ -2258,6 +2263,10 @@ GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc) | |||
2258 | (0 == (dc->options & GNUNET_FS_DOWNLOAD_IS_PROBE)) | 2263 | (0 == (dc->options & GNUNET_FS_DOWNLOAD_IS_PROBE)) |
2259 | ? GNUNET_FS_QUEUE_PRIORITY_NORMAL | 2264 | ? GNUNET_FS_QUEUE_PRIORITY_NORMAL |
2260 | : GNUNET_FS_QUEUE_PRIORITY_PROBE); | 2265 | : GNUNET_FS_QUEUE_PRIORITY_PROBE); |
2266 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2267 | "Download %p put into queue as job %p\n", | ||
2268 | dc, | ||
2269 | dc->job_queue); | ||
2261 | } | 2270 | } |
2262 | 2271 | ||
2263 | 2272 | ||
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index d7124b68e..5e2ce3604 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -211,6 +211,10 @@ probe_failure_handler (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
211 | GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES); | 211 | GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES); |
212 | sr->probe_ctx = NULL; | 212 | sr->probe_ctx = NULL; |
213 | GNUNET_FS_search_result_sync_ (sr); | 213 | GNUNET_FS_search_result_sync_ (sr); |
214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
215 | "Probe #%u for search result %p failed\n", | ||
216 | sr->availability_trials, | ||
217 | sr); | ||
214 | signal_probe_result (sr); | 218 | signal_probe_result (sr); |
215 | } | 219 | } |
216 | 220 | ||
@@ -232,6 +236,10 @@ probe_success_handler (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
232 | GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES); | 236 | GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES); |
233 | sr->probe_ctx = NULL; | 237 | sr->probe_ctx = NULL; |
234 | GNUNET_FS_search_result_sync_ (sr); | 238 | GNUNET_FS_search_result_sync_ (sr); |
239 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
240 | "Probe #%u for search result %p succeeded\n", | ||
241 | sr->availability_trials, | ||
242 | sr); | ||
235 | signal_probe_result (sr); | 243 | signal_probe_result (sr); |
236 | } | 244 | } |
237 | 245 | ||
@@ -361,6 +369,11 @@ GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr) | |||
361 | len = len - off; | 369 | len = len - off; |
362 | else | 370 | else |
363 | len = DBLOCK_SIZE; | 371 | len = DBLOCK_SIZE; |
372 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
373 | "Starting probe #%u (at offset %llu) for search result %p\n", | ||
374 | sr->availability_trials + 1, | ||
375 | (unsigned long long) off, | ||
376 | sr); | ||
364 | sr->remaining_probe_time = | 377 | sr->remaining_probe_time = |
365 | GNUNET_TIME_relative_multiply (sr->sc->h->avg_block_latency, | 378 | GNUNET_TIME_relative_multiply (sr->sc->h->avg_block_latency, |
366 | 2 * (1 + sr->availability_trials)); | 379 | 2 * (1 + sr->availability_trials)); |