yaffs Add gc block counter
authorCharles Manning <cdhmanning@gmail.com>
Wed, 18 Aug 2010 00:47:29 +0000 (12:47 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Wed, 18 Aug 2010 00:52:25 +0000 (12:52 +1200)
Extra stats for counting how many blocks get selected for gc.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs_fs.c
yaffs_guts.c
yaffs_guts.h

index 7b55f18..a372ddf 100644 (file)
@@ -3194,6 +3194,7 @@ static char *yaffs_dump_dev_part1(char *buf, yaffs_Device * dev)
        buf += sprintf(buf, "allGCs............. %u\n", dev->allGCs);
        buf += sprintf(buf, "passiveGCs......... %u\n", dev->passiveGCs);
        buf += sprintf(buf, "oldestDirtyGCs..... %u\n", dev->oldestDirtyGCs);
+       buf += sprintf(buf, "nGCBlocks.......... %u\n", dev->nGCBlocks);
        buf += sprintf(buf, "backgroundGCs...... %u\n", dev->backgroundGCs);
        buf += sprintf(buf, "nRetriedWrites..... %u\n", dev->nRetriedWrites);
        buf += sprintf(buf, "nRetireBlocks...... %u\n", dev->nRetiredBlocks);
index a1782e7..389a57c 100644 (file)
@@ -2500,8 +2500,10 @@ static unsigned yaffs_FindBlockForGarbageCollection(yaffs_Device *dev,
                  dev->param.nChunksPerBlock - dev->gcPagesInUse,
                  prioritised));
 
+               dev->nGCBlocks++;
                if(background)
                        dev->backgroundGCs++;
+
                dev->gcDirtiest = 0;
                dev->gcPagesInUse = 0;
                dev->gcNotDone = 0;
index 6d4ae46..f9b5ac1 100644 (file)
@@ -759,6 +759,7 @@ struct yaffs_DeviceStruct {
        __u32 allGCs;
        __u32 passiveGCs;
        __u32 oldestDirtyGCs;
+       __u32 nGCBlocks;
        __u32 backgroundGCs;
        __u32 nRetriedWrites;
        __u32 nRetiredBlocks;