Skip to content

Commit 487092c

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: pass objects to the xfs_irec_merge_{pre,post} trace points
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>
1 parent 835ddb5 commit 487092c

2 files changed

Lines changed: 19 additions & 21 deletions

File tree

fs/xfs/libxfs/xfs_ialloc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,15 +606,12 @@ xfs_inobt_insert_sprec(
606606
goto error;
607607
}
608608

609-
trace_xfs_irec_merge_pre(mp, pag->pag_agno, rec.ir_startino,
610-
rec.ir_holemask, nrec->ir_startino,
611-
nrec->ir_holemask);
609+
trace_xfs_irec_merge_pre(pag, &rec, nrec);
612610

613611
/* merge to nrec to output the updated record */
614612
__xfs_inobt_rec_merge(nrec, &rec);
615613

616-
trace_xfs_irec_merge_post(mp, pag->pag_agno, nrec->ir_startino,
617-
nrec->ir_holemask);
614+
trace_xfs_irec_merge_post(pag, nrec);
618615

619616
error = xfs_inobt_rec_check_count(mp, nrec);
620617
if (error)

fs/xfs/xfs_trace.h

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -894,9 +894,10 @@ TRACE_EVENT(xfs_iomap_prealloc_size,
894894
)
895895

896896
TRACE_EVENT(xfs_irec_merge_pre,
897-
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
898-
uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
899-
TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
897+
TP_PROTO(const struct xfs_perag *pag,
898+
const struct xfs_inobt_rec_incore *rec,
899+
const struct xfs_inobt_rec_incore *nrec),
900+
TP_ARGS(pag, rec, nrec),
900901
TP_STRUCT__entry(
901902
__field(dev_t, dev)
902903
__field(xfs_agnumber_t, agno)
@@ -906,12 +907,12 @@ TRACE_EVENT(xfs_irec_merge_pre,
906907
__field(uint16_t, nholemask)
907908
),
908909
TP_fast_assign(
909-
__entry->dev = mp->m_super->s_dev;
910-
__entry->agno = agno;
911-
__entry->agino = agino;
912-
__entry->holemask = holemask;
913-
__entry->nagino = nagino;
914-
__entry->nholemask = holemask;
910+
__entry->dev = pag->pag_mount->m_super->s_dev;
911+
__entry->agno = pag->pag_agno;
912+
__entry->agino = rec->ir_startino;
913+
__entry->holemask = rec->ir_holemask;
914+
__entry->nagino = nrec->ir_startino;
915+
__entry->nholemask = nrec->ir_holemask;
915916
),
916917
TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
917918
MAJOR(__entry->dev), MINOR(__entry->dev),
@@ -923,20 +924,20 @@ TRACE_EVENT(xfs_irec_merge_pre,
923924
)
924925

925926
TRACE_EVENT(xfs_irec_merge_post,
926-
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
927-
uint16_t holemask),
928-
TP_ARGS(mp, agno, agino, holemask),
927+
TP_PROTO(const struct xfs_perag *pag,
928+
const struct xfs_inobt_rec_incore *nrec),
929+
TP_ARGS(pag, nrec),
929930
TP_STRUCT__entry(
930931
__field(dev_t, dev)
931932
__field(xfs_agnumber_t, agno)
932933
__field(xfs_agino_t, agino)
933934
__field(uint16_t, holemask)
934935
),
935936
TP_fast_assign(
936-
__entry->dev = mp->m_super->s_dev;
937-
__entry->agno = agno;
938-
__entry->agino = agino;
939-
__entry->holemask = holemask;
937+
__entry->dev = pag->pag_mount->m_super->s_dev;
938+
__entry->agno = pag->pag_agno;
939+
__entry->agino = nrec->ir_startino;
940+
__entry->holemask = nrec->ir_holemask;
940941
),
941942
TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
942943
MAJOR(__entry->dev),

0 commit comments

Comments
 (0)