xfs: enable buffer deadlock postmortem diagnosis via ftrace
Create a second buf_trylock tracepoint so that we can distinguish between a successful and a failed trylock. With this piece, we can use a script to look at the ftrace output to detect buffer deadlocks. [dchinner: update to if/else as per hch's suggestion] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:

committed by
Dave Chinner

parent
3f94c441e2
commit
479c641273
@@ -944,10 +944,12 @@ xfs_buf_trylock(
|
||||
int locked;
|
||||
|
||||
locked = down_trylock(&bp->b_sema) == 0;
|
||||
if (locked)
|
||||
if (locked) {
|
||||
XB_SET_OWNER(bp);
|
||||
|
||||
trace_xfs_buf_trylock(bp, _RET_IP_);
|
||||
trace_xfs_buf_trylock(bp, _RET_IP_);
|
||||
} else {
|
||||
trace_xfs_buf_trylock_fail(bp, _RET_IP_);
|
||||
}
|
||||
return locked;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user