diff options
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/btrfs.h | 6 | ||||
-rw-r--r-- | include/trace/events/ext4.h | 6 | ||||
-rw-r--r-- | include/trace/events/writeback.h | 183 |
3 files changed, 173 insertions, 22 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index 4114129f0794..b31702ac15be 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h | |||
@@ -284,7 +284,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage, | |||
284 | __field( long, pages_skipped ) | 284 | __field( long, pages_skipped ) |
285 | __field( loff_t, range_start ) | 285 | __field( loff_t, range_start ) |
286 | __field( loff_t, range_end ) | 286 | __field( loff_t, range_end ) |
287 | __field( char, nonblocking ) | ||
288 | __field( char, for_kupdate ) | 287 | __field( char, for_kupdate ) |
289 | __field( char, for_reclaim ) | 288 | __field( char, for_reclaim ) |
290 | __field( char, range_cyclic ) | 289 | __field( char, range_cyclic ) |
@@ -299,7 +298,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage, | |||
299 | __entry->pages_skipped = wbc->pages_skipped; | 298 | __entry->pages_skipped = wbc->pages_skipped; |
300 | __entry->range_start = wbc->range_start; | 299 | __entry->range_start = wbc->range_start; |
301 | __entry->range_end = wbc->range_end; | 300 | __entry->range_end = wbc->range_end; |
302 | __entry->nonblocking = wbc->nonblocking; | ||
303 | __entry->for_kupdate = wbc->for_kupdate; | 301 | __entry->for_kupdate = wbc->for_kupdate; |
304 | __entry->for_reclaim = wbc->for_reclaim; | 302 | __entry->for_reclaim = wbc->for_reclaim; |
305 | __entry->range_cyclic = wbc->range_cyclic; | 303 | __entry->range_cyclic = wbc->range_cyclic; |
@@ -310,13 +308,13 @@ DECLARE_EVENT_CLASS(btrfs__writepage, | |||
310 | 308 | ||
311 | TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, " | 309 | TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, " |
312 | "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, " | 310 | "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, " |
313 | "range_end = %llu, nonblocking = %d, for_kupdate = %d, " | 311 | "range_end = %llu, for_kupdate = %d, " |
314 | "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu", | 312 | "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu", |
315 | show_root_type(__entry->root_objectid), | 313 | show_root_type(__entry->root_objectid), |
316 | (unsigned long)__entry->ino, __entry->index, | 314 | (unsigned long)__entry->ino, __entry->index, |
317 | __entry->nr_to_write, __entry->pages_skipped, | 315 | __entry->nr_to_write, __entry->pages_skipped, |
318 | __entry->range_start, __entry->range_end, | 316 | __entry->range_start, __entry->range_end, |
319 | __entry->nonblocking, __entry->for_kupdate, | 317 | __entry->for_kupdate, |
320 | __entry->for_reclaim, __entry->range_cyclic, | 318 | __entry->for_reclaim, __entry->range_cyclic, |
321 | (unsigned long)__entry->writeback_index) | 319 | (unsigned long)__entry->writeback_index) |
322 | ); | 320 | ); |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 5ce2b2f5f524..6363193a3418 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -380,7 +380,6 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
380 | __field( int, pages_written ) | 380 | __field( int, pages_written ) |
381 | __field( long, pages_skipped ) | 381 | __field( long, pages_skipped ) |
382 | __field( int, sync_mode ) | 382 | __field( int, sync_mode ) |
383 | __field( char, more_io ) | ||
384 | __field( pgoff_t, writeback_index ) | 383 | __field( pgoff_t, writeback_index ) |
385 | ), | 384 | ), |
386 | 385 | ||
@@ -391,16 +390,15 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
391 | __entry->pages_written = pages_written; | 390 | __entry->pages_written = pages_written; |
392 | __entry->pages_skipped = wbc->pages_skipped; | 391 | __entry->pages_skipped = wbc->pages_skipped; |
393 | __entry->sync_mode = wbc->sync_mode; | 392 | __entry->sync_mode = wbc->sync_mode; |
394 | __entry->more_io = wbc->more_io; | ||
395 | __entry->writeback_index = inode->i_mapping->writeback_index; | 393 | __entry->writeback_index = inode->i_mapping->writeback_index; |
396 | ), | 394 | ), |
397 | 395 | ||
398 | TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld " | 396 | TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld " |
399 | " more_io %d sync_mode %d writeback_index %lu", | 397 | "sync_mode %d writeback_index %lu", |
400 | MAJOR(__entry->dev), MINOR(__entry->dev), | 398 | MAJOR(__entry->dev), MINOR(__entry->dev), |
401 | (unsigned long) __entry->ino, __entry->ret, | 399 | (unsigned long) __entry->ino, __entry->ret, |
402 | __entry->pages_written, __entry->pages_skipped, | 400 | __entry->pages_written, __entry->pages_skipped, |
403 | __entry->more_io, __entry->sync_mode, | 401 | __entry->sync_mode, |
404 | (unsigned long) __entry->writeback_index) | 402 | (unsigned long) __entry->writeback_index) |
405 | ); | 403 | ); |
406 | 404 | ||
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 4e249b927eaa..6bca4cc0063c 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -8,6 +8,19 @@ | |||
8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
9 | #include <linux/writeback.h> | 9 | #include <linux/writeback.h> |
10 | 10 | ||
11 | #define show_inode_state(state) \ | ||
12 | __print_flags(state, "|", \ | ||
13 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ | ||
14 | {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ | ||
15 | {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ | ||
16 | {I_NEW, "I_NEW"}, \ | ||
17 | {I_WILL_FREE, "I_WILL_FREE"}, \ | ||
18 | {I_FREEING, "I_FREEING"}, \ | ||
19 | {I_CLEAR, "I_CLEAR"}, \ | ||
20 | {I_SYNC, "I_SYNC"}, \ | ||
21 | {I_REFERENCED, "I_REFERENCED"} \ | ||
22 | ) | ||
23 | |||
11 | struct wb_writeback_work; | 24 | struct wb_writeback_work; |
12 | 25 | ||
13 | DECLARE_EVENT_CLASS(writeback_work_class, | 26 | DECLARE_EVENT_CLASS(writeback_work_class, |
@@ -49,6 +62,9 @@ DEFINE_EVENT(writeback_work_class, name, \ | |||
49 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); | 62 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); |
50 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); | 63 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); |
51 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); | 64 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); |
65 | DEFINE_WRITEBACK_WORK_EVENT(writeback_start); | ||
66 | DEFINE_WRITEBACK_WORK_EVENT(writeback_written); | ||
67 | DEFINE_WRITEBACK_WORK_EVENT(writeback_wait); | ||
52 | 68 | ||
53 | TRACE_EVENT(writeback_pages_written, | 69 | TRACE_EVENT(writeback_pages_written, |
54 | TP_PROTO(long pages_written), | 70 | TP_PROTO(long pages_written), |
@@ -88,6 +104,30 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | |||
88 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); | 104 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); |
89 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); | 105 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); |
90 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); | 106 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); |
107 | DEFINE_WRITEBACK_EVENT(balance_dirty_start); | ||
108 | DEFINE_WRITEBACK_EVENT(balance_dirty_wait); | ||
109 | |||
110 | TRACE_EVENT(balance_dirty_written, | ||
111 | |||
112 | TP_PROTO(struct backing_dev_info *bdi, int written), | ||
113 | |||
114 | TP_ARGS(bdi, written), | ||
115 | |||
116 | TP_STRUCT__entry( | ||
117 | __array(char, name, 32) | ||
118 | __field(int, written) | ||
119 | ), | ||
120 | |||
121 | TP_fast_assign( | ||
122 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
123 | __entry->written = written; | ||
124 | ), | ||
125 | |||
126 | TP_printk("bdi %s written %d", | ||
127 | __entry->name, | ||
128 | __entry->written | ||
129 | ) | ||
130 | ); | ||
91 | 131 | ||
92 | DECLARE_EVENT_CLASS(wbc_class, | 132 | DECLARE_EVENT_CLASS(wbc_class, |
93 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), | 133 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), |
@@ -101,8 +141,6 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
101 | __field(int, for_background) | 141 | __field(int, for_background) |
102 | __field(int, for_reclaim) | 142 | __field(int, for_reclaim) |
103 | __field(int, range_cyclic) | 143 | __field(int, range_cyclic) |
104 | __field(int, more_io) | ||
105 | __field(unsigned long, older_than_this) | ||
106 | __field(long, range_start) | 144 | __field(long, range_start) |
107 | __field(long, range_end) | 145 | __field(long, range_end) |
108 | ), | 146 | ), |
@@ -116,15 +154,12 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
116 | __entry->for_background = wbc->for_background; | 154 | __entry->for_background = wbc->for_background; |
117 | __entry->for_reclaim = wbc->for_reclaim; | 155 | __entry->for_reclaim = wbc->for_reclaim; |
118 | __entry->range_cyclic = wbc->range_cyclic; | 156 | __entry->range_cyclic = wbc->range_cyclic; |
119 | __entry->more_io = wbc->more_io; | ||
120 | __entry->older_than_this = wbc->older_than_this ? | ||
121 | *wbc->older_than_this : 0; | ||
122 | __entry->range_start = (long)wbc->range_start; | 157 | __entry->range_start = (long)wbc->range_start; |
123 | __entry->range_end = (long)wbc->range_end; | 158 | __entry->range_end = (long)wbc->range_end; |
124 | ), | 159 | ), |
125 | 160 | ||
126 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " | 161 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " |
127 | "bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx " | 162 | "bgrd=%d reclm=%d cyclic=%d " |
128 | "start=0x%lx end=0x%lx", | 163 | "start=0x%lx end=0x%lx", |
129 | __entry->name, | 164 | __entry->name, |
130 | __entry->nr_to_write, | 165 | __entry->nr_to_write, |
@@ -134,8 +169,6 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
134 | __entry->for_background, | 169 | __entry->for_background, |
135 | __entry->for_reclaim, | 170 | __entry->for_reclaim, |
136 | __entry->range_cyclic, | 171 | __entry->range_cyclic, |
137 | __entry->more_io, | ||
138 | __entry->older_than_this, | ||
139 | __entry->range_start, | 172 | __entry->range_start, |
140 | __entry->range_end) | 173 | __entry->range_end) |
141 | ) | 174 | ) |
@@ -144,14 +177,79 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
144 | DEFINE_EVENT(wbc_class, name, \ | 177 | DEFINE_EVENT(wbc_class, name, \ |
145 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ | 178 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ |
146 | TP_ARGS(wbc, bdi)) | 179 | TP_ARGS(wbc, bdi)) |
147 | DEFINE_WBC_EVENT(wbc_writeback_start); | ||
148 | DEFINE_WBC_EVENT(wbc_writeback_written); | ||
149 | DEFINE_WBC_EVENT(wbc_writeback_wait); | ||
150 | DEFINE_WBC_EVENT(wbc_balance_dirty_start); | ||
151 | DEFINE_WBC_EVENT(wbc_balance_dirty_written); | ||
152 | DEFINE_WBC_EVENT(wbc_balance_dirty_wait); | ||
153 | DEFINE_WBC_EVENT(wbc_writepage); | 180 | DEFINE_WBC_EVENT(wbc_writepage); |
154 | 181 | ||
182 | TRACE_EVENT(writeback_queue_io, | ||
183 | TP_PROTO(struct bdi_writeback *wb, | ||
184 | unsigned long *older_than_this, | ||
185 | int moved), | ||
186 | TP_ARGS(wb, older_than_this, moved), | ||
187 | TP_STRUCT__entry( | ||
188 | __array(char, name, 32) | ||
189 | __field(unsigned long, older) | ||
190 | __field(long, age) | ||
191 | __field(int, moved) | ||
192 | ), | ||
193 | TP_fast_assign( | ||
194 | strncpy(__entry->name, dev_name(wb->bdi->dev), 32); | ||
195 | __entry->older = older_than_this ? *older_than_this : 0; | ||
196 | __entry->age = older_than_this ? | ||
197 | (jiffies - *older_than_this) * 1000 / HZ : -1; | ||
198 | __entry->moved = moved; | ||
199 | ), | ||
200 | TP_printk("bdi %s: older=%lu age=%ld enqueue=%d", | ||
201 | __entry->name, | ||
202 | __entry->older, /* older_than_this in jiffies */ | ||
203 | __entry->age, /* older_than_this in relative milliseconds */ | ||
204 | __entry->moved) | ||
205 | ); | ||
206 | |||
207 | TRACE_EVENT(global_dirty_state, | ||
208 | |||
209 | TP_PROTO(unsigned long background_thresh, | ||
210 | unsigned long dirty_thresh | ||
211 | ), | ||
212 | |||
213 | TP_ARGS(background_thresh, | ||
214 | dirty_thresh | ||
215 | ), | ||
216 | |||
217 | TP_STRUCT__entry( | ||
218 | __field(unsigned long, nr_dirty) | ||
219 | __field(unsigned long, nr_writeback) | ||
220 | __field(unsigned long, nr_unstable) | ||
221 | __field(unsigned long, background_thresh) | ||
222 | __field(unsigned long, dirty_thresh) | ||
223 | __field(unsigned long, dirty_limit) | ||
224 | __field(unsigned long, nr_dirtied) | ||
225 | __field(unsigned long, nr_written) | ||
226 | ), | ||
227 | |||
228 | TP_fast_assign( | ||
229 | __entry->nr_dirty = global_page_state(NR_FILE_DIRTY); | ||
230 | __entry->nr_writeback = global_page_state(NR_WRITEBACK); | ||
231 | __entry->nr_unstable = global_page_state(NR_UNSTABLE_NFS); | ||
232 | __entry->nr_dirtied = global_page_state(NR_DIRTIED); | ||
233 | __entry->nr_written = global_page_state(NR_WRITTEN); | ||
234 | __entry->background_thresh = background_thresh; | ||
235 | __entry->dirty_thresh = dirty_thresh; | ||
236 | __entry->dirty_limit = global_dirty_limit; | ||
237 | ), | ||
238 | |||
239 | TP_printk("dirty=%lu writeback=%lu unstable=%lu " | ||
240 | "bg_thresh=%lu thresh=%lu limit=%lu " | ||
241 | "dirtied=%lu written=%lu", | ||
242 | __entry->nr_dirty, | ||
243 | __entry->nr_writeback, | ||
244 | __entry->nr_unstable, | ||
245 | __entry->background_thresh, | ||
246 | __entry->dirty_thresh, | ||
247 | __entry->dirty_limit, | ||
248 | __entry->nr_dirtied, | ||
249 | __entry->nr_written | ||
250 | ) | ||
251 | ); | ||
252 | |||
155 | DECLARE_EVENT_CLASS(writeback_congest_waited_template, | 253 | DECLARE_EVENT_CLASS(writeback_congest_waited_template, |
156 | 254 | ||
157 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), | 255 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), |
@@ -187,6 +285,63 @@ DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested, | |||
187 | TP_ARGS(usec_timeout, usec_delayed) | 285 | TP_ARGS(usec_timeout, usec_delayed) |
188 | ); | 286 | ); |
189 | 287 | ||
288 | DECLARE_EVENT_CLASS(writeback_single_inode_template, | ||
289 | |||
290 | TP_PROTO(struct inode *inode, | ||
291 | struct writeback_control *wbc, | ||
292 | unsigned long nr_to_write | ||
293 | ), | ||
294 | |||
295 | TP_ARGS(inode, wbc, nr_to_write), | ||
296 | |||
297 | TP_STRUCT__entry( | ||
298 | __array(char, name, 32) | ||
299 | __field(unsigned long, ino) | ||
300 | __field(unsigned long, state) | ||
301 | __field(unsigned long, age) | ||
302 | __field(unsigned long, writeback_index) | ||
303 | __field(long, nr_to_write) | ||
304 | __field(unsigned long, wrote) | ||
305 | ), | ||
306 | |||
307 | TP_fast_assign( | ||
308 | strncpy(__entry->name, | ||
309 | dev_name(inode->i_mapping->backing_dev_info->dev), 32); | ||
310 | __entry->ino = inode->i_ino; | ||
311 | __entry->state = inode->i_state; | ||
312 | __entry->age = (jiffies - inode->dirtied_when) * | ||
313 | 1000 / HZ; | ||
314 | __entry->writeback_index = inode->i_mapping->writeback_index; | ||
315 | __entry->nr_to_write = nr_to_write; | ||
316 | __entry->wrote = nr_to_write - wbc->nr_to_write; | ||
317 | ), | ||
318 | |||
319 | TP_printk("bdi %s: ino=%lu state=%s age=%lu " | ||
320 | "index=%lu to_write=%ld wrote=%lu", | ||
321 | __entry->name, | ||
322 | __entry->ino, | ||
323 | show_inode_state(__entry->state), | ||
324 | __entry->age, | ||
325 | __entry->writeback_index, | ||
326 | __entry->nr_to_write, | ||
327 | __entry->wrote | ||
328 | ) | ||
329 | ); | ||
330 | |||
331 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode_requeue, | ||
332 | TP_PROTO(struct inode *inode, | ||
333 | struct writeback_control *wbc, | ||
334 | unsigned long nr_to_write), | ||
335 | TP_ARGS(inode, wbc, nr_to_write) | ||
336 | ); | ||
337 | |||
338 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode, | ||
339 | TP_PROTO(struct inode *inode, | ||
340 | struct writeback_control *wbc, | ||
341 | unsigned long nr_to_write), | ||
342 | TP_ARGS(inode, wbc, nr_to_write) | ||
343 | ); | ||
344 | |||
190 | #endif /* _TRACE_WRITEBACK_H */ | 345 | #endif /* _TRACE_WRITEBACK_H */ |
191 | 346 | ||
192 | /* This part must be outside protection */ | 347 | /* This part must be outside protection */ |