提交 f7008d0a 编写于 作者: C Christoph Hellwig 提交者: Alex Elder

xfs: fix xfs_fsblock_t tracing

Using a static buffer in xfs_fmtfsblock means we can corrupt traces if
multiple CPUs hit this code path at the same.  Just remove xfs_fmtfsblock
for now and print the block number purely numerical.  If we want the
NULLFSBLOCK and NULLSTARTBLOCK formatting back the best way would be
a decoding plugin in the trace-cmd userspace command.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDave Chinner <david@fromorbit.com>
Signed-off-by: NAlex Elder <aelder@sgi.com>
上级 024910cb
...@@ -51,22 +51,6 @@ ...@@ -51,22 +51,6 @@
#include "quota/xfs_dquot_item.h" #include "quota/xfs_dquot_item.h"
#include "quota/xfs_dquot.h" #include "quota/xfs_dquot.h"
/*
* Format fsblock number into a static buffer & return it.
*/
STATIC char *xfs_fmtfsblock(xfs_fsblock_t bno)
{
static char rval[50];
if (bno == NULLFSBLOCK)
sprintf(rval, "NULLFSBLOCK");
else if (isnullstartblock(bno))
sprintf(rval, "NULLSTARTBLOCK(%lld)", startblockval(bno));
else
sprintf(rval, "%lld", (xfs_dfsbno_t)bno);
return rval;
}
/* /*
* We include this last to have the helpers above available for the trace * We include this last to have the helpers above available for the trace
* event implementations. * event implementations.
......
...@@ -197,13 +197,13 @@ TRACE_EVENT(xfs_iext_insert, ...@@ -197,13 +197,13 @@ TRACE_EVENT(xfs_iext_insert,
__entry->caller_ip = caller_ip; __entry->caller_ip = caller_ip;
), ),
TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
"offset %lld block %s count %lld flag %d caller %pf", "offset %lld block %lld count %lld flag %d caller %pf",
MAJOR(__entry->dev), MINOR(__entry->dev), MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->ino, __entry->ino,
__print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
(long)__entry->idx, (long)__entry->idx,
__entry->startoff, __entry->startoff,
xfs_fmtfsblock(__entry->startblock), (__int64_t)__entry->startblock,
__entry->blockcount, __entry->blockcount,
__entry->state, __entry->state,
(char *)__entry->caller_ip) (char *)__entry->caller_ip)
...@@ -241,13 +241,13 @@ DECLARE_EVENT_CLASS(xfs_bmap_class, ...@@ -241,13 +241,13 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
__entry->caller_ip = caller_ip; __entry->caller_ip = caller_ip;
), ),
TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
"offset %lld block %s count %lld flag %d caller %pf", "offset %lld block %lld count %lld flag %d caller %pf",
MAJOR(__entry->dev), MINOR(__entry->dev), MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->ino, __entry->ino,
__print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
(long)__entry->idx, (long)__entry->idx,
__entry->startoff, __entry->startoff,
xfs_fmtfsblock(__entry->startblock), (__int64_t)__entry->startblock,
__entry->blockcount, __entry->blockcount,
__entry->state, __entry->state,
(char *)__entry->caller_ip) (char *)__entry->caller_ip)
...@@ -881,7 +881,7 @@ TRACE_EVENT(name, \ ...@@ -881,7 +881,7 @@ TRACE_EVENT(name, \
), \ ), \
TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
"offset 0x%llx count %zd flags %s " \ "offset 0x%llx count %zd flags %s " \
"startoff 0x%llx startblock %s blockcount 0x%llx", \ "startoff 0x%llx startblock %lld blockcount 0x%llx", \
MAJOR(__entry->dev), MINOR(__entry->dev), \ MAJOR(__entry->dev), MINOR(__entry->dev), \
__entry->ino, \ __entry->ino, \
__entry->size, \ __entry->size, \
...@@ -890,7 +890,7 @@ TRACE_EVENT(name, \ ...@@ -890,7 +890,7 @@ TRACE_EVENT(name, \
__entry->count, \ __entry->count, \
__print_flags(__entry->flags, "|", BMAPI_FLAGS), \ __print_flags(__entry->flags, "|", BMAPI_FLAGS), \
__entry->startoff, \ __entry->startoff, \
xfs_fmtfsblock(__entry->startblock), \ (__int64_t)__entry->startblock, \
__entry->blockcount) \ __entry->blockcount) \
) )
DEFINE_IOMAP_EVENT(xfs_iomap_enter); DEFINE_IOMAP_EVENT(xfs_iomap_enter);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册