gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15035 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r15035 - gnunet/src/fs
Date: Tue, 19 Apr 2011 23:01:44 +0200

Author: grothoff
Date: 2011-04-19 23:01:44 +0200 (Tue, 19 Apr 2011)
New Revision: 15035

Modified:
   gnunet/src/fs/fs.h
   gnunet/src/fs/gnunet-service-fs_cp.c
   gnunet/src/fs/gnunet-service-fs_pe.c
   gnunet/src/fs/gnunet-service-fs_push.c
Log:
stuff

Modified: gnunet/src/fs/fs.h
===================================================================
--- gnunet/src/fs/fs.h  2011-04-19 19:50:20 UTC (rev 15034)
+++ gnunet/src/fs/fs.h  2011-04-19 21:01:44 UTC (rev 15035)
@@ -62,7 +62,7 @@
 /**
  * Maximum number of blocks we keep in memory for migration.
  */
-#define MAX_MIGRATION_QUEUE 32
+#define MAX_MIGRATION_QUEUE 8
 
 /**
  * Blocks are at most migrated to this number of peers

Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c        2011-04-19 19:50:20 UTC (rev 
15034)
+++ gnunet/src/fs/gnunet-service-fs_cp.c        2011-04-19 21:01:44 UTC (rev 
15035)
@@ -658,7 +658,7 @@
     }
 #if DEBUG_FS
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Transmitting result for query `%s'\n",
+             "Transmitting result for query `%s' to peer\n",
              GNUNET_h2s (&prd->query));
 #endif  
   GNUNET_STATISTICS_update (GSF_stats,
@@ -859,8 +859,9 @@
   gm = (const struct GetMessage*) message;
 #if DEBUG_FS
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Received request for `%s'\n",
-             GNUNET_h2s (&gm->query));
+             "Received request for `%s' from `%s'\n",
+             GNUNET_h2s (&gm->query),
+             GNUNET_i2s (other));
 #endif
   type = ntohl (gm->type);
   bm = ntohl (gm->hash_bitmap);
@@ -1548,14 +1549,14 @@
 {
   if (GNUNET_TIME_absolute_get_remaining (cp->last_migration_block).rel_value 
> block_time.rel_value)
     {
-#if DEBUG_FS
+#if DEBUG_FS && 0
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Migration already blocked for another %llu ms\n",
                  (unsigned long long) GNUNET_TIME_absolute_get_remaining 
(cp->last_migration_block).rel_value);
 #endif
       return; /* already blocked */
     }
-#if DEBUG_FS
+#if DEBUG_FS && 0
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Asking to stop migration for %llu ms\n",
              (unsigned long long) block_time.rel_value);

Modified: gnunet/src/fs/gnunet-service-fs_pe.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pe.c        2011-04-19 19:50:20 UTC (rev 
15034)
+++ gnunet/src/fs/gnunet-service-fs_pe.c        2011-04-19 21:01:44 UTC (rev 
15035)
@@ -200,6 +200,12 @@
   rp->hn = NULL;
   rp->last_transmission = GNUNET_TIME_absolute_get ();
   rp->transmission_counter++;
+#if DEBUG_FS
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Executing plan %p executed %u times, planning retransmission\n",
+             rp,
+             rp->transmission_counter);
+#endif    
   plan (pp, rp);
   return msize;
 }
@@ -243,6 +249,11 @@
     }
   /* process from priority heap */
   rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap);
+#if DEBUG_FS
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Executing query plan %p\n",
+             rp);
+#endif    
   GNUNET_assert (NULL != rp);
   msize = GSF_pending_request_get_message_ (rp->pr, 0, NULL);                  
                   
   pp->pth = GSF_peer_transmit_ (pp->cp,
@@ -270,7 +281,7 @@
   struct PeerPlan *pp;
   struct GSF_PendingRequestData *prd;
   struct GSF_RequestPlan *rp;
-  
+
   GSF_connected_peer_get_identity_ (cp, &id);
   pp = GNUNET_CONTAINER_multihashmap_get (plans,
                                          &id.hashPubKey);
@@ -287,6 +298,13 @@
     }
   prd = GSF_pending_request_get_data_ (pr);
   rp = GNUNET_malloc (sizeof (struct GSF_RequestPlan));
