Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78566548 authored by Liu Bo's avatar Liu Bo Committed by David Sterba
Browse files

Btrfs: add truncated_len for ordered extent tracepoints



This can help us monitor truncated ordered extents.

Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 92a1bf76
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -263,6 +263,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent,
		__field(	int,  compress_type	)
		__field(	int,  compress_type	)
		__field(	int,  refs		)
		__field(	int,  refs		)
		__field(	u64,  root_objectid	)
		__field(	u64,  root_objectid	)
		__field(	u64,  truncated_len	)
	),
	),


	TP_fast_assign_btrfs(btrfs_sb(inode->i_sb),
	TP_fast_assign_btrfs(btrfs_sb(inode->i_sb),
@@ -277,10 +278,12 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent,
		__entry->refs		= atomic_read(&ordered->refs);
		__entry->refs		= atomic_read(&ordered->refs);
		__entry->root_objectid	=
		__entry->root_objectid	=
				BTRFS_I(inode)->root->root_key.objectid;
				BTRFS_I(inode)->root->root_key.objectid;
		__entry->truncated_len	= ordered->truncated_len;
	),
	),


	TP_printk_btrfs("root = %llu(%s), ino = %llu, file_offset = %llu, "
	TP_printk_btrfs("root = %llu(%s), ino = %llu, file_offset = %llu, "
		  "start = %llu, len = %llu, disk_len = %llu, "
		  "start = %llu, len = %llu, disk_len = %llu, "
		  "truncated_len = %llu, "
		  "bytes_left = %llu, flags = %s, compress_type = %d, "
		  "bytes_left = %llu, flags = %s, compress_type = %d, "
		  "refs = %d",
		  "refs = %d",
		  show_root_type(__entry->root_objectid),
		  show_root_type(__entry->root_objectid),
@@ -289,6 +292,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent,
		  (unsigned long long)__entry->start,
		  (unsigned long long)__entry->start,
		  (unsigned long long)__entry->len,
		  (unsigned long long)__entry->len,
		  (unsigned long long)__entry->disk_len,
		  (unsigned long long)__entry->disk_len,
		  (unsigned long long)__entry->truncated_len,
		  (unsigned long long)__entry->bytes_left,
		  (unsigned long long)__entry->bytes_left,
		  show_ordered_flags(__entry->flags),
		  show_ordered_flags(__entry->flags),
		  __entry->compress_type, __entry->refs)
		  __entry->compress_type, __entry->refs)