diff options
author | Eric Sandeen <sandeen@redhat.com> | 2010-10-27 21:30:07 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-10-27 21:30:07 -0400 |
commit | 3e1e5f501632460184a98237d5460c521510535e (patch) | |
tree | 9bb5006c9bcb1651f9c447869f4e90deb116e6e8 /include/trace/events/ext4.h | |
parent | 4d5476164a052e80d4ef430e368e76dbde96801f (diff) |
ext4: don't use ext4_allocation_contexts for tracing
Many tracepoints were populating an ext4_allocation_context
to pass in, but this requires a slab allocation even when
tracepoints are off. In fact, 4 of 5 of these allocations
were only for tracing. In addition, we were only using a
small fraction of the 144 bytes of this structure for this
purpose.
We can do away with all these alloc/frees of the ac and
simply pass in the bits we care about, instead.
I tested this by turning on tracing and running through
xfstests on x86_64. I did not actually do anything with
the trace output, however.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/trace/events/ext4.h')
-rw-r--r-- | include/trace/events/ext4.h | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index fbdfa3a6bbd8..b5f4938d612d 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -396,11 +396,11 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa, | |||
396 | 396 | ||
397 | TRACE_EVENT(ext4_mb_release_inode_pa, | 397 | TRACE_EVENT(ext4_mb_release_inode_pa, |
398 | TP_PROTO(struct super_block *sb, | 398 | TP_PROTO(struct super_block *sb, |
399 | struct ext4_allocation_context *ac, | 399 | struct inode *inode, |
400 | struct ext4_prealloc_space *pa, | 400 | struct ext4_prealloc_space *pa, |
401 | unsigned long long block, unsigned int count), | 401 | unsigned long long block, unsigned int count), |
402 | 402 | ||
403 | TP_ARGS(sb, ac, pa, block, count), | 403 | TP_ARGS(sb, inode, pa, block, count), |
404 | 404 | ||
405 | TP_STRUCT__entry( | 405 | TP_STRUCT__entry( |
406 | __field( dev_t, dev ) | 406 | __field( dev_t, dev ) |
@@ -412,8 +412,7 @@ TRACE_EVENT(ext4_mb_release_inode_pa, | |||
412 | 412 | ||
413 | TP_fast_assign( | 413 | TP_fast_assign( |
414 | __entry->dev = sb->s_dev; | 414 | __entry->dev = sb->s_dev; |
415 | __entry->ino = (ac && ac->ac_inode) ? | 415 | __entry->ino = inode->i_ino; |
416 | ac->ac_inode->i_ino : 0; | ||
417 | __entry->block = block; | 416 | __entry->block = block; |
418 | __entry->count = count; | 417 | __entry->count = count; |
419 | ), | 418 | ), |
@@ -425,10 +424,9 @@ TRACE_EVENT(ext4_mb_release_inode_pa, | |||
425 | 424 | ||
426 | TRACE_EVENT(ext4_mb_release_group_pa, | 425 | TRACE_EVENT(ext4_mb_release_group_pa, |
427 | TP_PROTO(struct super_block *sb, | 426 | TP_PROTO(struct super_block *sb, |
428 | struct ext4_allocation_context *ac, | ||
429 | struct ext4_prealloc_space *pa), | 427 | struct ext4_prealloc_space *pa), |
430 | 428 | ||
431 | TP_ARGS(sb, ac, pa), | 429 | TP_ARGS(sb, pa), |
432 | 430 | ||
433 | TP_STRUCT__entry( | 431 | TP_STRUCT__entry( |
434 | __field( dev_t, dev ) | 432 | __field( dev_t, dev ) |
@@ -779,47 +777,56 @@ TRACE_EVENT(ext4_mballoc_prealloc, | |||
779 | ); | 777 | ); |
780 | 778 | ||
781 | DECLARE_EVENT_CLASS(ext4__mballoc, | 779 | DECLARE_EVENT_CLASS(ext4__mballoc, |
782 | TP_PROTO(struct ext4_allocation_context *ac), | 780 | TP_PROTO(struct super_block *sb, |
781 | struct inode *inode, | ||
782 | ext4_group_t group, | ||
783 | ext4_grpblk_t start, | ||
784 | ext4_grpblk_t len), | ||
783 | 785 | ||
784 | TP_ARGS(ac), | 786 | TP_ARGS(sb, inode, group, start, len), |
785 | 787 | ||
786 | TP_STRUCT__entry( | 788 | TP_STRUCT__entry( |
787 | __field( dev_t, dev ) | 789 | __field( dev_t, dev ) |
788 | __field( ino_t, ino ) | 790 | __field( ino_t, ino ) |
789 | __field( __u32, result_logical ) | ||
790 | __field( int, result_start ) | 791 | __field( int, result_start ) |
791 | __field( __u32, result_group ) | 792 | __field( __u32, result_group ) |
792 | __field( int, result_len ) | 793 | __field( int, result_len ) |
793 | ), | 794 | ), |
794 | 795 | ||
795 | TP_fast_assign( | 796 | TP_fast_assign( |
796 | __entry->dev = ac->ac_sb->s_dev; | 797 | __entry->dev = sb->s_dev; |
797 | __entry->ino = ac->ac_inode ? | 798 | __entry->ino = inode ? inode->i_ino : 0; |
798 | ac->ac_inode->i_ino : 0; | 799 | __entry->result_start = start; |
799 | __entry->result_logical = ac->ac_b_ex.fe_logical; | 800 | __entry->result_group = group; |
800 | __entry->result_start = ac->ac_b_ex.fe_start; | 801 | __entry->result_len = len; |
801 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
802 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
803 | ), | 802 | ), |
804 | 803 | ||
805 | TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", | 804 | TP_printk("dev %s inode %lu extent %u/%d/%u ", |
806 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | 805 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
807 | __entry->result_group, __entry->result_start, | 806 | __entry->result_group, __entry->result_start, |
808 | __entry->result_len, __entry->result_logical) | 807 | __entry->result_len) |
809 | ); | 808 | ); |
810 | 809 | ||
811 | DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard, | 810 | DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard, |
812 | 811 | ||
813 | TP_PROTO(struct ext4_allocation_context *ac), | 812 | TP_PROTO(struct super_block *sb, |
813 | struct inode *inode, | ||
814 | ext4_group_t group, | ||
815 | ext4_grpblk_t start, | ||
816 | ext4_grpblk_t len), | ||
814 | 817 | ||
815 | TP_ARGS(ac) | 818 | TP_ARGS(sb, inode, group, start, len) |
816 | ); | 819 | ); |
817 | 820 | ||
818 | DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free, | 821 | DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free, |
819 | 822 | ||
820 | TP_PROTO(struct ext4_allocation_context *ac), | 823 | TP_PROTO(struct super_block *sb, |
824 | struct inode *inode, | ||
825 | ext4_group_t group, | ||
826 | ext4_grpblk_t start, | ||
827 | ext4_grpblk_t len), | ||
821 | 828 | ||
822 | TP_ARGS(ac) | 829 | TP_ARGS(sb, inode, group, start, len) |
823 | ); | 830 | ); |
824 | 831 | ||
825 | TRACE_EVENT(ext4_forget, | 832 | TRACE_EVENT(ext4_forget, |