diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-09-30 00:32:42 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-30 00:32:42 -0400 |
commit | 296c355cd6443d89fa251885a8d78778fe111dc4 (patch) | |
tree | 5cf7c8b115617dc3829a16a5969894d37b73173c /include/trace | |
parent | 90576c0b9a0b5323fc4bd7f23f49be0d234f36d1 (diff) |
ext4: Use tracepoints for mb_history trace file
The /proc/fs/ext4/<dev>/mb_history was maintained manually, and had a
number of problems: it required a largish amount of memory to be
allocated for each ext4 filesystem, and the s_mb_history_lock
introduced a CPU contention problem.
By ripping out the mb_history code and replacing it with ftrace
tracepoints, and we get more functionality: timestamps, event
filtering, the ability to correlate mballoc history with other ext4
tracepoints, etc.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/ext4.h | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 7c6bbb7198a3..b8320256dc5d 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -743,6 +743,169 @@ TRACE_EVENT(ext4_alloc_da_blocks, | |||
743 | __entry->data_blocks, __entry->meta_blocks) | 743 | __entry->data_blocks, __entry->meta_blocks) |
744 | ); | 744 | ); |
745 | 745 | ||
746 | TRACE_EVENT(ext4_mballoc_alloc, | ||
747 | TP_PROTO(struct ext4_allocation_context *ac), | ||
748 | |||
749 | TP_ARGS(ac), | ||
750 | |||
751 | TP_STRUCT__entry( | ||
752 | __field( dev_t, dev ) | ||
753 | __field( ino_t, ino ) | ||
754 | __field( __u16, found ) | ||
755 | __field( __u16, groups ) | ||
756 | __field( __u16, buddy ) | ||
757 | __field( __u16, flags ) | ||
758 | __field( __u16, tail ) | ||
759 | __field( __u8, cr ) | ||
760 | __field( __u32, orig_logical ) | ||
761 | __field( int, orig_start ) | ||
762 | __field( __u32, orig_group ) | ||
763 | __field( int, orig_len ) | ||
764 | __field( __u32, goal_logical ) | ||
765 | __field( int, goal_start ) | ||
766 | __field( __u32, goal_group ) | ||
767 | __field( int, goal_len ) | ||
768 | __field( __u32, result_logical ) | ||
769 | __field( int, result_start ) | ||
770 | __field( __u32, result_group ) | ||
771 | __field( int, result_len ) | ||
772 | ), | ||
773 | |||
774 | TP_fast_assign( | ||
775 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
776 | __entry->ino = ac->ac_inode->i_ino; | ||
777 | __entry->found = ac->ac_found; | ||
778 | __entry->flags = ac->ac_flags; | ||
779 | __entry->groups = ac->ac_groups_scanned; | ||
780 | __entry->buddy = ac->ac_buddy; | ||
781 | __entry->tail = ac->ac_tail; | ||
782 | __entry->cr = ac->ac_criteria; | ||
783 | __entry->orig_logical = ac->ac_o_ex.fe_logical; | ||
784 | __entry->orig_start = ac->ac_o_ex.fe_start; | ||
785 | __entry->orig_group = ac->ac_o_ex.fe_group; | ||
786 | __entry->orig_len = ac->ac_o_ex.fe_len; | ||
787 | __entry->goal_logical = ac->ac_g_ex.fe_logical; | ||
788 | __entry->goal_start = ac->ac_g_ex.fe_start; | ||
789 | __entry->goal_group = ac->ac_g_ex.fe_group; | ||
790 | __entry->goal_len = ac->ac_g_ex.fe_len; | ||
791 | __entry->result_logical = ac->ac_f_ex.fe_logical; | ||
792 | __entry->result_start = ac->ac_f_ex.fe_start; | ||
793 | __entry->result_group = ac->ac_f_ex.fe_group; | ||
794 | __entry->result_len = ac->ac_f_ex.fe_len; | ||
795 | ), | ||
796 | |||
797 | TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " | ||
798 | "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x " | ||
799 | "tail %u broken %u", | ||
800 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
801 | __entry->orig_group, __entry->orig_start, | ||
802 | __entry->orig_len, __entry->orig_logical, | ||
803 | __entry->goal_group, __entry->goal_start, | ||
804 | __entry->goal_len, __entry->goal_logical, | ||
805 | __entry->result_group, __entry->result_start, | ||
806 | __entry->result_len, __entry->result_logical, | ||
807 | __entry->found, __entry->groups, __entry->cr, | ||
808 | __entry->flags, __entry->tail, | ||
809 | __entry->buddy ? 1 << __entry->buddy : 0) | ||
810 | ); | ||
811 | |||
812 | TRACE_EVENT(ext4_mballoc_prealloc, | ||
813 | TP_PROTO(struct ext4_allocation_context *ac), | ||
814 | |||
815 | TP_ARGS(ac), | ||
816 | |||
817 | TP_STRUCT__entry( | ||
818 | __field( dev_t, dev ) | ||
819 | __field( ino_t, ino ) | ||
820 | __field( __u32, orig_logical ) | ||
821 | __field( int, orig_start ) | ||
822 | __field( __u32, orig_group ) | ||
823 | __field( int, orig_len ) | ||
824 | __field( __u32, result_logical ) | ||
825 | __field( int, result_start ) | ||
826 | __field( __u32, result_group ) | ||
827 | __field( int, result_len ) | ||
828 | ), | ||
829 | |||
830 | TP_fast_assign( | ||
831 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
832 | __entry->ino = ac->ac_inode->i_ino; | ||
833 | __entry->orig_logical = ac->ac_o_ex.fe_logical; | ||
834 | __entry->orig_start = ac->ac_o_ex.fe_start; | ||
835 | __entry->orig_group = ac->ac_o_ex.fe_group; | ||
836 | __entry->orig_len = ac->ac_o_ex.fe_len; | ||
837 | __entry->result_logical = ac->ac_b_ex.fe_logical; | ||
838 | __entry->result_start = ac->ac_b_ex.fe_start; | ||
839 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
840 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
841 | ), | ||
842 | |||
843 | TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u", | ||
844 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
845 | __entry->orig_group, __entry->orig_start, | ||
846 | __entry->orig_len, __entry->orig_logical, | ||
847 | __entry->result_group, __entry->result_start, | ||
848 | __entry->result_len, __entry->result_logical) | ||
849 | ); | ||
850 | |||
851 | TRACE_EVENT(ext4_mballoc_discard, | ||
852 | TP_PROTO(struct ext4_allocation_context *ac), | ||
853 | |||
854 | TP_ARGS(ac), | ||
855 | |||
856 | TP_STRUCT__entry( | ||
857 | __field( dev_t, dev ) | ||
858 | __field( ino_t, ino ) | ||
859 | __field( __u32, result_logical ) | ||
860 | __field( int, result_start ) | ||
861 | __field( __u32, result_group ) | ||
862 | __field( int, result_len ) | ||
863 | ), | ||
864 | |||
865 | TP_fast_assign( | ||
866 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
867 | __entry->ino = ac->ac_inode->i_ino; | ||
868 | __entry->result_logical = ac->ac_b_ex.fe_logical; | ||
869 | __entry->result_start = ac->ac_b_ex.fe_start; | ||
870 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
871 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
872 | ), | ||
873 | |||
874 | TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", | ||
875 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
876 | __entry->result_group, __entry->result_start, | ||
877 | __entry->result_len, __entry->result_logical) | ||
878 | ); | ||
879 | |||
880 | TRACE_EVENT(ext4_mballoc_free, | ||
881 | TP_PROTO(struct ext4_allocation_context *ac), | ||
882 | |||
883 | TP_ARGS(ac), | ||
884 | |||
885 | TP_STRUCT__entry( | ||
886 | __field( dev_t, dev ) | ||
887 | __field( ino_t, ino ) | ||
888 | __field( __u32, result_logical ) | ||
889 | __field( int, result_start ) | ||
890 | __field( __u32, result_group ) | ||
891 | __field( int, result_len ) | ||
892 | ), | ||
893 | |||
894 | TP_fast_assign( | ||
895 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
896 | __entry->ino = ac->ac_inode->i_ino; | ||
897 | __entry->result_logical = ac->ac_b_ex.fe_logical; | ||
898 | __entry->result_start = ac->ac_b_ex.fe_start; | ||
899 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
900 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
901 | ), | ||
902 | |||
903 | TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", | ||
904 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
905 | __entry->result_group, __entry->result_start, | ||
906 | __entry->result_len, __entry->result_logical) | ||
907 | ); | ||
908 | |||
746 | #endif /* _TRACE_EXT4_H */ | 909 | #endif /* _TRACE_EXT4_H */ |
747 | 910 | ||
748 | /* This part must be outside protection */ | 911 | /* This part must be outside protection */ |