]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: convert extent busy tracing to the generic group structure
authorChristoph Hellwig <hch@lst.de>
Thu, 19 Sep 2024 13:09:06 +0000 (15:09 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 22 Sep 2024 05:37:32 +0000 (07:37 +0200)
Prepare for tracking busy RT extents by passing the generic group
structure to the xfs_extent_busy_class tracepoints.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_extent_busy.c
fs/xfs/xfs_trace.h

index 2806fc6ab4800d5a31f7438dac838ef127f89d74..ff10307702f01165700e2351fbae4bb21809f293 100644 (file)
@@ -41,7 +41,7 @@ xfs_extent_busy_insert_list(
        new->flags = flags;
 
        /* trace before insert to be able to see failed inserts */
-       trace_xfs_extent_busy(pag, bno, len);
+       trace_xfs_extent_busy(&pag->pag_group, bno, len);
 
        spin_lock(&pag->pagb_lock);
        rbp = &pag->pagb_tree.rb_node;
@@ -278,13 +278,13 @@ xfs_extent_busy_update_extent(
                ASSERT(0);
        }
 
-       trace_xfs_extent_busy_reuse(pag, fbno, flen);
+       trace_xfs_extent_busy_reuse(&pag->pag_group, fbno, flen);
        return true;
 
 out_force_log:
        spin_unlock(&pag->pagb_lock);
        xfs_log_force(pag_mount(pag), XFS_LOG_SYNC);
-       trace_xfs_extent_busy_force(pag, fbno, flen);
+       trace_xfs_extent_busy_force(&pag->pag_group, fbno, flen);
        spin_lock(&pag->pagb_lock);
        return false;
 }
@@ -496,7 +496,8 @@ xfs_extent_busy_trim(
 out:
 
        if (fbno != *bno || flen != *len) {
-               trace_xfs_extent_busy_trim(args->pag, *bno, *len, fbno, flen);
+               trace_xfs_extent_busy_trim(&args->pag->pag_group, *bno, *len,
+                               fbno, flen);
                *bno = fbno;
                *len = flen;
                *busy_gen = args->pag->pagb_gen;
@@ -525,7 +526,8 @@ xfs_extent_busy_clear_one(
                        busyp->flags = XFS_EXTENT_BUSY_DISCARDED;
                        return false;
                }
-               trace_xfs_extent_busy_clear(pag, busyp->bno, busyp->length);
+               trace_xfs_extent_busy_clear(&pag->pag_group, busyp->bno,
+                               busyp->length);
                rb_erase(&busyp->rb_node, &pag->pagb_tree);
        }
 
index 40f535538dc0ec5e321f4841985a212a01ed6abc..4674ef01e38d9c7d34a9a4c4bc8992dc1af48cd4 100644 (file)
@@ -1678,43 +1678,48 @@ TRACE_EVENT(xfs_bunmap,
 );
 
 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
-       TP_PROTO(const struct xfs_perag *pag, xfs_agblock_t agbno,
+       TP_PROTO(const struct xfs_group *xg, xfs_agblock_t agbno,
                 xfs_extlen_t len),
-       TP_ARGS(pag, agbno, len),
+       TP_ARGS(xg, agbno, len),
        TP_STRUCT__entry(
                __field(dev_t, dev)
+               __field(enum xfs_group_type, type)
                __field(xfs_agnumber_t, agno)
                __field(xfs_agblock_t, agbno)
                __field(xfs_extlen_t, len)
        ),
        TP_fast_assign(
-               __entry->dev = pag_mount(pag)->m_super->s_dev;
-               __entry->agno = pag_agno(pag);
+               __entry->dev = xg->xg_mount->m_super->s_dev;
+               __entry->type = xg->xg_type;
+               __entry->agno = xg->xg_index;
                __entry->agbno = agbno;
                __entry->len = len;
        ),
-       TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
+       TP_printk("dev %d:%d %sno 0x%x %sbno 0x%x fsbcount 0x%x",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
+                 __print_symbolic(__entry->type, XG_TYPE_STRINGS),
                  __entry->agno,
+                 __print_symbolic(__entry->type, XG_TYPE_STRINGS),
                  __entry->agbno,
                  __entry->len)
 );
 #define DEFINE_BUSY_EVENT(name) \
 DEFINE_EVENT(xfs_extent_busy_class, name, \
-       TP_PROTO(const struct xfs_perag *pag, xfs_agblock_t agbno, \
-                       xfs_extlen_t len), \
-       TP_ARGS(pag, agbno, len))
+       TP_PROTO(const struct xfs_group *xg, xfs_agblock_t agbno, \
+                xfs_extlen_t len), \
+       TP_ARGS(xg, agbno, len))
 DEFINE_BUSY_EVENT(xfs_extent_busy);
 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
 
 TRACE_EVENT(xfs_extent_busy_trim,
-       TP_PROTO(const struct xfs_perag *pag, xfs_agblock_t agbno,
+       TP_PROTO(const struct xfs_group *xg, xfs_agblock_t agbno,
                 xfs_extlen_t len, xfs_agblock_t tbno, xfs_extlen_t tlen),
-       TP_ARGS(pag, agbno, len, tbno, tlen),
+       TP_ARGS(xg, agbno, len, tbno, tlen),
        TP_STRUCT__entry(
                __field(dev_t, dev)
+               __field(enum xfs_group_type, type)
                __field(xfs_agnumber_t, agno)
                __field(xfs_agblock_t, agbno)
                __field(xfs_extlen_t, len)
@@ -1722,16 +1727,19 @@ TRACE_EVENT(xfs_extent_busy_trim,
                __field(xfs_extlen_t, tlen)
        ),
        TP_fast_assign(
-               __entry->dev = pag_mount(pag)->m_super->s_dev;
-               __entry->agno = pag_agno(pag);
+               __entry->dev = xg->xg_mount->m_super->s_dev;
+               __entry->type = xg->xg_type;
+               __entry->agno = xg->xg_index;
                __entry->agbno = agbno;
                __entry->len = len;
                __entry->tbno = tbno;
                __entry->tlen = tlen;
        ),
-       TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
+       TP_printk("dev %d:%d %sno 0x%x %sbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
+                 __print_symbolic(__entry->type, XG_TYPE_STRINGS),
                  __entry->agno,
+                 __print_symbolic(__entry->type, XG_TYPE_STRINGS),
                  __entry->agbno,
                  __entry->len,
                  __entry->tbno,