Commit 2e63e62d authored by David Sterba's avatar David Sterba

btrfs: tracepoints, use extended format with UUID where possible

Most of the strings are prefixed by the UUID of the filesystem that
generates the message, however there are a few events that still
opencode the macro magic and can be converted to the common macros.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 79bcb71a
...@@ -666,8 +666,7 @@ TRACE_EVENT(btrfs_add_block_group, ...@@ -666,8 +666,7 @@ TRACE_EVENT(btrfs_add_block_group,
TP_ARGS(fs_info, block_group, create), TP_ARGS(fs_info, block_group, create),
TP_STRUCT__entry( TP_STRUCT__entry_btrfs(
__array( u8, fsid, BTRFS_FSID_SIZE )
__field( u64, offset ) __field( u64, offset )
__field( u64, size ) __field( u64, size )
__field( u64, flags ) __field( u64, flags )
...@@ -676,8 +675,7 @@ TRACE_EVENT(btrfs_add_block_group, ...@@ -676,8 +675,7 @@ TRACE_EVENT(btrfs_add_block_group,
__field( int, create ) __field( int, create )
), ),
TP_fast_assign( TP_fast_assign_btrfs(fs_info,
memcpy(__entry->fsid, fs_info->fsid, BTRFS_FSID_SIZE);
__entry->offset = block_group->key.objectid; __entry->offset = block_group->key.objectid;
__entry->size = block_group->key.offset; __entry->size = block_group->key.offset;
__entry->flags = block_group->flags; __entry->flags = block_group->flags;
...@@ -687,9 +685,9 @@ TRACE_EVENT(btrfs_add_block_group, ...@@ -687,9 +685,9 @@ TRACE_EVENT(btrfs_add_block_group,
__entry->create = create; __entry->create = create;
), ),
TP_printk("%pU: block_group offset=%llu size=%llu " TP_printk_btrfs("block_group offset=%llu size=%llu "
"flags=%llu(%s) bytes_used=%llu bytes_super=%llu " "flags=%llu(%s) bytes_used=%llu bytes_super=%llu "
"create=%d", __entry->fsid, "create=%d",
__entry->offset, __entry->offset,
__entry->size, __entry->size,
__entry->flags, __entry->flags,
...@@ -1020,24 +1018,22 @@ TRACE_EVENT(btrfs_trigger_flush, ...@@ -1020,24 +1018,22 @@ TRACE_EVENT(btrfs_trigger_flush,
TP_ARGS(fs_info, flags, bytes, flush, reason), TP_ARGS(fs_info, flags, bytes, flush, reason),
TP_STRUCT__entry( TP_STRUCT__entry_btrfs(
__array( u8, fsid, BTRFS_FSID_SIZE )
__field( u64, flags ) __field( u64, flags )
__field( u64, bytes ) __field( u64, bytes )
__field( int, flush ) __field( int, flush )
__string( reason, reason ) __string( reason, reason )
), ),
TP_fast_assign( TP_fast_assign_btrfs(fs_info,
memcpy(__entry->fsid, fs_info->fsid, BTRFS_FSID_SIZE);
__entry->flags = flags; __entry->flags = flags;
__entry->bytes = bytes; __entry->bytes = bytes;
__entry->flush = flush; __entry->flush = flush;
__assign_str(reason, reason) __assign_str(reason, reason)
), ),
TP_printk("%pU: %s: flush=%d(%s) flags=%llu(%s) bytes=%llu", TP_printk_btrfs("%s: flush=%d(%s) flags=%llu(%s) bytes=%llu",
__entry->fsid, __get_str(reason), __entry->flush, __get_str(reason), __entry->flush,
show_flush_action(__entry->flush), show_flush_action(__entry->flush),
__entry->flags, __entry->flags,
__print_flags((unsigned long)__entry->flags, "|", __print_flags((unsigned long)__entry->flags, "|",
...@@ -1061,24 +1057,22 @@ TRACE_EVENT(btrfs_flush_space, ...@@ -1061,24 +1057,22 @@ TRACE_EVENT(btrfs_flush_space,
TP_ARGS(fs_info, flags, num_bytes, state, ret), TP_ARGS(fs_info, flags, num_bytes, state, ret),
TP_STRUCT__entry( TP_STRUCT__entry_btrfs(
__array( u8, fsid, BTRFS_FSID_SIZE )
__field( u64, flags ) __field( u64, flags )
__field( u64, num_bytes ) __field( u64, num_bytes )
__field( int, state ) __field( int, state )
__field( int, ret ) __field( int, ret )
), ),
TP_fast_assign( TP_fast_assign_btrfs(fs_info,
memcpy(__entry->fsid, fs_info->fsid, BTRFS_FSID_SIZE);
__entry->flags = flags; __entry->flags = flags;
__entry->num_bytes = num_bytes; __entry->num_bytes = num_bytes;
__entry->state = state; __entry->state = state;
__entry->ret = ret; __entry->ret = ret;
), ),
TP_printk("%pU: state=%d(%s) flags=%llu(%s) num_bytes=%llu ret=%d", TP_printk_btrfs("state=%d(%s) flags=%llu(%s) num_bytes=%llu ret=%d",
__entry->fsid, __entry->state, __entry->state,
show_flush_state(__entry->state), show_flush_state(__entry->state),
__entry->flags, __entry->flags,
__print_flags((unsigned long)__entry->flags, "|", __print_flags((unsigned long)__entry->flags, "|",
......
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