HAMMER - Add vfs.hammer.stats_undo
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Sep 2009 20:36:32 +0000 (13:36 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Sep 2009 20:36:32 +0000 (13:36 -0700)
* Statistics on number of bytes of undo space written.

sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_undo.c
sys/vfs/hammer/hammer_vfsops.c

index d28e535..7f05c99 100644 (file)
@@ -853,6 +853,7 @@ extern int64_t hammer_stats_disk_read;
 extern int64_t hammer_stats_disk_write;
 extern int64_t hammer_stats_inode_flushes;
 extern int64_t hammer_stats_commits;
+extern int64_t hammer_stats_undo;
 extern int hammer_count_dirtybufspace;
 extern int hammer_count_refedbufs;
 extern int hammer_count_reservations;
index 52bbe01..c5fb784 100644 (file)
@@ -166,6 +166,7 @@ again:
                /* NO CRC */
                undomap->next_offset += bytes;
                hammer_modify_buffer_done(buffer);
+               hammer_stats_undo += bytes;
                goto again;
        }
        if (hammer_debug_general & 0x0080) {
@@ -194,6 +195,7 @@ again:
        undo->head.hdr_crc = crc32(undo, HAMMER_FIFO_HEAD_CRCOFF) ^
                             crc32(&undo->head + 1, bytes - sizeof(undo->head));
        undomap->next_offset += bytes;
+       hammer_stats_undo += bytes;
 
        hammer_modify_buffer_done(buffer);
 done:
index be8d642..0b6139e 100644 (file)
@@ -87,6 +87,7 @@ int64_t hammer_stats_disk_read;
 int64_t hammer_stats_disk_write;
 int64_t hammer_stats_inode_flushes;
 int64_t hammer_stats_commits;
+int64_t hammer_stats_undo;
 
 int hammer_count_dirtybufspace;                /* global */
 int hammer_count_refedbufs;            /* global */
@@ -196,6 +197,8 @@ SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_inode_flushes, CTLFLAG_RD,
           &hammer_stats_inode_flushes, 0, "");
 SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_commits, CTLFLAG_RD,
           &hammer_stats_commits, 0, "");
+SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_undo, CTLFLAG_RD,
+          &hammer_stats_undo, 0, "");
 
 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_dirtybufspace, CTLFLAG_RD,
           &hammer_count_dirtybufspace, 0, "");