aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2016-03-25 13:25:57 -0400
committerDavid Sterba <dsterba@suse.com>2016-07-07 12:45:53 -0400
commitdce3afa5932776f7b925249fbef435c265014f91 (patch)
tree945c6ebf1ca97d140bd95a16400b484c7d10eebf
parentf376df2b7da3a40f62f861a65efdd8c29fa1b877 (diff)
Btrfs: add fsid to some tracepoints
When tracing enospc problems on a box with multiple file systems mounted I need to be able to differentiate between the two file systems. Most of the important trace points I'm looking at already have an fsid, but the reserved extent trace points do not, so add that to make it possible to figure out which trace point belongs to which file system. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--include/trace/events/btrfs.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 226c7f283247..5b81ef304388 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -873,18 +873,21 @@ DECLARE_EVENT_CLASS(btrfs__reserved_extent,
873 TP_ARGS(root, start, len), 873 TP_ARGS(root, start, len),
874 874
875 TP_STRUCT__entry( 875 TP_STRUCT__entry(
876 __field( u64, root_objectid ) 876 __array( u8, fsid, BTRFS_UUID_SIZE )
877 __field( u64, start ) 877 __field( u64, root_objectid )
878 __field( u64, len ) 878 __field( u64, start )
879 __field( u64, len )
879 ), 880 ),
880 881
881 TP_fast_assign( 882 TP_fast_assign(
883 memcpy(__entry->fsid, root->fs_info->fsid, BTRFS_UUID_SIZE);
882 __entry->root_objectid = root->root_key.objectid; 884 __entry->root_objectid = root->root_key.objectid;
883 __entry->start = start; 885 __entry->start = start;
884 __entry->len = len; 886 __entry->len = len;
885 ), 887 ),
886 888
887 TP_printk("root = %llu(%s), start = %llu, len = %llu", 889 TP_printk("%pU: root = %llu(%s), start = %llu, len = %llu",
890 __entry->fsid,
888 show_root_type(__entry->root_objectid), 891 show_root_type(__entry->root_objectid),
889 (unsigned long long)__entry->start, 892 (unsigned long long)__entry->start,
890 (unsigned long long)__entry->len) 893 (unsigned long long)__entry->len)
@@ -941,6 +944,7 @@ DECLARE_EVENT_CLASS(btrfs__reserve_extent,
941 TP_ARGS(root, block_group, start, len), 944 TP_ARGS(root, block_group, start, len),
942 945
943 TP_STRUCT__entry( 946 TP_STRUCT__entry(
947 __array( u8, fsid, BTRFS_UUID_SIZE )
944 __field( u64, root_objectid ) 948 __field( u64, root_objectid )
945 __field( u64, bg_objectid ) 949 __field( u64, bg_objectid )
946 __field( u64, flags ) 950 __field( u64, flags )
@@ -949,6 +953,7 @@ DECLARE_EVENT_CLASS(btrfs__reserve_extent,
949 ), 953 ),
950 954
951 TP_fast_assign( 955 TP_fast_assign(
956 memcpy(__entry->fsid, root->fs_info->fsid, BTRFS_UUID_SIZE);
952 __entry->root_objectid = root->root_key.objectid; 957 __entry->root_objectid = root->root_key.objectid;
953 __entry->bg_objectid = block_group->key.objectid; 958 __entry->bg_objectid = block_group->key.objectid;
954 __entry->flags = block_group->flags; 959 __entry->flags = block_group->flags;
@@ -956,8 +961,8 @@ DECLARE_EVENT_CLASS(btrfs__reserve_extent,
956 __entry->len = len; 961 __entry->len = len;
957 ), 962 ),
958 963
959 TP_printk("root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), " 964 TP_printk("%pU: root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), "
960 "start = %Lu, len = %Lu", 965 "start = %Lu, len = %Lu", __entry->fsid,
961 show_root_type(__entry->root_objectid), __entry->bg_objectid, 966 show_root_type(__entry->root_objectid), __entry->bg_objectid,
962 __entry->flags, __print_flags((unsigned long)__entry->flags, 967 __entry->flags, __print_flags((unsigned long)__entry->flags,
963 "|", BTRFS_GROUP_FLAGS), 968 "|", BTRFS_GROUP_FLAGS),