Skip to content

Commit

Permalink
ext4: indicate via a block bitmap read is prefetched via a tracepoint
Browse files Browse the repository at this point in the history
Modify the ext4_read_block_bitmap_load tracepoint so that it tells us
whether a block bitmap is being prefetched.

Signed-off-by: Theodore Ts'o <[email protected]>
Reviewed-by: Artem Blagodarenko <[email protected]>
  • Loading branch information
tytso committed Aug 7, 2020
1 parent 529a781 commit ab74c7b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fs/ext4/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group,
* submit the buffer_head for reading
*/
set_buffer_new(bh);
trace_ext4_read_block_bitmap_load(sb, block_group);
trace_ext4_read_block_bitmap_load(sb, block_group, ignore_locked);
bh->b_end_io = ext4_end_bitmap_read;
get_bh(bh);
submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO |
Expand Down
24 changes: 20 additions & 4 deletions include/trace/events/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1312,18 +1312,34 @@ DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
TP_ARGS(sb, group)
);

DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,

TP_PROTO(struct super_block *sb, unsigned long group),

TP_ARGS(sb, group)
);

DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
TRACE_EVENT(ext4_read_block_bitmap_load,
TP_PROTO(struct super_block *sb, unsigned long group, bool prefetch),

TP_PROTO(struct super_block *sb, unsigned long group),
TP_ARGS(sb, group, prefetch),

TP_ARGS(sb, group)
TP_STRUCT__entry(
__field( dev_t, dev )
__field( __u32, group )
__field( bool, prefetch )

),

TP_fast_assign(
__entry->dev = sb->s_dev;
__entry->group = group;
__entry->prefetch = prefetch;
),

TP_printk("dev %d,%d group %u prefetch %d",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->group, __entry->prefetch)
);

TRACE_EVENT(ext4_direct_IO_enter,
Expand Down

0 comments on commit ab74c7b

Please sign in to comment.