Skip to content

Commit 618a27a

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: pass objects to the xrep_ibt_walk_rmap tracepoint
Pass the perag structure and the irec so that the decoding is only done when tracing is actually enabled and the call sites look a lot neater, and remove the pointless class indirection. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 1209d36 commit 618a27a

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

fs/xfs/scrub/ialloc_repair.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,7 @@ xrep_ibt_record_inode_blocks(
421421
if (error)
422422
return error;
423423

424-
trace_xrep_ibt_walk_rmap(mp, ri->sc->sa.pag->pag_agno,
425-
rec->rm_startblock, rec->rm_blockcount, rec->rm_owner,
426-
rec->rm_offset, rec->rm_flags);
424+
trace_xrep_ibt_walk_rmap(ri->sc->sa.pag, rec);
427425

428426
/*
429427
* Record the free/hole masks for each inode cluster that could be

fs/xfs/scrub/trace.h

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,11 +1984,9 @@ DEFINE_EVENT(xrep_reap_find_class, name, \
19841984
DEFINE_REPAIR_REAP_FIND_EVENT(xreap_agextent_select);
19851985
DEFINE_REPAIR_REAP_FIND_EVENT(xreap_bmapi_select);
19861986

1987-
DECLARE_EVENT_CLASS(xrep_rmap_class,
1988-
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1989-
xfs_agblock_t agbno, xfs_extlen_t len,
1990-
uint64_t owner, uint64_t offset, unsigned int flags),
1991-
TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
1987+
TRACE_EVENT(xrep_ibt_walk_rmap,
1988+
TP_PROTO(const struct xfs_perag *pag, const struct xfs_rmap_irec *rec),
1989+
TP_ARGS(pag, rec),
19921990
TP_STRUCT__entry(
19931991
__field(dev_t, dev)
19941992
__field(xfs_agnumber_t, agno)
@@ -1999,13 +1997,13 @@ DECLARE_EVENT_CLASS(xrep_rmap_class,
19991997
__field(unsigned int, flags)
20001998
),
20011999
TP_fast_assign(
2002-
__entry->dev = mp->m_super->s_dev;
2003-
__entry->agno = agno;
2004-
__entry->agbno = agbno;
2005-
__entry->len = len;
2006-
__entry->owner = owner;
2007-
__entry->offset = offset;
2008-
__entry->flags = flags;
2000+
__entry->dev = pag->pag_mount->m_super->s_dev;
2001+
__entry->agno = pag->pag_agno;
2002+
__entry->agbno = rec->rm_startblock;
2003+
__entry->len = rec->rm_blockcount;
2004+
__entry->owner = rec->rm_owner;
2005+
__entry->offset = rec->rm_offset;
2006+
__entry->flags = rec->rm_flags;
20092007
),
20102008
TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
20112009
MAJOR(__entry->dev), MINOR(__entry->dev),
@@ -2016,13 +2014,6 @@ DECLARE_EVENT_CLASS(xrep_rmap_class,
20162014
__entry->offset,
20172015
__entry->flags)
20182016
);
2019-
#define DEFINE_REPAIR_RMAP_EVENT(name) \
2020-
DEFINE_EVENT(xrep_rmap_class, name, \
2021-
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2022-
xfs_agblock_t agbno, xfs_extlen_t len, \
2023-
uint64_t owner, uint64_t offset, unsigned int flags), \
2024-
TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2025-
DEFINE_REPAIR_RMAP_EVENT(xrep_ibt_walk_rmap);
20262017

20272018
TRACE_EVENT(xrep_abt_found,
20282019
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,

0 commit comments

Comments
 (0)