Most hardware architectures require that data (including struct fields)
have to be aligned in memory. To make it happen compiler inserts padding
between struct fields if they are not aligned correctly.
Reorder fields to remove paddings and make structures denser. Making data
smaller saves some memory that is very important for trace events.
Tracing buffer has limited size and making objects smaller we can put more
of them without overflowing the tracing buffer.
To find data struct holes I used 'pahole -H 1 -E -I vmlinux.o' from
'dwarves' package.
Signed-off-by: Anatol Pomozov <[email protected]>
---
include/trace/events/ext4.h | 240 ++++++++++++++++++++++----------------------
1 file changed, 120 insertions(+), 120 deletions(-)
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 69d8a69..db67c71 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -26,19 +26,19 @@ TRACE_EVENT(ext4_free_inode,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( __u16, mode )
__field( uid_t, uid )
__field( gid_t, gid )
__field( __u64, blocks )
+ __field( __u16, mode )
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->mode = inode->i_mode;
__entry->uid = i_uid_read(inode);
__entry->gid = i_gid_read(inode);
__entry->blocks = inode->i_blocks;
+ __entry->mode = inode->i_mode;
),
TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
@@ -300,10 +300,10 @@ TRACE_EVENT(ext4_da_writepages,
__field( long, pages_skipped )
__field( loff_t, range_start )
__field( loff_t, range_end )
+ __field( pgoff_t, writeback_index )
__field( int, sync_mode )
__field( char, for_kupdate )
__field( char, range_cyclic )
- __field( pgoff_t, writeback_index )
),
TP_fast_assign(
@@ -313,10 +313,10 @@ TRACE_EVENT(ext4_da_writepages,
__entry->pages_skipped = wbc->pages_skipped;
__entry->range_start = wbc->range_start;
__entry->range_end = wbc->range_end;
+ __entry->writeback_index = inode->i_mapping->writeback_index;
__entry->sync_mode = wbc->sync_mode;
__entry->for_kupdate = wbc->for_kupdate;
__entry->range_cyclic = wbc->range_cyclic;
- __entry->writeback_index = inode->i_mapping->writeback_index;
),
TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
@@ -382,8 +382,8 @@ TRACE_EVENT(ext4_da_writepages_result,
__field( int, ret )
__field( int, pages_written )
__field( long, pages_skipped )
- __field( int, sync_mode )
__field( pgoff_t, writeback_index )
+ __field( int, sync_mode )
),
TP_fast_assign(
@@ -392,8 +392,8 @@ TRACE_EVENT(ext4_da_writepages_result,
__entry->ret = ret;
__entry->pages_written = pages_written;
__entry->pages_skipped = wbc->pages_skipped;
- __entry->sync_mode = wbc->sync_mode;
__entry->writeback_index = inode->i_mapping->writeback_index;
+ __entry->sync_mode = wbc->sync_mode;
),
TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
@@ -411,16 +411,16 @@ DECLARE_EVENT_CLASS(ext4__page_op,
TP_ARGS(page),
TP_STRUCT__entry(
- __field( pgoff_t, index )
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
+ __field( pgoff_t, index )
),
TP_fast_assign(
- __entry->index = page->index;
- __entry->ino = page->mapping->host->i_ino;
__entry->dev = page->mapping->host->i_sb->s_dev;
+ __entry->ino = page->mapping->host->i_ino;
+ __entry->index = page->index;
),
TP_printk("dev %d,%d ino %lu page_index %lu",
@@ -456,18 +456,18 @@ TRACE_EVENT(ext4_invalidatepage,
TP_ARGS(page, offset),
TP_STRUCT__entry(
+ __field( dev_t, dev )
+ __field( ino_t, ino )
__field( pgoff_t, index )
__field( unsigned long, offset )
- __field( ino_t, ino )
- __field( dev_t, dev )
),
TP_fast_assign(
+ __entry->dev = page->mapping->host->i_sb->s_dev;
+ __entry->ino = page->mapping->host->i_ino;
__entry->index = page->index;
__entry->offset = offset;
- __entry->ino = page->mapping->host->i_ino;
- __entry->dev = page->mapping->host->i_sb->s_dev;
),
TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
@@ -510,8 +510,8 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
__field( dev_t, dev )
__field( ino_t, ino )
__field( __u64, pa_pstart )
- __field( __u32, pa_len )
__field( __u64, pa_lstart )
+ __field( __u32, pa_len )
),
@@ -519,8 +519,8 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
__entry->dev = ac->ac_sb->s_dev;
__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;
+ __entry->pa_len = pa->pa_len;
),
TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
@@ -645,7 +645,6 @@ TRACE_EVENT(ext4_request_blocks,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( unsigned int, flags )
__field( unsigned int, len )
__field( __u32, logical )
__field( __u32, lleft )
@@ -653,12 +652,12 @@ TRACE_EVENT(ext4_request_blocks,
__field( __u64, goal )
__field( __u64, pleft )
__field( __u64, pright )
+ __field( unsigned int, flags )
),
TP_fast_assign(
__entry->dev = ar->inode->i_sb->s_dev;
__entry->ino = ar->inode->i_ino;
- __entry->flags = ar->flags;
__entry->len = ar->len;
__entry->logical = ar->logical;
__entry->goal = ar->goal;
@@ -666,6 +665,7 @@ TRACE_EVENT(ext4_request_blocks,
__entry->lright = ar->lright;
__entry->pleft = ar->pleft;
__entry->pright = ar->pright;
+ __entry->flags = ar->flags;
),
TP_printk("dev %d,%d ino %lu flags %u len %u lblk %u goal %llu "
@@ -686,7 +686,6 @@ TRACE_EVENT(ext4_allocate_blocks,
__field( dev_t, dev )
__field( ino_t, ino )
__field( __u64, block )
- __field( unsigned int, flags )
__field( unsigned int, len )
__field( __u32, logical )
__field( __u32, lleft )
@@ -694,13 +693,13 @@ TRACE_EVENT(ext4_allocate_blocks,
__field( __u64, goal )
__field( __u64, pleft )
__field( __u64, pright )
+ __field( unsigned int, flags )
),
TP_fast_assign(
__entry->dev = ar->inode->i_sb->s_dev;
__entry->ino = ar->inode->i_ino;
__entry->block = block;
- __entry->flags = ar->flags;
__entry->len = ar->len;
__entry->logical = ar->logical;
__entry->goal = ar->goal;
@@ -708,6 +707,7 @@ TRACE_EVENT(ext4_allocate_blocks,
__entry->lright = ar->lright;
__entry->pleft = ar->pleft;
__entry->pright = ar->pright;
+ __entry->flags = ar->flags;
),
TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %u "
@@ -728,19 +728,19 @@ TRACE_EVENT(ext4_free_blocks,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( __u16, mode )
__field( __u64, block )
__field( unsigned long, count )
__field( int, flags )
+ __field( __u16, mode )
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->mode = inode->i_mode;
__entry->block = block;
__entry->count = count;
__entry->flags = flags;
+ __entry->mode = inode->i_mode;
),
TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
@@ -783,15 +783,15 @@ TRACE_EVENT(ext4_sync_file_exit,
TP_ARGS(inode, ret),
TP_STRUCT__entry(
- __field( int, ret )
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
+ __field( int, ret )
),
TP_fast_assign(
- __entry->ret = ret;
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
+ __entry->ret = ret;
),
TP_printk("dev %d,%d ino %lu ret %d",
@@ -854,12 +854,6 @@ TRACE_EVENT(ext4_mballoc_alloc,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( __u16, found )
- __field( __u16, groups )
- __field( __u16, buddy )
- __field( __u16, flags )
- __field( __u16, tail )
- __field( __u8, cr )
__field( __u32, orig_logical )
__field( int, orig_start )
__field( __u32, orig_group )
@@ -872,17 +866,17 @@ TRACE_EVENT(ext4_mballoc_alloc,
__field( int, result_start )
__field( __u32, result_group )
__field( int, result_len )
+ __field( __u16, found )
+ __field( __u16, groups )
+ __field( __u16, buddy )
+ __field( __u16, flags )
+ __field( __u16, tail )
+ __field( __u8, cr )
),
TP_fast_assign(
__entry->dev = ac->ac_inode->i_sb->s_dev;
__entry->ino = ac->ac_inode->i_ino;
- __entry->found = ac->ac_found;
- __entry->flags = ac->ac_flags;
- __entry->groups = ac->ac_groups_scanned;
- __entry->buddy = ac->ac_buddy;
- __entry->tail = ac->ac_tail;
- __entry->cr = ac->ac_criteria;
__entry->orig_logical = ac->ac_o_ex.fe_logical;
__entry->orig_start = ac->ac_o_ex.fe_start;
__entry->orig_group = ac->ac_o_ex.fe_group;
@@ -895,6 +889,12 @@ TRACE_EVENT(ext4_mballoc_alloc,
__entry->result_start = ac->ac_f_ex.fe_start;
__entry->result_group = ac->ac_f_ex.fe_group;
__entry->result_len = ac->ac_f_ex.fe_len;
+ __entry->found = ac->ac_found;
+ __entry->flags = ac->ac_flags;
+ __entry->groups = ac->ac_groups_scanned;
+ __entry->buddy = ac->ac_buddy;
+ __entry->tail = ac->ac_tail;
+ __entry->cr = ac->ac_criteria;
),
TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
@@ -1015,17 +1015,17 @@ TRACE_EVENT(ext4_forget,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( __u16, mode )
- __field( int, is_metadata )
__field( __u64, block )
+ __field( int, is_metadata )
+ __field( __u16, mode )
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->mode = inode->i_mode;
- __entry->is_metadata = is_metadata;
__entry->block = block;
+ __entry->is_metadata = is_metadata;
+ __entry->mode = inode->i_mode;
),
TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
@@ -1042,19 +1042,18 @@ TRACE_EVENT(ext4_da_update_reserve_space,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( __u16, mode )
__field( __u64, i_blocks )
__field( int, used_blocks )
__field( int, reserved_data_blocks )
__field( int, reserved_meta_blocks )
__field( int, allocated_meta_blocks )
__field( int, quota_claim )
+ __field( __u16, mode )
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->mode = inode->i_mode;
__entry->i_blocks = inode->i_blocks;
__entry->used_blocks = used_blocks;
__entry->reserved_data_blocks =
@@ -1064,6 +1063,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
__entry->allocated_meta_blocks =
EXT4_I(inode)->i_allocated_meta_blocks;
__entry->quota_claim = quota_claim;
+ __entry->mode = inode->i_mode;
),
TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
@@ -1085,21 +1085,21 @@ TRACE_EVENT(ext4_da_reserve_space,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( __u16, mode )
__field( __u64, i_blocks )
__field( int, md_needed )
__field( int, reserved_data_blocks )
__field( int, reserved_meta_blocks )
+ __field( __u16, mode )
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->mode = inode->i_mode;
__entry->i_blocks = inode->i_blocks;
__entry->md_needed = md_needed;
__entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
__entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
+ __entry->mode = inode->i_mode;
),
TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
@@ -1119,23 +1119,23 @@ TRACE_EVENT(ext4_da_release_space,
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
- __field( __u16, mode )
__field( __u64, i_blocks )
__field( int, freed_blocks )
__field( int, reserved_data_blocks )
__field( int, reserved_meta_blocks )
__field( int, allocated_meta_blocks )
+ __field( __u16, mode )
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->mode = inode->i_mode;
__entry->i_blocks = inode->i_blocks;
__entry->freed_blocks = freed_blocks;
__entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
__entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
__entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
+ __entry->mode = inode->i_mode;
),
TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
@@ -1203,16 +1203,16 @@ TRACE_EVENT(ext4_direct_IO_enter,
TP_ARGS(inode, offset, len, rw),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( loff_t, pos )
__field( unsigned long, len )
__field( int, rw )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->pos = offset;
__entry->len = len;
__entry->rw = rw;
@@ -1231,8 +1231,8 @@ TRACE_EVENT(ext4_direct_IO_exit,
TP_ARGS(inode, offset, len, rw, ret),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( loff_t, pos )
__field( unsigned long, len )
__field( int, rw )
@@ -1240,8 +1240,8 @@ TRACE_EVENT(ext4_direct_IO_exit,
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->pos = offset;
__entry->len = len;
__entry->rw = rw;
@@ -1261,16 +1261,16 @@ TRACE_EVENT(ext4_fallocate_enter,
TP_ARGS(inode, offset, len, mode),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( loff_t, pos )
__field( loff_t, len )
__field( int, mode )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->pos = offset;
__entry->len = len;
__entry->mode = mode;
@@ -1289,16 +1289,16 @@ TRACE_EVENT(ext4_fallocate_exit,
TP_ARGS(inode, offset, max_blocks, ret),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( loff_t, pos )
__field( unsigned int, blocks )
__field( int, ret )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->pos = offset;
__entry->blocks = max_blocks;
__entry->ret = ret;
@@ -1317,17 +1317,17 @@ TRACE_EVENT(ext4_unlink_enter,
TP_ARGS(parent, dentry),
TP_STRUCT__entry(
- __field( ino_t, parent )
+ __field( dev_t, dev )
__field( ino_t, ino )
+ __field( ino_t, parent )
__field( loff_t, size )
- __field( dev_t, dev )
),
TP_fast_assign(
- __entry->parent = parent->i_ino;
+ __entry->dev = dentry->d_inode->i_sb->s_dev;
__entry->ino = dentry->d_inode->i_ino;
+ __entry->parent = parent->i_ino;
__entry->size = dentry->d_inode->i_size;
- __entry->dev = dentry->d_inode->i_sb->s_dev;
),
TP_printk("dev %d,%d ino %lu size %lld parent %lu",
@@ -1342,14 +1342,14 @@ TRACE_EVENT(ext4_unlink_exit,
TP_ARGS(dentry, ret),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( int, ret )
),
TP_fast_assign(
- __entry->ino = dentry->d_inode->i_ino;
__entry->dev = dentry->d_inode->i_sb->s_dev;
+ __entry->ino = dentry->d_inode->i_ino;
__entry->ret = ret;
),
@@ -1365,14 +1365,14 @@ DECLARE_EVENT_CLASS(ext4__truncate,
TP_ARGS(inode),
TP_STRUCT__entry(
- __field( ino_t, ino )
- __field( dev_t, dev )
+ __field( dev_t, dev )
+ __field( ino_t, ino )
__field( __u64, blocks )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->blocks = inode->i_blocks;
),
@@ -1403,8 +1403,8 @@ TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
TP_ARGS(inode, map, ux),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, m_lblk )
__field( unsigned, m_len )
__field( ext4_lblk_t, u_lblk )
@@ -1413,8 +1413,8 @@ TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->m_lblk = map->m_lblk;
__entry->m_len = map->m_len;
__entry->u_lblk = le32_to_cpu(ux->ee_block);
@@ -1441,8 +1441,8 @@ TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
TP_ARGS(inode, map, ux, ix),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, m_lblk )
__field( unsigned, m_len )
__field( ext4_lblk_t, u_lblk )
@@ -1454,8 +1454,8 @@ TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->m_lblk = map->m_lblk;
__entry->m_len = map->m_len;
__entry->u_lblk = le32_to_cpu(ux->ee_block);
@@ -1483,16 +1483,16 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
TP_ARGS(inode, lblk, len, flags),
TP_STRUCT__entry(
- __field( ino_t, ino )
- __field( dev_t, dev )
+ __field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, lblk )
__field( unsigned int, len )
__field( unsigned int, flags )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->lblk = lblk;
__entry->len = len;
__entry->flags = flags;
@@ -1525,19 +1525,19 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
TP_ARGS(inode, lblk, pblk, len, ret),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
- __field( ext4_lblk_t, lblk )
+ __field( ino_t, ino )
__field( ext4_fsblk_t, pblk )
+ __field( ext4_lblk_t, lblk )
__field( unsigned int, len )
__field( int, ret )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
- __entry->lblk = lblk;
+ __entry->ino = inode->i_ino;
__entry->pblk = pblk;
+ __entry->lblk = lblk;
__entry->len = len;
__entry->ret = ret;
),
@@ -1569,17 +1569,17 @@ TRACE_EVENT(ext4_ext_load_extent,
TP_ARGS(inode, lblk, pblk),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
- __field( ext4_lblk_t, lblk )
+ __field( ino_t, ino )
__field( ext4_fsblk_t, pblk )
+ __field( ext4_lblk_t, lblk )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
- __entry->lblk = lblk;
+ __entry->ino = inode->i_ino;
__entry->pblk = pblk;
+ __entry->lblk = lblk;
),
TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
@@ -1594,13 +1594,13 @@ TRACE_EVENT(ext4_load_inode,
TP_ARGS(inode),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
),
TP_printk("dev %d,%d ino %ld",
@@ -1615,14 +1615,14 @@ TRACE_EVENT(ext4_journal_start,
TP_STRUCT__entry(
__field( dev_t, dev )
- __field( int, nblocks )
__field(unsigned long, ip )
+ __field( int, nblocks )
),
TP_fast_assign(
__entry->dev = sb->s_dev;
- __entry->nblocks = nblocks;
__entry->ip = IP;
+ __entry->nblocks = nblocks;
),
TP_printk("dev %d,%d nblocks %d caller %pF",
@@ -1686,23 +1686,23 @@ TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
TP_ARGS(inode, map, allocated, newblock),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
+ __field( int, flags )
__field( ext4_lblk_t, lblk )
__field( ext4_fsblk_t, pblk )
__field( unsigned int, len )
- __field( int, flags )
__field( unsigned int, allocated )
__field( ext4_fsblk_t, newblk )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
+ __entry->flags = map->m_flags;
__entry->lblk = map->m_lblk;
__entry->pblk = map->m_pblk;
__entry->len = map->m_len;
- __entry->flags = map->m_flags;
__entry->allocated = allocated;
__entry->newblk = newblock;
),
@@ -1724,19 +1724,19 @@ TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
TP_STRUCT__entry(
__field( dev_t, dev )
+ __field( unsigned int, flags )
__field( ext4_lblk_t, lblk )
__field( ext4_fsblk_t, pblk )
__field( unsigned int, len )
- __field( unsigned int, flags )
__field( int, ret )
),
TP_fast_assign(
__entry->dev = sb->s_dev;
+ __entry->flags = map->m_flags;
__entry->lblk = map->m_lblk;
__entry->pblk = map->m_pblk;
__entry->len = map->m_len;
- __entry->flags = map->m_flags;
__entry->ret = ret;
),
@@ -1753,16 +1753,16 @@ TRACE_EVENT(ext4_ext_put_in_cache,
TP_ARGS(inode, lblk, len, start),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, lblk )
__field( unsigned int, len )
__field( ext4_fsblk_t, start )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->lblk = lblk;
__entry->len = len;
__entry->start = start;
@@ -1782,15 +1782,15 @@ TRACE_EVENT(ext4_ext_in_cache,
TP_ARGS(inode, lblk, ret),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, lblk )
__field( int, ret )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->lblk = lblk;
__entry->ret = ret;
),
@@ -1810,8 +1810,8 @@ TRACE_EVENT(ext4_find_delalloc_range,
TP_ARGS(inode, from, to, reverse, found, found_blk),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, from )
__field( ext4_lblk_t, to )
__field( int, reverse )
@@ -1820,8 +1820,8 @@ TRACE_EVENT(ext4_find_delalloc_range,
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->from = from;
__entry->to = to;
__entry->reverse = reverse;
@@ -1844,15 +1844,15 @@ TRACE_EVENT(ext4_get_reserved_cluster_alloc,
TP_ARGS(inode, lblk, len),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, lblk )
__field( unsigned int, len )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->lblk = lblk;
__entry->len = len;
),
@@ -1871,18 +1871,18 @@ TRACE_EVENT(ext4_ext_show_extent,
TP_ARGS(inode, lblk, pblk, len),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
- __field( ext4_lblk_t, lblk )
+ __field( ino_t, ino )
__field( ext4_fsblk_t, pblk )
+ __field( ext4_lblk_t, lblk )
__field( unsigned short, len )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
- __entry->lblk = lblk;
+ __entry->ino = inode->i_ino;
__entry->pblk = pblk;
+ __entry->lblk = lblk;
__entry->len = len;
),
@@ -1902,25 +1902,25 @@ TRACE_EVENT(ext4_remove_blocks,
TP_ARGS(inode, ex, from, to, partial_cluster),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
- __field( ext4_lblk_t, ee_lblk )
- __field( ext4_fsblk_t, ee_pblk )
- __field( unsigned short, ee_len )
+ __field( ino_t, ino )
__field( ext4_lblk_t, from )
__field( ext4_lblk_t, to )
__field( ext4_fsblk_t, partial )
+ __field( ext4_fsblk_t, ee_pblk )
+ __field( ext4_lblk_t, ee_lblk )
+ __field( unsigned short, ee_len )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
- __entry->ee_lblk = cpu_to_le32(ex->ee_block);
- __entry->ee_pblk = ext4_ext_pblock(ex);
- __entry->ee_len = ext4_ext_get_actual_len(ex);
+ __entry->ino = inode->i_ino;
__entry->from = from;
__entry->to = to;
__entry->partial = partial_cluster;
+ __entry->ee_pblk = ext4_ext_pblock(ex);
+ __entry->ee_lblk = cpu_to_le32(ex->ee_block);
+ __entry->ee_len = ext4_ext_get_actual_len(ex);
),
TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
@@ -1942,23 +1942,23 @@ TRACE_EVENT(ext4_ext_rm_leaf,
TP_ARGS(inode, start, ex, partial_cluster),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
+ __field( ext4_fsblk_t, partial )
__field( ext4_lblk_t, start )
__field( ext4_lblk_t, ee_lblk )
__field( ext4_fsblk_t, ee_pblk )
__field( short, ee_len )
- __field( ext4_fsblk_t, partial )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
+ __entry->partial = partial_cluster;
__entry->start = start;
__entry->ee_lblk = le32_to_cpu(ex->ee_block);
__entry->ee_pblk = ext4_ext_pblock(ex);
__entry->ee_len = ext4_ext_get_actual_len(ex);
- __entry->partial = partial_cluster;
),
TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
@@ -1978,14 +1978,14 @@ TRACE_EVENT(ext4_ext_rm_idx,
TP_ARGS(inode, pblk),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_fsblk_t, pblk )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->pblk = pblk;
),
@@ -2001,15 +2001,15 @@ TRACE_EVENT(ext4_ext_remove_space,
TP_ARGS(inode, start, depth),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, start )
__field( int, depth )
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->start = start;
__entry->depth = depth;
),
@@ -2028,8 +2028,8 @@ TRACE_EVENT(ext4_ext_remove_space_done,
TP_ARGS(inode, start, depth, partial, eh_entries),
TP_STRUCT__entry(
- __field( ino_t, ino )
__field( dev_t, dev )
+ __field( ino_t, ino )
__field( ext4_lblk_t, start )
__field( int, depth )
__field( ext4_lblk_t, partial )
@@ -2037,8 +2037,8 @@ TRACE_EVENT(ext4_ext_remove_space_done,
),
TP_fast_assign(
- __entry->ino = inode->i_ino;
__entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
__entry->start = start;
__entry->depth = depth;
__entry->partial = partial;
--
1.7.11.2
Signed-off-by: Anatol Pomozov <[email protected]>
---
include/trace/events/ext4.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index db67c71..d49b285 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -320,7 +320,7 @@ TRACE_EVENT(ext4_da_writepages,
),
TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
- "range_start %lld range_end %lld sync_mode %d"
+ "range_start %lld range_end %lld sync_mode %d "
"for_kupdate %d range_cyclic %d writeback_index %lu",
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long) __entry->ino, __entry->nr_to_write,
--
1.7.11.2
On Wed, Jul 18, 2012 at 10:07:33AM -0700, Anatol Pomozov wrote:
> Most hardware architectures require that data (including struct fields)
> have to be aligned in memory. To make it happen compiler inserts padding
> between struct fields if they are not aligned correctly.
>
> Reorder fields to remove paddings and make structures denser. Making data
> smaller saves some memory that is very important for trace events.
> Tracing buffer has limited size and making objects smaller we can put more
> of them without overflowing the tracing buffer.
>
> To find data struct holes I used 'pahole -H 1 -E -I vmlinux.o' from
> 'dwarves' package.
>
> Signed-off-by: Anatol Pomozov <[email protected]>
Thanks, applied.
- Ted
On Wed, Jul 18, 2012 at 10:07:34AM -0700, Anatol Pomozov wrote:
> Signed-off-by: Anatol Pomozov <[email protected]>
Thanks, applied.
- Ted