Skip to content

Commit 0e10cb9

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: convert extent busy tracepoints to the generic group structure
Prepare for tracking busy RT extents by passing the generic group structure to the xfs_extent_busy_class tracepoints. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 6af1300 commit 0e10cb9

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

fs/xfs/xfs_extent_busy.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ xfs_extent_busy_insert_list(
4141
new->flags = flags;
4242

4343
/* trace before insert to be able to see failed inserts */
44-
trace_xfs_extent_busy(pag, bno, len);
44+
trace_xfs_extent_busy(pag_group(pag), bno, len);
4545

4646
spin_lock(&pag->pagb_lock);
4747
rbp = &pag->pagb_tree.rb_node;
@@ -278,13 +278,13 @@ xfs_extent_busy_update_extent(
278278
ASSERT(0);
279279
}
280280

281-
trace_xfs_extent_busy_reuse(pag, fbno, flen);
281+
trace_xfs_extent_busy_reuse(pag_group(pag), fbno, flen);
282282
return true;
283283

284284
out_force_log:
285285
spin_unlock(&pag->pagb_lock);
286286
xfs_log_force(pag_mount(pag), XFS_LOG_SYNC);
287-
trace_xfs_extent_busy_force(pag, fbno, flen);
287+
trace_xfs_extent_busy_force(pag_group(pag), fbno, flen);
288288
spin_lock(&pag->pagb_lock);
289289
return false;
290290
}
@@ -496,7 +496,8 @@ xfs_extent_busy_trim(
496496
out:
497497

498498
if (fbno != *bno || flen != *len) {
499-
trace_xfs_extent_busy_trim(args->pag, *bno, *len, fbno, flen);
499+
trace_xfs_extent_busy_trim(pag_group(args->pag), *bno, *len,
500+
fbno, flen);
500501
*bno = fbno;
501502
*len = flen;
502503
*busy_gen = args->pag->pagb_gen;
@@ -525,7 +526,8 @@ xfs_extent_busy_clear_one(
525526
busyp->flags = XFS_EXTENT_BUSY_DISCARDED;
526527
return false;
527528
}
528-
trace_xfs_extent_busy_clear(pag, busyp->bno, busyp->length);
529+
trace_xfs_extent_busy_clear(pag_group(pag), busyp->bno,
530+
busyp->length);
529531
rb_erase(&busyp->rb_node, &pag->pagb_tree);
530532
}
531533

fs/xfs/xfs_trace.h

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,60 +1673,68 @@ TRACE_EVENT(xfs_bunmap,
16731673
);
16741674

16751675
DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1676-
TP_PROTO(const struct xfs_perag *pag, xfs_agblock_t agbno,
1676+
TP_PROTO(const struct xfs_group *xg, xfs_agblock_t agbno,
16771677
xfs_extlen_t len),
1678-
TP_ARGS(pag, agbno, len),
1678+
TP_ARGS(xg, agbno, len),
16791679
TP_STRUCT__entry(
16801680
__field(dev_t, dev)
1681+
__field(enum xfs_group_type, type)
16811682
__field(xfs_agnumber_t, agno)
16821683
__field(xfs_agblock_t, agbno)
16831684
__field(xfs_extlen_t, len)
16841685
),
16851686
TP_fast_assign(
1686-
__entry->dev = pag_mount(pag)->m_super->s_dev;
1687-
__entry->agno = pag_agno(pag);
1687+
__entry->dev = xg->xg_mount->m_super->s_dev;
1688+
__entry->type = xg->xg_type;
1689+
__entry->agno = xg->xg_gno;
16881690
__entry->agbno = agbno;
16891691
__entry->len = len;
16901692
),
1691-
TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
1693+
TP_printk("dev %d:%d %sno 0x%x %sbno 0x%x fsbcount 0x%x",
16921694
MAJOR(__entry->dev), MINOR(__entry->dev),
1695+
__print_symbolic(__entry->type, XG_TYPE_STRINGS),
16931696
__entry->agno,
1697+
__print_symbolic(__entry->type, XG_TYPE_STRINGS),
16941698
__entry->agbno,
16951699
__entry->len)
16961700
);
16971701
#define DEFINE_BUSY_EVENT(name) \
16981702
DEFINE_EVENT(xfs_extent_busy_class, name, \
1699-
TP_PROTO(const struct xfs_perag *pag, xfs_agblock_t agbno, \
1700-
xfs_extlen_t len), \
1701-
TP_ARGS(pag, agbno, len))
1703+
TP_PROTO(const struct xfs_group *xg, xfs_agblock_t agbno, \
1704+
xfs_extlen_t len), \
1705+
TP_ARGS(xg, agbno, len))
17021706
DEFINE_BUSY_EVENT(xfs_extent_busy);
17031707
DEFINE_BUSY_EVENT(xfs_extent_busy_force);
17041708
DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
17051709
DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
17061710

17071711
TRACE_EVENT(xfs_extent_busy_trim,
1708-
TP_PROTO(const struct xfs_perag *pag, xfs_agblock_t agbno,
1712+
TP_PROTO(const struct xfs_group *xg, xfs_agblock_t agbno,
17091713
xfs_extlen_t len, xfs_agblock_t tbno, xfs_extlen_t tlen),
1710-
TP_ARGS(pag, agbno, len, tbno, tlen),
1714+
TP_ARGS(xg, agbno, len, tbno, tlen),
17111715
TP_STRUCT__entry(
17121716
__field(dev_t, dev)
1717+
__field(enum xfs_group_type, type)
17131718
__field(xfs_agnumber_t, agno)
17141719
__field(xfs_agblock_t, agbno)
17151720
__field(xfs_extlen_t, len)
17161721
__field(xfs_agblock_t, tbno)
17171722
__field(xfs_extlen_t, tlen)
17181723
),
17191724
TP_fast_assign(
1720-
__entry->dev = pag_mount(pag)->m_super->s_dev;
1721-
__entry->agno = pag_agno(pag);
1725+
__entry->dev = xg->xg_mount->m_super->s_dev;
1726+
__entry->type = xg->xg_type;
1727+
__entry->agno = xg->xg_gno;
17221728
__entry->agbno = agbno;
17231729
__entry->len = len;
17241730
__entry->tbno = tbno;
17251731
__entry->tlen = tlen;
17261732
),
1727-
TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
1733+
TP_printk("dev %d:%d %sno 0x%x %sbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
17281734
MAJOR(__entry->dev), MINOR(__entry->dev),
1735+
__print_symbolic(__entry->type, XG_TYPE_STRINGS),
17291736
__entry->agno,
1737+
__print_symbolic(__entry->type, XG_TYPE_STRINGS),
17301738
__entry->agbno,
17311739
__entry->len,
17321740
__entry->tbno,

0 commit comments

Comments
 (0)