gfs2: enhance log_blocks trace point to show log blocks free
authorBob Peterson <rpeterso@redhat.com>
Thu, 20 Aug 2020 13:59:28 +0000 (08:59 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 15 Oct 2020 12:29:03 +0000 (14:29 +0200)
This patch adds some code to enhance the log_blocks trace point. It
reports the number of free log blocks. This makes the trace point much
more useful, especially for debugging performance problems when we can
tell when the journal gets full and needs to wait for flushes, etc.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/trace_gfs2.h

index e0025258107a8702777b8b3a4cec97f89924c4d6..fe140ceef74deeff3839f92806f85c2cc8afc40f 100644 (file)
@@ -388,15 +388,17 @@ TRACE_EVENT(gfs2_log_blocks,
        TP_STRUCT__entry(
                __field(        dev_t,  dev                     )
                __field(        int,    blocks                  )
+               __field(        int,    blks_free               )
        ),
 
        TP_fast_assign(
                __entry->dev            = sdp->sd_vfs->s_dev;
                __entry->blocks         = blocks;
+               __entry->blks_free      = atomic_read(&sdp->sd_log_blks_free);
        ),
 
-       TP_printk("%u,%u log reserve %d", MAJOR(__entry->dev),
-                 MINOR(__entry->dev), __entry->blocks)
+       TP_printk("%u,%u log reserve %d %d", MAJOR(__entry->dev),
+                 MINOR(__entry->dev), __entry->blocks, __entry->blks_free)
 );
 
 /* Writing back the AIL */