diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2010-05-24 04:25:57 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-05-28 16:19:31 -0400 |
commit | f8adb4d574cf8c67f8391367136edc5469258fdc (patch) | |
tree | 0528b7b64336719965c54ae4f47b95747f8f6eff | |
parent | 292ec4cf3536a5ed8809e8823341b203e497bbaf (diff) |
xfs: convert more trace events to DEFINE_EVENT
Use DECLARE_EVENT_CLASS, and save ~15K:
text data bss dec hex filename
171949 43028 48 215025 347f1 fs/xfs/linux-2.6/xfs_trace.o.orig
156521 43028 36 199585 30ba1 fs/xfs/linux-2.6/xfs_trace.o
No change in functionality.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Alex Elder <aelder@sgi.com>
-rw-r--r-- | fs/xfs/linux-2.6/xfs_trace.h | 356 |
1 files changed, 188 insertions, 168 deletions
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h index ff6bc797baf2..73d5aa117384 100644 --- a/fs/xfs/linux-2.6/xfs_trace.h +++ b/fs/xfs/linux-2.6/xfs_trace.h | |||
@@ -82,33 +82,6 @@ DECLARE_EVENT_CLASS(xfs_attr_list_class, | |||
82 | ) | 82 | ) |
83 | ) | 83 | ) |
84 | 84 | ||
85 | #define DEFINE_PERAG_REF_EVENT(name) \ | ||
86 | TRACE_EVENT(name, \ | ||
87 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ | ||
88 | unsigned long caller_ip), \ | ||
89 | TP_ARGS(mp, agno, refcount, caller_ip), \ | ||
90 | TP_STRUCT__entry( \ | ||
91 | __field(dev_t, dev) \ | ||
92 | __field(xfs_agnumber_t, agno) \ | ||
93 | __field(int, refcount) \ | ||
94 | __field(unsigned long, caller_ip) \ | ||
95 | ), \ | ||
96 | TP_fast_assign( \ | ||
97 | __entry->dev = mp->m_super->s_dev; \ | ||
98 | __entry->agno = agno; \ | ||
99 | __entry->refcount = refcount; \ | ||
100 | __entry->caller_ip = caller_ip; \ | ||
101 | ), \ | ||
102 | TP_printk("dev %d:%d agno %u refcount %d caller %pf", \ | ||
103 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | ||
104 | __entry->agno, \ | ||
105 | __entry->refcount, \ | ||
106 | (char *)__entry->caller_ip) \ | ||
107 | ); | ||
108 | |||
109 | DEFINE_PERAG_REF_EVENT(xfs_perag_get) | ||
110 | DEFINE_PERAG_REF_EVENT(xfs_perag_put) | ||
111 | |||
112 | #define DEFINE_ATTR_LIST_EVENT(name) \ | 85 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
113 | DEFINE_EVENT(xfs_attr_list_class, name, \ | 86 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
114 | TP_PROTO(struct xfs_attr_list_context *ctx), \ | 87 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
@@ -122,6 +95,37 @@ DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); | |||
122 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); | 95 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); |
123 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); | 96 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); |
124 | 97 | ||
98 | DECLARE_EVENT_CLASS(xfs_perag_class, | ||
99 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, | ||
100 | unsigned long caller_ip), | ||
101 | TP_ARGS(mp, agno, refcount, caller_ip), | ||
102 | TP_STRUCT__entry( | ||
103 | __field(dev_t, dev) | ||
104 | __field(xfs_agnumber_t, agno) | ||
105 | __field(int, refcount) | ||
106 | __field(unsigned long, caller_ip) | ||
107 | ), | ||
108 | TP_fast_assign( | ||
109 | __entry->dev = mp->m_super->s_dev; | ||
110 | __entry->agno = agno; | ||
111 | __entry->refcount = refcount; | ||
112 | __entry->caller_ip = caller_ip; | ||
113 | ), | ||
114 | TP_printk("dev %d:%d agno %u refcount %d caller %pf", | ||
115 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
116 | __entry->agno, | ||
117 | __entry->refcount, | ||
118 | (char *)__entry->caller_ip) | ||
119 | ); | ||
120 | |||
121 | #define DEFINE_PERAG_REF_EVENT(name) \ | ||
122 | DEFINE_EVENT(xfs_perag_class, name, \ | ||
123 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ | ||
124 | unsigned long caller_ip), \ | ||
125 | TP_ARGS(mp, agno, refcount, caller_ip)) | ||
126 | DEFINE_PERAG_REF_EVENT(xfs_perag_get); | ||
127 | DEFINE_PERAG_REF_EVENT(xfs_perag_put); | ||
128 | |||
125 | TRACE_EVENT(xfs_attr_list_node_descend, | 129 | TRACE_EVENT(xfs_attr_list_node_descend, |
126 | TP_PROTO(struct xfs_attr_list_context *ctx, | 130 | TP_PROTO(struct xfs_attr_list_context *ctx, |
127 | struct xfs_da_node_entry *btree), | 131 | struct xfs_da_node_entry *btree), |
@@ -775,165 +779,181 @@ DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter); | |||
775 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); | 779 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); |
776 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); | 780 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); |
777 | 781 | ||
778 | #define DEFINE_RW_EVENT(name) \ | 782 | DECLARE_EVENT_CLASS(xfs_file_class, |
779 | TRACE_EVENT(name, \ | 783 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), |
780 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \ | 784 | TP_ARGS(ip, count, offset, flags), |
781 | TP_ARGS(ip, count, offset, flags), \ | 785 | TP_STRUCT__entry( |
782 | TP_STRUCT__entry( \ | 786 | __field(dev_t, dev) |
783 | __field(dev_t, dev) \ | 787 | __field(xfs_ino_t, ino) |
784 | __field(xfs_ino_t, ino) \ | 788 | __field(xfs_fsize_t, size) |
785 | __field(xfs_fsize_t, size) \ | 789 | __field(xfs_fsize_t, new_size) |
786 | __field(xfs_fsize_t, new_size) \ | 790 | __field(loff_t, offset) |
787 | __field(loff_t, offset) \ | 791 | __field(size_t, count) |
788 | __field(size_t, count) \ | 792 | __field(int, flags) |
789 | __field(int, flags) \ | 793 | ), |
790 | ), \ | 794 | TP_fast_assign( |
791 | TP_fast_assign( \ | 795 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
792 | __entry->dev = VFS_I(ip)->i_sb->s_dev; \ | 796 | __entry->ino = ip->i_ino; |
793 | __entry->ino = ip->i_ino; \ | 797 | __entry->size = ip->i_d.di_size; |
794 | __entry->size = ip->i_d.di_size; \ | 798 | __entry->new_size = ip->i_new_size; |
795 | __entry->new_size = ip->i_new_size; \ | 799 | __entry->offset = offset; |
796 | __entry->offset = offset; \ | 800 | __entry->count = count; |
797 | __entry->count = count; \ | 801 | __entry->flags = flags; |
798 | __entry->flags = flags; \ | 802 | ), |
799 | ), \ | 803 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " |
800 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ | 804 | "offset 0x%llx count 0x%zx ioflags %s", |
801 | "offset 0x%llx count 0x%zx ioflags %s", \ | 805 | MAJOR(__entry->dev), MINOR(__entry->dev), |
802 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | 806 | __entry->ino, |
803 | __entry->ino, \ | 807 | __entry->size, |
804 | __entry->size, \ | 808 | __entry->new_size, |
805 | __entry->new_size, \ | 809 | __entry->offset, |
806 | __entry->offset, \ | 810 | __entry->count, |
807 | __entry->count, \ | 811 | __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) |
808 | __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) \ | ||
809 | ) | 812 | ) |
813 | |||
814 | #define DEFINE_RW_EVENT(name) \ | ||
815 | DEFINE_EVENT(xfs_file_class, name, \ | ||
816 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \ | ||
817 | TP_ARGS(ip, count, offset, flags)) | ||
810 | DEFINE_RW_EVENT(xfs_file_read); | 818 | DEFINE_RW_EVENT(xfs_file_read); |
811 | DEFINE_RW_EVENT(xfs_file_buffered_write); | 819 | DEFINE_RW_EVENT(xfs_file_buffered_write); |
812 | DEFINE_RW_EVENT(xfs_file_direct_write); | 820 | DEFINE_RW_EVENT(xfs_file_direct_write); |
813 | DEFINE_RW_EVENT(xfs_file_splice_read); | 821 | DEFINE_RW_EVENT(xfs_file_splice_read); |
814 | DEFINE_RW_EVENT(xfs_file_splice_write); | 822 | DEFINE_RW_EVENT(xfs_file_splice_write); |
815 | 823 | ||
816 | 824 | DECLARE_EVENT_CLASS(xfs_page_class, | |
817 | #define DEFINE_PAGE_EVENT(name) \ | 825 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off), |
818 | TRACE_EVENT(name, \ | 826 | TP_ARGS(inode, page, off), |
819 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \ | 827 | TP_STRUCT__entry( |
820 | TP_ARGS(inode, page, off), \ | 828 | __field(dev_t, dev) |
821 | TP_STRUCT__entry( \ | 829 | __field(xfs_ino_t, ino) |
822 | __field(dev_t, dev) \ | 830 | __field(pgoff_t, pgoff) |
823 | __field(xfs_ino_t, ino) \ | 831 | __field(loff_t, size) |
824 | __field(pgoff_t, pgoff) \ | 832 | __field(unsigned long, offset) |
825 | __field(loff_t, size) \ | 833 | __field(int, delalloc) |
826 | __field(unsigned long, offset) \ | 834 | __field(int, unmapped) |
827 | __field(int, delalloc) \ | 835 | __field(int, unwritten) |
828 | __field(int, unmapped) \ | 836 | ), |
829 | __field(int, unwritten) \ | 837 | TP_fast_assign( |
830 | ), \ | 838 | int delalloc = -1, unmapped = -1, unwritten = -1; |
831 | TP_fast_assign( \ | 839 | |
832 | int delalloc = -1, unmapped = -1, unwritten = -1; \ | 840 | if (page_has_buffers(page)) |
833 | \ | 841 | xfs_count_page_state(page, &delalloc, |
834 | if (page_has_buffers(page)) \ | 842 | &unmapped, &unwritten); |
835 | xfs_count_page_state(page, &delalloc, \ | 843 | __entry->dev = inode->i_sb->s_dev; |
836 | &unmapped, &unwritten); \ | 844 | __entry->ino = XFS_I(inode)->i_ino; |
837 | __entry->dev = inode->i_sb->s_dev; \ | 845 | __entry->pgoff = page_offset(page); |
838 | __entry->ino = XFS_I(inode)->i_ino; \ | 846 | __entry->size = i_size_read(inode); |
839 | __entry->pgoff = page_offset(page); \ | 847 | __entry->offset = off; |
840 | __entry->size = i_size_read(inode); \ | 848 | __entry->delalloc = delalloc; |
841 | __entry->offset = off; \ | 849 | __entry->unmapped = unmapped; |
842 | __entry->delalloc = delalloc; \ | 850 | __entry->unwritten = unwritten; |
843 | __entry->unmapped = unmapped; \ | 851 | ), |
844 | __entry->unwritten = unwritten; \ | 852 | TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " |
845 | ), \ | 853 | "delalloc %d unmapped %d unwritten %d", |
846 | TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " \ | 854 | MAJOR(__entry->dev), MINOR(__entry->dev), |
847 | "delalloc %d unmapped %d unwritten %d", \ | 855 | __entry->ino, |
848 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | 856 | __entry->pgoff, |
849 | __entry->ino, \ | 857 | __entry->size, |
850 | __entry->pgoff, \ | 858 | __entry->offset, |
851 | __entry->size, \ | 859 | __entry->delalloc, |
852 | __entry->offset, \ | 860 | __entry->unmapped, |
853 | __entry->delalloc, \ | 861 | __entry->unwritten) |
854 | __entry->unmapped, \ | ||
855 | __entry->unwritten) \ | ||
856 | ) | 862 | ) |
863 | |||
864 | #define DEFINE_PAGE_EVENT(name) \ | ||
865 | DEFINE_EVENT(xfs_page_class, name, \ | ||
866 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \ | ||
867 | TP_ARGS(inode, page, off)) | ||
857 | DEFINE_PAGE_EVENT(xfs_writepage); | 868 | DEFINE_PAGE_EVENT(xfs_writepage); |
858 | DEFINE_PAGE_EVENT(xfs_releasepage); | 869 | DEFINE_PAGE_EVENT(xfs_releasepage); |
859 | DEFINE_PAGE_EVENT(xfs_invalidatepage); | 870 | DEFINE_PAGE_EVENT(xfs_invalidatepage); |
860 | 871 | ||
861 | #define DEFINE_IOMAP_EVENT(name) \ | 872 | DECLARE_EVENT_CLASS(xfs_iomap_class, |
862 | TRACE_EVENT(name, \ | 873 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, |
863 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ | 874 | int flags, struct xfs_bmbt_irec *irec), |
864 | int flags, struct xfs_bmbt_irec *irec), \ | 875 | TP_ARGS(ip, offset, count, flags, irec), |
865 | TP_ARGS(ip, offset, count, flags, irec), \ | 876 | TP_STRUCT__entry( |
866 | TP_STRUCT__entry( \ | 877 | __field(dev_t, dev) |
867 | __field(dev_t, dev) \ | 878 | __field(xfs_ino_t, ino) |
868 | __field(xfs_ino_t, ino) \ | 879 | __field(loff_t, size) |
869 | __field(loff_t, size) \ | 880 | __field(loff_t, new_size) |
870 | __field(loff_t, new_size) \ | 881 | __field(loff_t, offset) |
871 | __field(loff_t, offset) \ | 882 | __field(size_t, count) |
872 | __field(size_t, count) \ | 883 | __field(int, flags) |
873 | __field(int, flags) \ | 884 | __field(xfs_fileoff_t, startoff) |
874 | __field(xfs_fileoff_t, startoff) \ | 885 | __field(xfs_fsblock_t, startblock) |
875 | __field(xfs_fsblock_t, startblock) \ | 886 | __field(xfs_filblks_t, blockcount) |
876 | __field(xfs_filblks_t, blockcount) \ | 887 | ), |
877 | ), \ | 888 | TP_fast_assign( |
878 | TP_fast_assign( \ | 889 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
879 | __entry->dev = VFS_I(ip)->i_sb->s_dev; \ | 890 | __entry->ino = ip->i_ino; |
880 | __entry->ino = ip->i_ino; \ | 891 | __entry->size = ip->i_d.di_size; |
881 | __entry->size = ip->i_d.di_size; \ | 892 | __entry->new_size = ip->i_new_size; |
882 | __entry->new_size = ip->i_new_size; \ | 893 | __entry->offset = offset; |
883 | __entry->offset = offset; \ | 894 | __entry->count = count; |
884 | __entry->count = count; \ | 895 | __entry->flags = flags; |
885 | __entry->flags = flags; \ | 896 | __entry->startoff = irec ? irec->br_startoff : 0; |
886 | __entry->startoff = irec ? irec->br_startoff : 0; \ | 897 | __entry->startblock = irec ? irec->br_startblock : 0; |
887 | __entry->startblock = irec ? irec->br_startblock : 0; \ | 898 | __entry->blockcount = irec ? irec->br_blockcount : 0; |
888 | __entry->blockcount = irec ? irec->br_blockcount : 0; \ | 899 | ), |
889 | ), \ | 900 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " |
890 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ | 901 | "offset 0x%llx count %zd flags %s " |
891 | "offset 0x%llx count %zd flags %s " \ | 902 | "startoff 0x%llx startblock %lld blockcount 0x%llx", |
892 | "startoff 0x%llx startblock %lld blockcount 0x%llx", \ | 903 | MAJOR(__entry->dev), MINOR(__entry->dev), |
893 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | 904 | __entry->ino, |
894 | __entry->ino, \ | 905 | __entry->size, |
895 | __entry->size, \ | 906 | __entry->new_size, |
896 | __entry->new_size, \ | 907 | __entry->offset, |
897 | __entry->offset, \ | 908 | __entry->count, |
898 | __entry->count, \ | 909 | __print_flags(__entry->flags, "|", BMAPI_FLAGS), |
899 | __print_flags(__entry->flags, "|", BMAPI_FLAGS), \ | 910 | __entry->startoff, |
900 | __entry->startoff, \ | 911 | (__int64_t)__entry->startblock, |
901 | (__int64_t)__entry->startblock, \ | 912 | __entry->blockcount) |
902 | __entry->blockcount) \ | ||
903 | ) | 913 | ) |
914 | |||
915 | #define DEFINE_IOMAP_EVENT(name) \ | ||
916 | DEFINE_EVENT(xfs_iomap_class, name, \ | ||
917 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ | ||
918 | int flags, struct xfs_bmbt_irec *irec), \ | ||
919 | TP_ARGS(ip, offset, count, flags, irec)) | ||
904 | DEFINE_IOMAP_EVENT(xfs_iomap_enter); | 920 | DEFINE_IOMAP_EVENT(xfs_iomap_enter); |
905 | DEFINE_IOMAP_EVENT(xfs_iomap_found); | 921 | DEFINE_IOMAP_EVENT(xfs_iomap_found); |
906 | DEFINE_IOMAP_EVENT(xfs_iomap_alloc); | 922 | DEFINE_IOMAP_EVENT(xfs_iomap_alloc); |
907 | 923 | ||
908 | #define DEFINE_SIMPLE_IO_EVENT(name) \ | 924 | DECLARE_EVENT_CLASS(xfs_simple_io_class, |
909 | TRACE_EVENT(name, \ | 925 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), |
910 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ | 926 | TP_ARGS(ip, offset, count), |
911 | TP_ARGS(ip, offset, count), \ | 927 | TP_STRUCT__entry( |
912 | TP_STRUCT__entry( \ | 928 | __field(dev_t, dev) |
913 | __field(dev_t, dev) \ | 929 | __field(xfs_ino_t, ino) |
914 | __field(xfs_ino_t, ino) \ | 930 | __field(loff_t, size) |
915 | __field(loff_t, size) \ | 931 | __field(loff_t, new_size) |
916 | __field(loff_t, new_size) \ | 932 | __field(loff_t, offset) |
917 | __field(loff_t, offset) \ | 933 | __field(size_t, count) |
918 | __field(size_t, count) \ | 934 | ), |
919 | ), \ | 935 | TP_fast_assign( |
920 | TP_fast_assign( \ | 936 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
921 | __entry->dev = VFS_I(ip)->i_sb->s_dev; \ | 937 | __entry->ino = ip->i_ino; |
922 | __entry->ino = ip->i_ino; \ | 938 | __entry->size = ip->i_d.di_size; |
923 | __entry->size = ip->i_d.di_size; \ | 939 | __entry->new_size = ip->i_new_size; |
924 | __entry->new_size = ip->i_new_size; \ | 940 | __entry->offset = offset; |
925 | __entry->offset = offset; \ | 941 | __entry->count = count; |
926 | __entry->count = count; \ | 942 | ), |
927 | ), \ | 943 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " |
928 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ | 944 | "offset 0x%llx count %zd", |
929 | "offset 0x%llx count %zd", \ | 945 | MAJOR(__entry->dev), MINOR(__entry->dev), |
930 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | 946 | __entry->ino, |
931 | __entry->ino, \ | 947 | __entry->size, |
932 | __entry->size, \ | 948 | __entry->new_size, |
933 | __entry->new_size, \ | 949 | __entry->offset, |
934 | __entry->offset, \ | 950 | __entry->count) |
935 | __entry->count) \ | ||
936 | ); | 951 | ); |
952 | |||
953 | #define DEFINE_SIMPLE_IO_EVENT(name) \ | ||
954 | DEFINE_EVENT(xfs_simple_io_class, name, \ | ||
955 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ | ||
956 | TP_ARGS(ip, offset, count)) | ||
937 | DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); | 957 | DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); |
938 | DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); | 958 | DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); |
939 | 959 | ||