diff options
-rw-r--r-- | fs/ext4/inode.c | 3 | ||||
-rw-r--r-- | fs/ext4/super.c | 10 | ||||
-rw-r--r-- | include/trace/events/ext4.h | 97 |
3 files changed, 110 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 191616470466..846e1e9db434 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -53,6 +53,7 @@ | |||
53 | static inline int ext4_begin_ordered_truncate(struct inode *inode, | 53 | static inline int ext4_begin_ordered_truncate(struct inode *inode, |
54 | loff_t new_size) | 54 | loff_t new_size) |
55 | { | 55 | { |
56 | trace_ext4_begin_ordered_truncate(inode, new_size); | ||
56 | return jbd2_journal_begin_ordered_truncate( | 57 | return jbd2_journal_begin_ordered_truncate( |
57 | EXT4_SB(inode->i_sb)->s_journal, | 58 | EXT4_SB(inode->i_sb)->s_journal, |
58 | &EXT4_I(inode)->jinode, | 59 | &EXT4_I(inode)->jinode, |
@@ -178,6 +179,7 @@ void ext4_evict_inode(struct inode *inode) | |||
178 | handle_t *handle; | 179 | handle_t *handle; |
179 | int err; | 180 | int err; |
180 | 181 | ||
182 | trace_ext4_evict_inode(inode); | ||
181 | if (inode->i_nlink) { | 183 | if (inode->i_nlink) { |
182 | truncate_inode_pages(&inode->i_data, 0); | 184 | truncate_inode_pages(&inode->i_data, 0); |
183 | goto no_delete; | 185 | goto no_delete; |
@@ -5649,6 +5651,7 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode) | |||
5649 | int err, ret; | 5651 | int err, ret; |
5650 | 5652 | ||
5651 | might_sleep(); | 5653 | might_sleep(); |
5654 | trace_ext4_mark_inode_dirty(inode, _RET_IP_); | ||
5652 | err = ext4_reserve_inode_write(handle, inode, &iloc); | 5655 | err = ext4_reserve_inode_write(handle, inode, &iloc); |
5653 | if (ext4_handle_valid(handle) && | 5656 | if (ext4_handle_valid(handle) && |
5654 | EXT4_I(inode)->i_extra_isize < sbi->s_want_extra_isize && | 5657 | EXT4_I(inode)->i_extra_isize < sbi->s_want_extra_isize && |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ee91e29ddf95..61182fe6254e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -833,6 +833,14 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) | |||
833 | return &ei->vfs_inode; | 833 | return &ei->vfs_inode; |
834 | } | 834 | } |
835 | 835 | ||
836 | static int ext4_drop_inode(struct inode *inode) | ||
837 | { | ||
838 | int drop = generic_drop_inode(inode); | ||
839 | |||
840 | trace_ext4_drop_inode(inode, drop); | ||
841 | return drop; | ||
842 | } | ||
843 | |||
836 | static void ext4_destroy_inode(struct inode *inode) | 844 | static void ext4_destroy_inode(struct inode *inode) |
837 | { | 845 | { |
838 | ext4_ioend_wait(inode); | 846 | ext4_ioend_wait(inode); |
@@ -1175,6 +1183,7 @@ static const struct super_operations ext4_sops = { | |||
1175 | .destroy_inode = ext4_destroy_inode, | 1183 | .destroy_inode = ext4_destroy_inode, |
1176 | .write_inode = ext4_write_inode, | 1184 | .write_inode = ext4_write_inode, |
1177 | .dirty_inode = ext4_dirty_inode, | 1185 | .dirty_inode = ext4_dirty_inode, |
1186 | .drop_inode = ext4_drop_inode, | ||
1178 | .evict_inode = ext4_evict_inode, | 1187 | .evict_inode = ext4_evict_inode, |
1179 | .put_super = ext4_put_super, | 1188 | .put_super = ext4_put_super, |
1180 | .sync_fs = ext4_sync_fs, | 1189 | .sync_fs = ext4_sync_fs, |
@@ -1196,6 +1205,7 @@ static const struct super_operations ext4_nojournal_sops = { | |||
1196 | .destroy_inode = ext4_destroy_inode, | 1205 | .destroy_inode = ext4_destroy_inode, |
1197 | .write_inode = ext4_write_inode, | 1206 | .write_inode = ext4_write_inode, |
1198 | .dirty_inode = ext4_dirty_inode, | 1207 | .dirty_inode = ext4_dirty_inode, |
1208 | .drop_inode = ext4_drop_inode, | ||
1199 | .evict_inode = ext4_evict_inode, | 1209 | .evict_inode = ext4_evict_inode, |
1200 | .write_super = ext4_write_super, | 1210 | .write_super = ext4_write_super, |
1201 | .put_super = ext4_put_super, | 1211 | .put_super = ext4_put_super, |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 289010d3270b..e5e345fb2a5c 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -98,6 +98,103 @@ TRACE_EVENT(ext4_allocate_inode, | |||
98 | (unsigned long) __entry->dir, __entry->mode) | 98 | (unsigned long) __entry->dir, __entry->mode) |
99 | ); | 99 | ); |
100 | 100 | ||
101 | TRACE_EVENT(ext4_evict_inode, | ||
102 | TP_PROTO(struct inode *inode), | ||
103 | |||
104 | TP_ARGS(inode), | ||
105 | |||
106 | TP_STRUCT__entry( | ||
107 | __field( int, dev_major ) | ||
108 | __field( int, dev_minor ) | ||
109 | __field( ino_t, ino ) | ||
110 | __field( int, nlink ) | ||
111 | ), | ||
112 | |||
113 | TP_fast_assign( | ||
114 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
115 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
116 | __entry->ino = inode->i_ino; | ||
117 | __entry->nlink = inode->i_nlink; | ||
118 | ), | ||
119 | |||
120 | TP_printk("dev %d,%d ino %lu nlink %d", | ||
121 | __entry->dev_major, __entry->dev_minor, | ||
122 | (unsigned long) __entry->ino, __entry->nlink) | ||
123 | ); | ||
124 | |||
125 | TRACE_EVENT(ext4_drop_inode, | ||
126 | TP_PROTO(struct inode *inode, int drop), | ||
127 | |||
128 | TP_ARGS(inode, drop), | ||
129 | |||
130 | TP_STRUCT__entry( | ||
131 | __field( int, dev_major ) | ||
132 | __field( int, dev_minor ) | ||
133 | __field( ino_t, ino ) | ||
134 | __field( int, drop ) | ||
135 | ), | ||
136 | |||
137 | TP_fast_assign( | ||
138 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
139 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
140 | __entry->ino = inode->i_ino; | ||
141 | __entry->drop = drop; | ||
142 | ), | ||
143 | |||
144 | TP_printk("dev %d,%d ino %lu drop %d", | ||
145 | __entry->dev_major, __entry->dev_minor, | ||
146 | (unsigned long) __entry->ino, __entry->drop) | ||
147 | ); | ||
148 | |||
149 | TRACE_EVENT(ext4_mark_inode_dirty, | ||
150 | TP_PROTO(struct inode *inode, unsigned long IP), | ||
151 | |||
152 | TP_ARGS(inode, IP), | ||
153 | |||
154 | TP_STRUCT__entry( | ||
155 | __field( int, dev_major ) | ||
156 | __field( int, dev_minor ) | ||
157 | __field( ino_t, ino ) | ||
158 | __field(unsigned long, ip ) | ||
159 | ), | ||
160 | |||
161 | TP_fast_assign( | ||
162 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
163 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
164 | __entry->ino = inode->i_ino; | ||
165 | __entry->ip = IP; | ||
166 | ), | ||
167 | |||
168 | TP_printk("dev %d,%d ino %lu caller %pF", | ||
169 | __entry->dev_major, __entry->dev_minor, | ||
170 | (unsigned long) __entry->ino, (void *)__entry->ip) | ||
171 | ); | ||
172 | |||
173 | TRACE_EVENT(ext4_begin_ordered_truncate, | ||
174 | TP_PROTO(struct inode *inode, loff_t new_size), | ||
175 | |||
176 | TP_ARGS(inode, new_size), | ||
177 | |||
178 | TP_STRUCT__entry( | ||
179 | __field( int, dev_major ) | ||
180 | __field( int, dev_minor ) | ||
181 | __field( ino_t, ino ) | ||
182 | __field( loff_t, new_size ) | ||
183 | ), | ||
184 | |||
185 | TP_fast_assign( | ||
186 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
187 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
188 | __entry->ino = inode->i_ino; | ||
189 | __entry->new_size = new_size; | ||
190 | ), | ||
191 | |||
192 | TP_printk("dev %d,%d ino %lu new_size %lld", | ||
193 | __entry->dev_major, __entry->dev_minor, | ||
194 | (unsigned long) __entry->ino, | ||
195 | (long long) __entry->new_size) | ||
196 | ); | ||
197 | |||
101 | DECLARE_EVENT_CLASS(ext4__write_begin, | 198 | DECLARE_EVENT_CLASS(ext4__write_begin, |
102 | 199 | ||
103 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | 200 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |