Commit e632a569 authored by Dave Chinner's avatar Dave Chinner Committed by Darrick J. Wong

xfs: adder caller IP to xfs_defer* tracepoints

So it's clear in the trace where they are being called from.
Signed-Off-By: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent ba18781b
...@@ -220,7 +220,7 @@ xfs_defer_trans_abort( ...@@ -220,7 +220,7 @@ xfs_defer_trans_abort(
{ {
struct xfs_defer_pending *dfp; struct xfs_defer_pending *dfp;
trace_xfs_defer_trans_abort(tp->t_mountp, dop); trace_xfs_defer_trans_abort(tp->t_mountp, dop, _RET_IP_);
/* Abort intent items that don't have a done item. */ /* Abort intent items that don't have a done item. */
list_for_each_entry(dfp, &dop->dop_pending, dfp_list) { list_for_each_entry(dfp, &dop->dop_pending, dfp_list) {
...@@ -253,7 +253,7 @@ xfs_defer_trans_roll( ...@@ -253,7 +253,7 @@ xfs_defer_trans_roll(
for (i = 0; i < XFS_DEFER_OPS_NR_BUFS && dop->dop_bufs[i]; i++) for (i = 0; i < XFS_DEFER_OPS_NR_BUFS && dop->dop_bufs[i]; i++)
xfs_trans_dirty_buf(*tp, dop->dop_bufs[i]); xfs_trans_dirty_buf(*tp, dop->dop_bufs[i]);
trace_xfs_defer_trans_roll((*tp)->t_mountp, dop); trace_xfs_defer_trans_roll((*tp)->t_mountp, dop, _RET_IP_);
/* Roll the transaction. */ /* Roll the transaction. */
error = xfs_trans_roll(tp); error = xfs_trans_roll(tp);
...@@ -356,7 +356,7 @@ xfs_defer_finish( ...@@ -356,7 +356,7 @@ xfs_defer_finish(
ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES); ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES);
trace_xfs_defer_finish((*tp)->t_mountp, dop); trace_xfs_defer_finish((*tp)->t_mountp, dop, _RET_IP_);
/* /*
* Attach dfops to the transaction during deferred ops processing. This * Attach dfops to the transaction during deferred ops processing. This
...@@ -443,7 +443,7 @@ xfs_defer_finish( ...@@ -443,7 +443,7 @@ xfs_defer_finish(
if (error) if (error)
trace_xfs_defer_finish_error((*tp)->t_mountp, dop, error); trace_xfs_defer_finish_error((*tp)->t_mountp, dop, error);
else else
trace_xfs_defer_finish_done((*tp)->t_mountp, dop); trace_xfs_defer_finish_done((*tp)->t_mountp, dop, _RET_IP_);
return error; return error;
} }
...@@ -459,7 +459,7 @@ xfs_defer_cancel( ...@@ -459,7 +459,7 @@ xfs_defer_cancel(
struct list_head *pwi; struct list_head *pwi;
struct list_head *n; struct list_head *n;
trace_xfs_defer_cancel(NULL, dop); trace_xfs_defer_cancel(NULL, dop, _RET_IP_);
/* /*
* Free the pending items. Caller should already have arranged * Free the pending items. Caller should already have arranged
...@@ -544,5 +544,5 @@ xfs_defer_init( ...@@ -544,5 +544,5 @@ xfs_defer_init(
*fbp = NULLFSBLOCK; *fbp = NULLFSBLOCK;
INIT_LIST_HEAD(&dop->dop_intake); INIT_LIST_HEAD(&dop->dop_intake);
INIT_LIST_HEAD(&dop->dop_pending); INIT_LIST_HEAD(&dop->dop_pending);
trace_xfs_defer_init(NULL, dop); trace_xfs_defer_init(NULL, dop, _RET_IP_);
} }
...@@ -2246,30 +2246,35 @@ struct xfs_defer_pending; ...@@ -2246,30 +2246,35 @@ struct xfs_defer_pending;
struct xfs_defer_ops; struct xfs_defer_ops;
DECLARE_EVENT_CLASS(xfs_defer_class, DECLARE_EVENT_CLASS(xfs_defer_class,
TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop,
TP_ARGS(mp, dop), unsigned long caller_ip),
TP_ARGS(mp, dop, caller_ip),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(dev_t, dev) __field(dev_t, dev)
__field(void *, dop) __field(void *, dop)
__field(char, committed) __field(char, committed)
__field(char, low) __field(char, low)
__field(unsigned long, caller_ip)
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = mp ? mp->m_super->s_dev : 0; __entry->dev = mp ? mp->m_super->s_dev : 0;
__entry->dop = dop; __entry->dop = dop;
__entry->committed = dop->dop_committed; __entry->committed = dop->dop_committed;
__entry->low = dop->dop_low; __entry->low = dop->dop_low;
__entry->caller_ip = caller_ip;
), ),
TP_printk("dev %d:%d ops %p committed %d low %d", TP_printk("dev %d:%d ops %p committed %d low %d, caller %pS",
MAJOR(__entry->dev), MINOR(__entry->dev), MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->dop, __entry->dop,
__entry->committed, __entry->committed,
__entry->low) __entry->low,
(char *)__entry->caller_ip)
) )
#define DEFINE_DEFER_EVENT(name) \ #define DEFINE_DEFER_EVENT(name) \
DEFINE_EVENT(xfs_defer_class, name, \ DEFINE_EVENT(xfs_defer_class, name, \
TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \ TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, \
TP_ARGS(mp, dop)) unsigned long caller_ip), \
TP_ARGS(mp, dop, caller_ip))
DECLARE_EVENT_CLASS(xfs_defer_error_class, DECLARE_EVENT_CLASS(xfs_defer_error_class,
TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment