xfs: resolve fork names in trace output
Emit whichfork values as text strings in the ftrace output. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
This commit is contained in:
parent
c23460ebd5
commit
f93f85f77a
|
@ -87,6 +87,11 @@ typedef void * xfs_failaddr_t;
|
|||
#define XFS_ATTR_FORK 1
|
||||
#define XFS_COW_FORK 2
|
||||
|
||||
#define XFS_WHICHFORK_STRINGS \
|
||||
{ XFS_DATA_FORK, "data" }, \
|
||||
{ XFS_ATTR_FORK, "attr" }, \
|
||||
{ XFS_COW_FORK, "cow" }
|
||||
|
||||
/*
|
||||
* Min numbers of data/attr fork btree root pointers.
|
||||
*/
|
||||
|
|
|
@ -176,10 +176,10 @@ TRACE_EVENT(xchk_file_op_error,
|
|||
__entry->error = error;
|
||||
__entry->ret_ip = ret_ip;
|
||||
),
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %d type %s fileoff 0x%llx error %d ret_ip %pS",
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx error %d ret_ip %pS",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->ino,
|
||||
__entry->whichfork,
|
||||
__print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
|
||||
__print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
|
||||
__entry->offset,
|
||||
__entry->error,
|
||||
|
@ -273,10 +273,10 @@ DECLARE_EVENT_CLASS(xchk_fblock_error_class,
|
|||
__entry->offset = offset;
|
||||
__entry->ret_ip = ret_ip;
|
||||
),
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %d type %s fileoff 0x%llx ret_ip %pS",
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx ret_ip %pS",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->ino,
|
||||
__entry->whichfork,
|
||||
__print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
|
||||
__print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
|
||||
__entry->offset,
|
||||
__entry->ret_ip)
|
||||
|
@ -381,10 +381,10 @@ TRACE_EVENT(xchk_ifork_btree_op_error,
|
|||
__entry->error = error;
|
||||
__entry->ret_ip = ret_ip;
|
||||
),
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x error %d ret_ip %pS",
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %s type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x error %d ret_ip %pS",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->ino,
|
||||
__entry->whichfork,
|
||||
__print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
|
||||
__print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
|
||||
__print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
|
||||
__entry->level,
|
||||
|
@ -460,10 +460,10 @@ TRACE_EVENT(xchk_ifork_btree_error,
|
|||
__entry->ptr = cur->bc_ptrs[level];
|
||||
__entry->ret_ip = ret_ip;
|
||||
),
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x ret_ip %pS",
|
||||
TP_printk("dev %d:%d ino 0x%llx fork %s type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x ret_ip %pS",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->ino,
|
||||
__entry->whichfork,
|
||||
__print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
|
||||
__print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
|
||||
__print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
|
||||
__entry->level,
|
||||
|
|
|
@ -1446,7 +1446,7 @@ DECLARE_EVENT_CLASS(xfs_imap_class,
|
|||
__entry->size,
|
||||
__entry->offset,
|
||||
__entry->count,
|
||||
__entry->whichfork == XFS_COW_FORK ? "cow" : "data",
|
||||
__print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
|
||||
__entry->startoff,
|
||||
(int64_t)__entry->startblock,
|
||||
__entry->blockcount)
|
||||
|
@ -2614,7 +2614,7 @@ DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
|
|||
__entry->agno,
|
||||
__entry->agbno,
|
||||
__entry->ino,
|
||||
__entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
|
||||
__print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
|
||||
__entry->l_loff,
|
||||
__entry->l_len,
|
||||
__entry->l_state)
|
||||
|
@ -3859,7 +3859,7 @@ TRACE_EVENT(xfs_btree_commit_ifakeroot,
|
|||
__print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
|
||||
__entry->agno,
|
||||
__entry->agino,
|
||||
__entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
|
||||
__print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
|
||||
__entry->levels,
|
||||
__entry->blocks)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue