]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: pass objects to the xfs_irec_merge_{pre,post} trace points
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Nov 2024 04:18:33 +0000 (20:18 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:26 +0000 (13:38 -0800)
Pass the perag structure and the irec to these tracepoints so that the
decoding is only done when tracing is actually enabled and the call sites
look a lot neater.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_ialloc.c
fs/xfs/xfs_trace.h

index c072317a0fe514ce9035f2b55a3245d8880fb950..085032443f12675f85d42467733b252d7bd99648 100644 (file)
@@ -606,15 +606,12 @@ xfs_inobt_insert_sprec(
                goto error;
        }
 
-       trace_xfs_irec_merge_pre(mp, pag->pag_agno, rec.ir_startino,
-                                rec.ir_holemask, nrec->ir_startino,
-                                nrec->ir_holemask);
+       trace_xfs_irec_merge_pre(pag, &rec, nrec);
 
        /* merge to nrec to output the updated record */
        __xfs_inobt_rec_merge(nrec, &rec);
 
-       trace_xfs_irec_merge_post(mp, pag->pag_agno, nrec->ir_startino,
-                                 nrec->ir_holemask);
+       trace_xfs_irec_merge_post(pag, nrec);
 
        error = xfs_inobt_rec_check_count(mp, nrec);
        if (error)
index 14fb86daea61bf0f8253d3cc391d2b3d0e33035e..efd89d79dff2b681e0c208dbccd1262f0e5b56dd 100644 (file)
@@ -894,9 +894,10 @@ TRACE_EVENT(xfs_iomap_prealloc_size,
 )
 
 TRACE_EVENT(xfs_irec_merge_pre,
-       TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
-                uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
-       TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
+       TP_PROTO(const struct xfs_perag *pag,
+                const struct xfs_inobt_rec_incore *rec,
+                const struct xfs_inobt_rec_incore *nrec),
+       TP_ARGS(pag, rec, nrec),
        TP_STRUCT__entry(
                __field(dev_t, dev)
                __field(xfs_agnumber_t, agno)
@@ -906,12 +907,12 @@ TRACE_EVENT(xfs_irec_merge_pre,
                __field(uint16_t, nholemask)
        ),
        TP_fast_assign(
-               __entry->dev = mp->m_super->s_dev;
-               __entry->agno = agno;
-               __entry->agino = agino;
-               __entry->holemask = holemask;
-               __entry->nagino = nagino;
-               __entry->nholemask = holemask;
+               __entry->dev = pag->pag_mount->m_super->s_dev;
+               __entry->agno = pag->pag_agno;
+               __entry->agino = rec->ir_startino;
+               __entry->holemask = rec->ir_holemask;
+               __entry->nagino = nrec->ir_startino;
+               __entry->nholemask = nrec->ir_holemask;
        ),
        TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
@@ -923,9 +924,9 @@ TRACE_EVENT(xfs_irec_merge_pre,
 )
 
 TRACE_EVENT(xfs_irec_merge_post,
-       TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
-                uint16_t holemask),
-       TP_ARGS(mp, agno, agino, holemask),
+       TP_PROTO(const struct xfs_perag *pag,
+                const struct xfs_inobt_rec_incore *nrec),
+       TP_ARGS(pag, nrec),
        TP_STRUCT__entry(
                __field(dev_t, dev)
                __field(xfs_agnumber_t, agno)
@@ -933,10 +934,10 @@ TRACE_EVENT(xfs_irec_merge_post,
                __field(uint16_t, holemask)
        ),
        TP_fast_assign(
-               __entry->dev = mp->m_super->s_dev;
-               __entry->agno = agno;
-               __entry->agino = agino;
-               __entry->holemask = holemask;
+               __entry->dev = pag->pag_mount->m_super->s_dev;
+               __entry->agno = pag->pag_agno;
+               __entry->agino = nrec->ir_startino;
+               __entry->holemask = nrec->ir_holemask;
        ),
        TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
                  MAJOR(__entry->dev),