Commit 92a1bf76 authored by Liu Bo's avatar Liu Bo Committed by David Sterba

Btrfs: add 'inode' for extent map tracepoint

'inode' is an important field for btrfs_get_extent, lets trace it.
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 ac0c7cf8
...@@ -7059,7 +7059,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, ...@@ -7059,7 +7059,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
write_unlock(&em_tree->lock); write_unlock(&em_tree->lock);
out: out:
trace_btrfs_get_extent(root, em); trace_btrfs_get_extent(root, inode, em);
btrfs_free_path(path); btrfs_free_path(path);
if (trans) { if (trans) {
......
...@@ -184,14 +184,16 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, ...@@ -184,14 +184,16 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict,
TRACE_EVENT_CONDITION(btrfs_get_extent, TRACE_EVENT_CONDITION(btrfs_get_extent,
TP_PROTO(struct btrfs_root *root, struct extent_map *map), TP_PROTO(struct btrfs_root *root, struct inode *inode,
struct extent_map *map),
TP_ARGS(root, map), TP_ARGS(root, inode, map),
TP_CONDITION(map), TP_CONDITION(map),
TP_STRUCT__entry_btrfs( TP_STRUCT__entry_btrfs(
__field( u64, root_objectid ) __field( u64, root_objectid )
__field( u64, ino )
__field( u64, start ) __field( u64, start )
__field( u64, len ) __field( u64, len )
__field( u64, orig_start ) __field( u64, orig_start )
...@@ -204,7 +206,8 @@ TRACE_EVENT_CONDITION(btrfs_get_extent, ...@@ -204,7 +206,8 @@ TRACE_EVENT_CONDITION(btrfs_get_extent,
TP_fast_assign_btrfs(root->fs_info, TP_fast_assign_btrfs(root->fs_info,
__entry->root_objectid = root->root_key.objectid; __entry->root_objectid = root->root_key.objectid;
__entry->start = map->start; __entry->ino = btrfs_ino(inode);
__entry->start = map->start;
__entry->len = map->len; __entry->len = map->len;
__entry->orig_start = map->orig_start; __entry->orig_start = map->orig_start;
__entry->block_start = map->block_start; __entry->block_start = map->block_start;
...@@ -214,11 +217,12 @@ TRACE_EVENT_CONDITION(btrfs_get_extent, ...@@ -214,11 +217,12 @@ TRACE_EVENT_CONDITION(btrfs_get_extent,
__entry->compress_type = map->compress_type; __entry->compress_type = map->compress_type;
), ),
TP_printk_btrfs("root = %llu(%s), start = %llu, len = %llu, " TP_printk_btrfs("root = %llu(%s), ino = %llu start = %llu, len = %llu, "
"orig_start = %llu, block_start = %llu(%s), " "orig_start = %llu, block_start = %llu(%s), "
"block_len = %llu, flags = %s, refs = %u, " "block_len = %llu, flags = %s, refs = %u, "
"compress_type = %u", "compress_type = %u",
show_root_type(__entry->root_objectid), show_root_type(__entry->root_objectid),
(unsigned long long)__entry->ino,
(unsigned long long)__entry->start, (unsigned long long)__entry->start,
(unsigned long long)__entry->len, (unsigned long long)__entry->len,
(unsigned long long)__entry->orig_start, (unsigned long long)__entry->orig_start,
......
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