+#if DEBUG_FS
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Planning transmission of query `%s' to peer `%s' (%p)\n",
+             GNUNET_h2s (&prd->query),
+             GNUNET_i2s (&id), 
+             rp);
+#endif    
   rp->pr = pr;
   GNUNET_CONTAINER_DLL_insert (prd->rp_head,
                               prd->rp_tail,

Modified: gnunet/src/fs/gnunet-service-fs_push.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_push.c      2011-04-19 19:50:20 UTC (rev 
15034)
+++ gnunet/src/fs/gnunet-service-fs_push.c      2011-04-19 21:01:44 UTC (rev 
15035)
@@ -31,6 +31,8 @@
 #include "gnunet-service-fs_push.h"
 
 
+#define DEBUG_FS_MIGRATION GNUNET_NO
+
 /**
  * How long must content remain valid for us to consider it for migration?  
  * If content will expire too soon, there is clearly no point in pushing
@@ -219,7 +221,7 @@
   peer->msg = NULL;
   if (buf == NULL)
     {
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Failed to migrate content to another peer (disconnect)\n");
 #endif
@@ -230,7 +232,7 @@
   GNUNET_assert (msize <= buf_size);
   memcpy (buf, msg, msize);
   GNUNET_free (msg);
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Pushing %u bytes to another peer\n",
              msize);
@@ -287,7 +289,7 @@
     {
       ret = GNUNET_NO;
     }
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Asking for transmission of %u bytes for migration\n",
              msize);
@@ -391,13 +393,13 @@
     {
       if (mig_size < MAX_MIGRATION_QUEUE)
        {
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                      "No content found for pushing, waiting for queue to 
fill\n");
 #endif
          return; /* will fill up eventually... */
        }
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "No suitable content found, purging content from full 
queue\n");
 #endif
@@ -420,7 +422,7 @@
       consider_gathering ();
       return;
     }
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Preparing to push best content to peer\n");
 #endif
@@ -463,6 +465,11 @@
                                       MAX_MIGRATION_QUEUE);
   delay = GNUNET_TIME_relative_max (delay,
                                    min_migration_delay);
+#if DEBUG_FS_MIGRATION
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Scheduling gathering task (queue size: %u)\n",
+             mig_size);
+#endif
   mig_task = GNUNET_SCHEDULER_add_delayed (delay,
                                           &gather_migration_blocks,
                                           NULL);
@@ -500,6 +507,10 @@
   mig_qe = NULL;
   if (key == NULL)
     {
+#if DEBUG_FS_MIGRATION
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "No content found for migration...\n");
+#endif
       consider_gathering ();
       return;
     }
@@ -521,13 +532,13 @@
        consider_gathering ();  
       return;
     }
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Retrieved block `%s' of type %u for migration (queue size: 
%u/%u)\n",
              GNUNET_h2s (key),
              type,
              mig_size + 1,
-             MIGRATION_LIST_SIZE);
+             MAX_MIGRATION_QUEUE);
 #endif
   mb = GNUNET_malloc (sizeof (struct MigrationReadyBlock) + size);
   mb->query = *key;
@@ -545,7 +556,7 @@
     {
       if (NULL == pos->th)
        {
-#if DEBUG_FS
+#if DEBUG_FS_MIGRATION
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                      "Preparing to push best content to peer\n");
 #endif
@@ -574,6 +585,11 @@
     return;
   if (GSF_dsh != NULL)
     {
+#if DEBUG_FS_MIGRATION
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Asking datastore for content for replication (queue size: 
%u)\n",
+                 mig_size);
+#endif
       mig_qe = GNUNET_DATASTORE_get_for_replication (GSF_dsh, 
                                                     0, UINT_MAX,
                                                     
GNUNET_TIME_UNIT_FOREVER_REL,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]