diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-06-21 11:53:28 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-06-21 11:53:28 +1000 |
commit | 479c641273df632478cda7fe76b833df64e319bc (patch) | |
tree | fcfade01ced0f2aab76e3366aaba93ad3d574acc /fs/xfs/xfs_buf.c | |
parent | 3f94c441e2c3dea029a46a2326b2170acf2c7713 (diff) | |
download | linux-479c641273df632478cda7fe76b833df64e319bc.tar.gz linux-479c641273df632478cda7fe76b833df64e319bc.tar.bz2 linux-479c641273df632478cda7fe76b833df64e319bc.zip |
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>
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r-- | fs/xfs/xfs_buf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index e71cfbd5acb3..f14daebbc531 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -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; } |