Commit f084db93 authored by Li Zefan's avatar Li Zefan Committed by Theodore Ts'o

tracing: Convert more ext4 events to DEFINE_EVENT

Use DECLARE_EVENT_CLASS, and save ~2.7K:

   text    data     bss     dec     hex filename
 274441    7200     260  281901   44d2d fs/ext4/ext4.o.orig
 271881    7040     256  279177   44289 fs/ext4/ext4.o

4 events are converted:

  ext4__mb_new_pa: ext4_mb_new_inode_pa, ext4_mb_new_group_pa
  ext4__mballoc:   ext4_mballoc_discard, ext4_mballoc_free

No change in functionality.
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent f307333e
...@@ -353,7 +353,7 @@ TRACE_EVENT(ext4_discard_blocks, ...@@ -353,7 +353,7 @@ TRACE_EVENT(ext4_discard_blocks,
jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count)
); );
TRACE_EVENT(ext4_mb_new_inode_pa, DECLARE_EVENT_CLASS(ext4__mb_new_pa,
TP_PROTO(struct ext4_allocation_context *ac, TP_PROTO(struct ext4_allocation_context *ac,
struct ext4_prealloc_space *pa), struct ext4_prealloc_space *pa),
...@@ -381,32 +381,20 @@ TRACE_EVENT(ext4_mb_new_inode_pa, ...@@ -381,32 +381,20 @@ TRACE_EVENT(ext4_mb_new_inode_pa,
__entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
); );
TRACE_EVENT(ext4_mb_new_group_pa, DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
TP_PROTO(struct ext4_allocation_context *ac, TP_PROTO(struct ext4_allocation_context *ac,
struct ext4_prealloc_space *pa), struct ext4_prealloc_space *pa),
TP_ARGS(ac, pa), TP_ARGS(ac, pa)
);
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
__field( __u64, pa_pstart )
__field( __u32, pa_len )
__field( __u64, pa_lstart )
), DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
TP_fast_assign( TP_PROTO(struct ext4_allocation_context *ac,
__entry->dev = ac->ac_sb->s_dev; struct ext4_prealloc_space *pa),
__entry->ino = ac->ac_inode->i_ino;
__entry->pa_pstart = pa->pa_pstart;
__entry->pa_len = pa->pa_len;
__entry->pa_lstart = pa->pa_lstart;
),
TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", TP_ARGS(ac, pa)
jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
__entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
); );
TRACE_EVENT(ext4_mb_release_inode_pa, TRACE_EVENT(ext4_mb_release_inode_pa,
...@@ -790,7 +778,7 @@ TRACE_EVENT(ext4_mballoc_prealloc, ...@@ -790,7 +778,7 @@ TRACE_EVENT(ext4_mballoc_prealloc,
__entry->result_len, __entry->result_logical) __entry->result_len, __entry->result_logical)
); );
TRACE_EVENT(ext4_mballoc_discard, DECLARE_EVENT_CLASS(ext4__mballoc,
TP_PROTO(struct ext4_allocation_context *ac), TP_PROTO(struct ext4_allocation_context *ac),
TP_ARGS(ac), TP_ARGS(ac),
...@@ -819,33 +807,18 @@ TRACE_EVENT(ext4_mballoc_discard, ...@@ -819,33 +807,18 @@ TRACE_EVENT(ext4_mballoc_discard,
__entry->result_len, __entry->result_logical) __entry->result_len, __entry->result_logical)
); );
TRACE_EVENT(ext4_mballoc_free, DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
TP_PROTO(struct ext4_allocation_context *ac), TP_PROTO(struct ext4_allocation_context *ac),
TP_ARGS(ac), TP_ARGS(ac)
);
TP_STRUCT__entry( DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
__field( dev_t, dev )
__field( ino_t, ino )
__field( __u32, result_logical )
__field( int, result_start )
__field( __u32, result_group )
__field( int, result_len )
),
TP_fast_assign( TP_PROTO(struct ext4_allocation_context *ac),
__entry->dev = ac->ac_inode->i_sb->s_dev;
__entry->ino = ac->ac_inode->i_ino;
__entry->result_logical = ac->ac_b_ex.fe_logical;
__entry->result_start = ac->ac_b_ex.fe_start;
__entry->result_group = ac->ac_b_ex.fe_group;
__entry->result_len = ac->ac_b_ex.fe_len;
),
TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", TP_ARGS(ac)
jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
__entry->result_group, __entry->result_start,
__entry->result_len, __entry->result_logical)
); );
TRACE_EVENT(ext4_forget, TRACE_EVENT(ext4_forget,
......
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