add number of blocks loaded from _mincore
authorCédric Villemain <cedric.villemain.debian@gmail.com>
Mon, 28 Dec 2009 23:11:34 +0000 (00:11 +0100)
committerCédric Villemain <cedric.villemain.debian@gmail.com>
Mon, 28 Dec 2009 23:11:34 +0000 (00:11 +0100)
pgfincore.c

index 30a4b089fbe852b6190f39638f4a41a1eb9b21b8..989ded6b09d7f7d98cf853b2de0366477ffa7536 100644 (file)
@@ -463,6 +463,7 @@ pgfadv_snapshot(char *filename, int fd, int action)
   int blockNum = 0;
   unsigned int c;
   unsigned int count = 0;
+  unsigned int gcount = 0;
   /*
   * We handle the effective_io_concurrency...
   */
@@ -481,6 +482,7 @@ pgfadv_snapshot(char *filename, int fd, int action)
                  if (c & 01)
                  {
                        count++;
+                       gcount++;
                        if (count == effective_io_concurrency)
                        {
                          posix_fadvise(fd, ((blockNum-count)*pageSize), count*pageSize, POSIX_FADV_WILLNEED);
@@ -491,7 +493,8 @@ pgfadv_snapshot(char *filename, int fd, int action)
          if (count)
                posix_fadvise(fd, ((blockNum-count)*pageSize), count*pageSize, POSIX_FADV_WILLNEED);
          fclose(f);
+         elog(DEBUG1, "pgfadv_snapshot: loading %d blocks from relpath %s", gcount, filename);
        break;
   }
-  return 0;
+  return gcount;
 }
\ No newline at end of file