diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-07-06 23:24:07 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:24:25 -0400 |
commit | 028c2dd184c097809986684f2f0627eea5529fea (patch) | |
tree | f6eb9e30a24d73597e5ce2a65b4638e9d1947504 /include | |
parent | 455b2864686d3591b3b2f39eb46290c95f76471f (diff) |
writeback: Add tracing to balance_dirty_pages
Tracing high level background writeback events is good, but it doesn't
give the entire picture. Add visibility into write throttling to catch IO
dispatched by foreground throttling of processing dirtying lots of pages.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/trace/events/writeback.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 562fcae10d9d..0be26acae064 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -85,6 +85,70 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); | |||
85 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); | 85 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); |
86 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); | 86 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); |
87 | 87 | ||
88 | DECLARE_EVENT_CLASS(wbc_class, | ||
89 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), | ||
90 | TP_ARGS(wbc, bdi), | ||
91 | TP_STRUCT__entry( | ||
92 | __array(char, name, 32) | ||
93 | __field(long, nr_to_write) | ||
94 | __field(long, pages_skipped) | ||
95 | __field(int, sync_mode) | ||
96 | __field(int, nonblocking) | ||
97 | __field(int, encountered_congestion) | ||
98 | __field(int, for_kupdate) | ||
99 | __field(int, for_background) | ||
100 | __field(int, for_reclaim) | ||
101 | __field(int, range_cyclic) | ||
102 | __field(int, more_io) | ||
103 | __field(unsigned long, older_than_this) | ||
104 | __field(long, range_start) | ||
105 | __field(long, range_end) | ||
106 | ), | ||
107 | |||
108 | TP_fast_assign( | ||
109 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
110 | __entry->nr_to_write = wbc->nr_to_write; | ||
111 | __entry->pages_skipped = wbc->pages_skipped; | ||
112 | __entry->sync_mode = wbc->sync_mode; | ||
113 | __entry->for_kupdate = wbc->for_kupdate; | ||
114 | __entry->for_background = wbc->for_background; | ||
115 | __entry->for_reclaim = wbc->for_reclaim; | ||
116 | __entry->range_cyclic = wbc->range_cyclic; | ||
117 | __entry->more_io = wbc->more_io; | ||
118 | __entry->older_than_this = wbc->older_than_this ? | ||
119 | *wbc->older_than_this : 0; | ||
120 | __entry->range_start = (long)wbc->range_start; | ||
121 | __entry->range_end = (long)wbc->range_end; | ||
122 | ), | ||
123 | |||
124 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " | ||
125 | "bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx " | ||
126 | "start=0x%lx end=0x%lx", | ||
127 | __entry->name, | ||
128 | __entry->nr_to_write, | ||
129 | __entry->pages_skipped, | ||
130 | __entry->sync_mode, | ||
131 | __entry->for_kupdate, | ||
132 | __entry->for_background, | ||
133 | __entry->for_reclaim, | ||
134 | __entry->range_cyclic, | ||
135 | __entry->more_io, | ||
136 | __entry->older_than_this, | ||
137 | __entry->range_start, | ||
138 | __entry->range_end) | ||
139 | ) | ||
140 | |||
141 | #define DEFINE_WBC_EVENT(name) \ | ||
142 | DEFINE_EVENT(wbc_class, name, \ | ||
143 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ | ||
144 | TP_ARGS(wbc, bdi)) | ||
145 | DEFINE_WBC_EVENT(wbc_writeback_start); | ||
146 | DEFINE_WBC_EVENT(wbc_writeback_written); | ||
147 | DEFINE_WBC_EVENT(wbc_writeback_wait); | ||
148 | DEFINE_WBC_EVENT(wbc_balance_dirty_start); | ||
149 | DEFINE_WBC_EVENT(wbc_balance_dirty_written); | ||
150 | DEFINE_WBC_EVENT(wbc_balance_dirty_wait); | ||
151 | |||
88 | #endif /* _TRACE_WRITEBACK_H */ | 152 | #endif /* _TRACE_WRITEBACK_H */ |
89 | 153 | ||
90 | /* This part must be outside protection */ | 154 | /* This part must be outside protection */ |