Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM writeback |
| 3 | |
| 4 | #if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_WRITEBACK_H |
| 6 | |
| 7 | #include <linux/backing-dev.h> |
| 8 | #include <linux/writeback.h> |
| 9 | |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 10 | #define show_inode_state(state) \ |
| 11 | __print_flags(state, "|", \ |
| 12 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ |
| 13 | {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ |
| 14 | {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ |
| 15 | {I_NEW, "I_NEW"}, \ |
| 16 | {I_WILL_FREE, "I_WILL_FREE"}, \ |
| 17 | {I_FREEING, "I_FREEING"}, \ |
| 18 | {I_CLEAR, "I_CLEAR"}, \ |
| 19 | {I_SYNC, "I_SYNC"}, \ |
| 20 | {I_REFERENCED, "I_REFERENCED"} \ |
| 21 | ) |
| 22 | |
Wu Fengguang | b3bba872 | 2011-12-08 16:53:54 -0600 | [diff] [blame] | 23 | #define WB_WORK_REASON \ |
| 24 | {WB_REASON_BACKGROUND, "background"}, \ |
| 25 | {WB_REASON_TRY_TO_FREE_PAGES, "try_to_free_pages"}, \ |
| 26 | {WB_REASON_SYNC, "sync"}, \ |
| 27 | {WB_REASON_PERIODIC, "periodic"}, \ |
| 28 | {WB_REASON_LAPTOP_TIMER, "laptop_timer"}, \ |
| 29 | {WB_REASON_FREE_MORE_MEM, "free_more_memory"}, \ |
| 30 | {WB_REASON_FS_FREE_SPACE, "fs_free_space"}, \ |
| 31 | {WB_REASON_FORKER_THREAD, "forker_thread"} |
| 32 | |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 33 | struct wb_writeback_work; |
| 34 | |
| 35 | DECLARE_EVENT_CLASS(writeback_work_class, |
| 36 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), |
| 37 | TP_ARGS(bdi, work), |
| 38 | TP_STRUCT__entry( |
| 39 | __array(char, name, 32) |
| 40 | __field(long, nr_pages) |
| 41 | __field(dev_t, sb_dev) |
| 42 | __field(int, sync_mode) |
| 43 | __field(int, for_kupdate) |
| 44 | __field(int, range_cyclic) |
| 45 | __field(int, for_background) |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 46 | __field(int, reason) |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 47 | ), |
| 48 | TP_fast_assign( |
Wu Fengguang | 977b7e3 | 2012-02-04 20:54:03 -0600 | [diff] [blame] | 49 | struct device *dev = bdi->dev; |
| 50 | if (!dev) |
| 51 | dev = default_backing_dev_info.dev; |
| 52 | strncpy(__entry->name, dev_name(dev), 32); |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 53 | __entry->nr_pages = work->nr_pages; |
| 54 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; |
| 55 | __entry->sync_mode = work->sync_mode; |
| 56 | __entry->for_kupdate = work->for_kupdate; |
| 57 | __entry->range_cyclic = work->range_cyclic; |
| 58 | __entry->for_background = work->for_background; |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 59 | __entry->reason = work->reason; |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 60 | ), |
| 61 | TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 62 | "kupdate=%d range_cyclic=%d background=%d reason=%s", |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 63 | __entry->name, |
| 64 | MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), |
| 65 | __entry->nr_pages, |
| 66 | __entry->sync_mode, |
| 67 | __entry->for_kupdate, |
| 68 | __entry->range_cyclic, |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 69 | __entry->for_background, |
Wu Fengguang | b3bba872 | 2011-12-08 16:53:54 -0600 | [diff] [blame] | 70 | __print_symbolic(__entry->reason, WB_WORK_REASON) |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 71 | ) |
| 72 | ); |
| 73 | #define DEFINE_WRITEBACK_WORK_EVENT(name) \ |
| 74 | DEFINE_EVENT(writeback_work_class, name, \ |
| 75 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \ |
| 76 | TP_ARGS(bdi, work)) |
| 77 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); |
| 78 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); |
| 79 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); |
Wu Fengguang | d46db3d | 2011-05-04 19:54:37 -0600 | [diff] [blame] | 80 | DEFINE_WRITEBACK_WORK_EVENT(writeback_start); |
| 81 | DEFINE_WRITEBACK_WORK_EVENT(writeback_written); |
| 82 | DEFINE_WRITEBACK_WORK_EVENT(writeback_wait); |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 83 | |
| 84 | TRACE_EVENT(writeback_pages_written, |
| 85 | TP_PROTO(long pages_written), |
| 86 | TP_ARGS(pages_written), |
| 87 | TP_STRUCT__entry( |
| 88 | __field(long, pages) |
| 89 | ), |
| 90 | TP_fast_assign( |
| 91 | __entry->pages = pages_written; |
| 92 | ), |
| 93 | TP_printk("%ld", __entry->pages) |
| 94 | ); |
| 95 | |
| 96 | DECLARE_EVENT_CLASS(writeback_class, |
| 97 | TP_PROTO(struct backing_dev_info *bdi), |
| 98 | TP_ARGS(bdi), |
| 99 | TP_STRUCT__entry( |
| 100 | __array(char, name, 32) |
| 101 | ), |
| 102 | TP_fast_assign( |
| 103 | strncpy(__entry->name, dev_name(bdi->dev), 32); |
| 104 | ), |
| 105 | TP_printk("bdi %s", |
| 106 | __entry->name |
| 107 | ) |
| 108 | ); |
| 109 | #define DEFINE_WRITEBACK_EVENT(name) \ |
| 110 | DEFINE_EVENT(writeback_class, name, \ |
| 111 | TP_PROTO(struct backing_dev_info *bdi), \ |
| 112 | TP_ARGS(bdi)) |
| 113 | |
| 114 | DEFINE_WRITEBACK_EVENT(writeback_nowork); |
Wu Fengguang | 71927e8 | 2011-01-13 15:45:46 -0800 | [diff] [blame] | 115 | DEFINE_WRITEBACK_EVENT(writeback_wake_background); |
Artem Bityutskiy | 6033202 | 2010-07-25 14:29:24 +0300 | [diff] [blame] | 116 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread); |
| 117 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 118 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register); |
| 119 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); |
| 120 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); |
| 121 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); |
| 122 | |
Dave Chinner | 028c2dd | 2010-07-07 13:24:07 +1000 | [diff] [blame] | 123 | DECLARE_EVENT_CLASS(wbc_class, |
| 124 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), |
| 125 | TP_ARGS(wbc, bdi), |
| 126 | TP_STRUCT__entry( |
| 127 | __array(char, name, 32) |
| 128 | __field(long, nr_to_write) |
| 129 | __field(long, pages_skipped) |
| 130 | __field(int, sync_mode) |
Dave Chinner | 028c2dd | 2010-07-07 13:24:07 +1000 | [diff] [blame] | 131 | __field(int, for_kupdate) |
| 132 | __field(int, for_background) |
| 133 | __field(int, for_reclaim) |
| 134 | __field(int, range_cyclic) |
Dave Chinner | 028c2dd | 2010-07-07 13:24:07 +1000 | [diff] [blame] | 135 | __field(long, range_start) |
| 136 | __field(long, range_end) |
| 137 | ), |
| 138 | |
| 139 | TP_fast_assign( |
| 140 | strncpy(__entry->name, dev_name(bdi->dev), 32); |
| 141 | __entry->nr_to_write = wbc->nr_to_write; |
| 142 | __entry->pages_skipped = wbc->pages_skipped; |
| 143 | __entry->sync_mode = wbc->sync_mode; |
| 144 | __entry->for_kupdate = wbc->for_kupdate; |
| 145 | __entry->for_background = wbc->for_background; |
| 146 | __entry->for_reclaim = wbc->for_reclaim; |
| 147 | __entry->range_cyclic = wbc->range_cyclic; |
Dave Chinner | 028c2dd | 2010-07-07 13:24:07 +1000 | [diff] [blame] | 148 | __entry->range_start = (long)wbc->range_start; |
| 149 | __entry->range_end = (long)wbc->range_end; |
| 150 | ), |
| 151 | |
| 152 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " |
Wu Fengguang | d46db3d | 2011-05-04 19:54:37 -0600 | [diff] [blame] | 153 | "bgrd=%d reclm=%d cyclic=%d " |
Dave Chinner | 028c2dd | 2010-07-07 13:24:07 +1000 | [diff] [blame] | 154 | "start=0x%lx end=0x%lx", |
| 155 | __entry->name, |
| 156 | __entry->nr_to_write, |
| 157 | __entry->pages_skipped, |
| 158 | __entry->sync_mode, |
| 159 | __entry->for_kupdate, |
| 160 | __entry->for_background, |
| 161 | __entry->for_reclaim, |
| 162 | __entry->range_cyclic, |
Dave Chinner | 028c2dd | 2010-07-07 13:24:07 +1000 | [diff] [blame] | 163 | __entry->range_start, |
| 164 | __entry->range_end) |
| 165 | ) |
| 166 | |
| 167 | #define DEFINE_WBC_EVENT(name) \ |
| 168 | DEFINE_EVENT(wbc_class, name, \ |
| 169 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ |
| 170 | TP_ARGS(wbc, bdi)) |
Dave Chinner | 9e09438 | 2010-07-07 13:24:08 +1000 | [diff] [blame] | 171 | DEFINE_WBC_EVENT(wbc_writepage); |
Dave Chinner | 028c2dd | 2010-07-07 13:24:07 +1000 | [diff] [blame] | 172 | |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 173 | TRACE_EVENT(writeback_queue_io, |
| 174 | TP_PROTO(struct bdi_writeback *wb, |
Curt Wohlgemuth | ad4e38d | 2011-10-07 21:51:56 -0600 | [diff] [blame] | 175 | struct wb_writeback_work *work, |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 176 | int moved), |
Curt Wohlgemuth | ad4e38d | 2011-10-07 21:51:56 -0600 | [diff] [blame] | 177 | TP_ARGS(wb, work, moved), |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 178 | TP_STRUCT__entry( |
| 179 | __array(char, name, 32) |
| 180 | __field(unsigned long, older) |
| 181 | __field(long, age) |
| 182 | __field(int, moved) |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 183 | __field(int, reason) |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 184 | ), |
| 185 | TP_fast_assign( |
Curt Wohlgemuth | ad4e38d | 2011-10-07 21:51:56 -0600 | [diff] [blame] | 186 | unsigned long *older_than_this = work->older_than_this; |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 187 | strncpy(__entry->name, dev_name(wb->bdi->dev), 32); |
| 188 | __entry->older = older_than_this ? *older_than_this : 0; |
| 189 | __entry->age = older_than_this ? |
| 190 | (jiffies - *older_than_this) * 1000 / HZ : -1; |
| 191 | __entry->moved = moved; |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 192 | __entry->reason = work->reason; |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 193 | ), |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 194 | TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s", |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 195 | __entry->name, |
| 196 | __entry->older, /* older_than_this in jiffies */ |
| 197 | __entry->age, /* older_than_this in relative milliseconds */ |
Curt Wohlgemuth | 0e175a1 | 2011-10-07 21:54:10 -0600 | [diff] [blame] | 198 | __entry->moved, |
Wu Fengguang | b3bba872 | 2011-12-08 16:53:54 -0600 | [diff] [blame] | 199 | __print_symbolic(__entry->reason, WB_WORK_REASON) |
| 200 | ) |
Wu Fengguang | e84d0a4 | 2011-04-23 12:27:27 -0600 | [diff] [blame] | 201 | ); |
| 202 | |
Wu Fengguang | e1cbe23 | 2010-12-06 22:34:29 -0600 | [diff] [blame] | 203 | TRACE_EVENT(global_dirty_state, |
| 204 | |
| 205 | TP_PROTO(unsigned long background_thresh, |
| 206 | unsigned long dirty_thresh |
| 207 | ), |
| 208 | |
| 209 | TP_ARGS(background_thresh, |
| 210 | dirty_thresh |
| 211 | ), |
| 212 | |
| 213 | TP_STRUCT__entry( |
| 214 | __field(unsigned long, nr_dirty) |
| 215 | __field(unsigned long, nr_writeback) |
| 216 | __field(unsigned long, nr_unstable) |
| 217 | __field(unsigned long, background_thresh) |
| 218 | __field(unsigned long, dirty_thresh) |
| 219 | __field(unsigned long, dirty_limit) |
| 220 | __field(unsigned long, nr_dirtied) |
| 221 | __field(unsigned long, nr_written) |
| 222 | ), |
| 223 | |
| 224 | TP_fast_assign( |
| 225 | __entry->nr_dirty = global_page_state(NR_FILE_DIRTY); |
| 226 | __entry->nr_writeback = global_page_state(NR_WRITEBACK); |
| 227 | __entry->nr_unstable = global_page_state(NR_UNSTABLE_NFS); |
| 228 | __entry->nr_dirtied = global_page_state(NR_DIRTIED); |
| 229 | __entry->nr_written = global_page_state(NR_WRITTEN); |
| 230 | __entry->background_thresh = background_thresh; |
| 231 | __entry->dirty_thresh = dirty_thresh; |
| 232 | __entry->dirty_limit = global_dirty_limit; |
| 233 | ), |
| 234 | |
| 235 | TP_printk("dirty=%lu writeback=%lu unstable=%lu " |
| 236 | "bg_thresh=%lu thresh=%lu limit=%lu " |
| 237 | "dirtied=%lu written=%lu", |
| 238 | __entry->nr_dirty, |
| 239 | __entry->nr_writeback, |
| 240 | __entry->nr_unstable, |
| 241 | __entry->background_thresh, |
| 242 | __entry->dirty_thresh, |
| 243 | __entry->dirty_limit, |
| 244 | __entry->nr_dirtied, |
| 245 | __entry->nr_written |
| 246 | ) |
| 247 | ); |
| 248 | |
Wu Fengguang | b48c104 | 2011-03-02 17:22:49 -0600 | [diff] [blame] | 249 | #define KBps(x) ((x) << (PAGE_SHIFT - 10)) |
| 250 | |
| 251 | TRACE_EVENT(bdi_dirty_ratelimit, |
| 252 | |
| 253 | TP_PROTO(struct backing_dev_info *bdi, |
| 254 | unsigned long dirty_rate, |
| 255 | unsigned long task_ratelimit), |
| 256 | |
| 257 | TP_ARGS(bdi, dirty_rate, task_ratelimit), |
| 258 | |
| 259 | TP_STRUCT__entry( |
| 260 | __array(char, bdi, 32) |
| 261 | __field(unsigned long, write_bw) |
| 262 | __field(unsigned long, avg_write_bw) |
| 263 | __field(unsigned long, dirty_rate) |
| 264 | __field(unsigned long, dirty_ratelimit) |
| 265 | __field(unsigned long, task_ratelimit) |
| 266 | __field(unsigned long, balanced_dirty_ratelimit) |
| 267 | ), |
| 268 | |
| 269 | TP_fast_assign( |
| 270 | strlcpy(__entry->bdi, dev_name(bdi->dev), 32); |
| 271 | __entry->write_bw = KBps(bdi->write_bandwidth); |
| 272 | __entry->avg_write_bw = KBps(bdi->avg_write_bandwidth); |
| 273 | __entry->dirty_rate = KBps(dirty_rate); |
| 274 | __entry->dirty_ratelimit = KBps(bdi->dirty_ratelimit); |
| 275 | __entry->task_ratelimit = KBps(task_ratelimit); |
| 276 | __entry->balanced_dirty_ratelimit = |
| 277 | KBps(bdi->balanced_dirty_ratelimit); |
| 278 | ), |
| 279 | |
| 280 | TP_printk("bdi %s: " |
| 281 | "write_bw=%lu awrite_bw=%lu dirty_rate=%lu " |
| 282 | "dirty_ratelimit=%lu task_ratelimit=%lu " |
| 283 | "balanced_dirty_ratelimit=%lu", |
| 284 | __entry->bdi, |
| 285 | __entry->write_bw, /* write bandwidth */ |
| 286 | __entry->avg_write_bw, /* avg write bandwidth */ |
| 287 | __entry->dirty_rate, /* bdi dirty rate */ |
| 288 | __entry->dirty_ratelimit, /* base ratelimit */ |
| 289 | __entry->task_ratelimit, /* ratelimit with position control */ |
| 290 | __entry->balanced_dirty_ratelimit /* the balanced ratelimit */ |
| 291 | ) |
| 292 | ); |
| 293 | |
Wu Fengguang | ece13ac3 | 2010-08-29 23:33:20 -0600 | [diff] [blame] | 294 | TRACE_EVENT(balance_dirty_pages, |
| 295 | |
| 296 | TP_PROTO(struct backing_dev_info *bdi, |
| 297 | unsigned long thresh, |
| 298 | unsigned long bg_thresh, |
| 299 | unsigned long dirty, |
| 300 | unsigned long bdi_thresh, |
| 301 | unsigned long bdi_dirty, |
| 302 | unsigned long dirty_ratelimit, |
| 303 | unsigned long task_ratelimit, |
| 304 | unsigned long dirtied, |
Wu Fengguang | 8371235 | 2011-06-11 19:25:42 -0600 | [diff] [blame] | 305 | unsigned long period, |
Wu Fengguang | ece13ac3 | 2010-08-29 23:33:20 -0600 | [diff] [blame] | 306 | long pause, |
| 307 | unsigned long start_time), |
| 308 | |
| 309 | TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, |
| 310 | dirty_ratelimit, task_ratelimit, |
Wu Fengguang | 8371235 | 2011-06-11 19:25:42 -0600 | [diff] [blame] | 311 | dirtied, period, pause, start_time), |
Wu Fengguang | ece13ac3 | 2010-08-29 23:33:20 -0600 | [diff] [blame] | 312 | |
| 313 | TP_STRUCT__entry( |
| 314 | __array( char, bdi, 32) |
| 315 | __field(unsigned long, limit) |
| 316 | __field(unsigned long, setpoint) |
| 317 | __field(unsigned long, dirty) |
| 318 | __field(unsigned long, bdi_setpoint) |
| 319 | __field(unsigned long, bdi_dirty) |
| 320 | __field(unsigned long, dirty_ratelimit) |
| 321 | __field(unsigned long, task_ratelimit) |
| 322 | __field(unsigned int, dirtied) |
| 323 | __field(unsigned int, dirtied_pause) |
| 324 | __field(unsigned long, paused) |
| 325 | __field( long, pause) |
Wu Fengguang | 8371235 | 2011-06-11 19:25:42 -0600 | [diff] [blame] | 326 | __field(unsigned long, period) |
| 327 | __field( long, think) |
Wu Fengguang | ece13ac3 | 2010-08-29 23:33:20 -0600 | [diff] [blame] | 328 | ), |
| 329 | |
| 330 | TP_fast_assign( |
| 331 | unsigned long freerun = (thresh + bg_thresh) / 2; |
| 332 | strlcpy(__entry->bdi, dev_name(bdi->dev), 32); |
| 333 | |
| 334 | __entry->limit = global_dirty_limit; |
| 335 | __entry->setpoint = (global_dirty_limit + freerun) / 2; |
| 336 | __entry->dirty = dirty; |
| 337 | __entry->bdi_setpoint = __entry->setpoint * |
| 338 | bdi_thresh / (thresh + 1); |
| 339 | __entry->bdi_dirty = bdi_dirty; |
| 340 | __entry->dirty_ratelimit = KBps(dirty_ratelimit); |
| 341 | __entry->task_ratelimit = KBps(task_ratelimit); |
| 342 | __entry->dirtied = dirtied; |
| 343 | __entry->dirtied_pause = current->nr_dirtied_pause; |
Wu Fengguang | 8371235 | 2011-06-11 19:25:42 -0600 | [diff] [blame] | 344 | __entry->think = current->dirty_paused_when == 0 ? 0 : |
| 345 | (long)(jiffies - current->dirty_paused_when) * 1000/HZ; |
| 346 | __entry->period = period * 1000 / HZ; |
Wu Fengguang | ece13ac3 | 2010-08-29 23:33:20 -0600 | [diff] [blame] | 347 | __entry->pause = pause * 1000 / HZ; |
| 348 | __entry->paused = (jiffies - start_time) * 1000 / HZ; |
| 349 | ), |
| 350 | |
| 351 | |
| 352 | TP_printk("bdi %s: " |
| 353 | "limit=%lu setpoint=%lu dirty=%lu " |
| 354 | "bdi_setpoint=%lu bdi_dirty=%lu " |
| 355 | "dirty_ratelimit=%lu task_ratelimit=%lu " |
| 356 | "dirtied=%u dirtied_pause=%u " |
Wu Fengguang | 8371235 | 2011-06-11 19:25:42 -0600 | [diff] [blame] | 357 | "paused=%lu pause=%ld period=%lu think=%ld", |
Wu Fengguang | ece13ac3 | 2010-08-29 23:33:20 -0600 | [diff] [blame] | 358 | __entry->bdi, |
| 359 | __entry->limit, |
| 360 | __entry->setpoint, |
| 361 | __entry->dirty, |
| 362 | __entry->bdi_setpoint, |
| 363 | __entry->bdi_dirty, |
| 364 | __entry->dirty_ratelimit, |
| 365 | __entry->task_ratelimit, |
| 366 | __entry->dirtied, |
| 367 | __entry->dirtied_pause, |
| 368 | __entry->paused, /* ms */ |
Wu Fengguang | 8371235 | 2011-06-11 19:25:42 -0600 | [diff] [blame] | 369 | __entry->pause, /* ms */ |
| 370 | __entry->period, /* ms */ |
| 371 | __entry->think /* ms */ |
Wu Fengguang | ece13ac3 | 2010-08-29 23:33:20 -0600 | [diff] [blame] | 372 | ) |
| 373 | ); |
| 374 | |
Jan Kara | cc1676d | 2012-05-03 14:47:56 +0200 | [diff] [blame^] | 375 | TRACE_EVENT(writeback_sb_inodes_requeue, |
| 376 | |
| 377 | TP_PROTO(struct inode *inode), |
| 378 | TP_ARGS(inode), |
| 379 | |
| 380 | TP_STRUCT__entry( |
| 381 | __array(char, name, 32) |
| 382 | __field(unsigned long, ino) |
| 383 | __field(unsigned long, state) |
| 384 | __field(unsigned long, dirtied_when) |
| 385 | ), |
| 386 | |
| 387 | TP_fast_assign( |
| 388 | strncpy(__entry->name, |
| 389 | dev_name(inode_to_bdi(inode)->dev), 32); |
| 390 | __entry->ino = inode->i_ino; |
| 391 | __entry->state = inode->i_state; |
| 392 | __entry->dirtied_when = inode->dirtied_when; |
| 393 | ), |
| 394 | |
| 395 | TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu", |
| 396 | __entry->name, |
| 397 | __entry->ino, |
| 398 | show_inode_state(__entry->state), |
| 399 | __entry->dirtied_when, |
| 400 | (jiffies - __entry->dirtied_when) / HZ |
| 401 | ) |
| 402 | ); |
| 403 | |
Mel Gorman | 52bb919 | 2010-10-26 14:21:41 -0700 | [diff] [blame] | 404 | DECLARE_EVENT_CLASS(writeback_congest_waited_template, |
| 405 | |
| 406 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), |
| 407 | |
| 408 | TP_ARGS(usec_timeout, usec_delayed), |
| 409 | |
| 410 | TP_STRUCT__entry( |
| 411 | __field( unsigned int, usec_timeout ) |
| 412 | __field( unsigned int, usec_delayed ) |
| 413 | ), |
| 414 | |
| 415 | TP_fast_assign( |
| 416 | __entry->usec_timeout = usec_timeout; |
| 417 | __entry->usec_delayed = usec_delayed; |
| 418 | ), |
| 419 | |
| 420 | TP_printk("usec_timeout=%u usec_delayed=%u", |
| 421 | __entry->usec_timeout, |
| 422 | __entry->usec_delayed) |
| 423 | ); |
| 424 | |
| 425 | DEFINE_EVENT(writeback_congest_waited_template, writeback_congestion_wait, |
| 426 | |
| 427 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), |
| 428 | |
| 429 | TP_ARGS(usec_timeout, usec_delayed) |
| 430 | ); |
| 431 | |
Mel Gorman | 0e093d99 | 2010-10-26 14:21:45 -0700 | [diff] [blame] | 432 | DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested, |
| 433 | |
| 434 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), |
| 435 | |
| 436 | TP_ARGS(usec_timeout, usec_delayed) |
| 437 | ); |
| 438 | |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 439 | DECLARE_EVENT_CLASS(writeback_single_inode_template, |
| 440 | |
| 441 | TP_PROTO(struct inode *inode, |
| 442 | struct writeback_control *wbc, |
| 443 | unsigned long nr_to_write |
| 444 | ), |
| 445 | |
| 446 | TP_ARGS(inode, wbc, nr_to_write), |
| 447 | |
| 448 | TP_STRUCT__entry( |
| 449 | __array(char, name, 32) |
| 450 | __field(unsigned long, ino) |
| 451 | __field(unsigned long, state) |
Wu Fengguang | c8ad620 | 2011-08-29 09:52:23 -0600 | [diff] [blame] | 452 | __field(unsigned long, dirtied_when) |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 453 | __field(unsigned long, writeback_index) |
| 454 | __field(long, nr_to_write) |
| 455 | __field(unsigned long, wrote) |
| 456 | ), |
| 457 | |
| 458 | TP_fast_assign( |
| 459 | strncpy(__entry->name, |
Wu Fengguang | 15eb77a | 2012-01-17 11:18:56 -0600 | [diff] [blame] | 460 | dev_name(inode_to_bdi(inode)->dev), 32); |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 461 | __entry->ino = inode->i_ino; |
| 462 | __entry->state = inode->i_state; |
Wu Fengguang | c8ad620 | 2011-08-29 09:52:23 -0600 | [diff] [blame] | 463 | __entry->dirtied_when = inode->dirtied_when; |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 464 | __entry->writeback_index = inode->i_mapping->writeback_index; |
| 465 | __entry->nr_to_write = nr_to_write; |
| 466 | __entry->wrote = nr_to_write - wbc->nr_to_write; |
| 467 | ), |
| 468 | |
Wu Fengguang | c8ad620 | 2011-08-29 09:52:23 -0600 | [diff] [blame] | 469 | TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu " |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 470 | "index=%lu to_write=%ld wrote=%lu", |
| 471 | __entry->name, |
| 472 | __entry->ino, |
| 473 | show_inode_state(__entry->state), |
Wu Fengguang | c8ad620 | 2011-08-29 09:52:23 -0600 | [diff] [blame] | 474 | __entry->dirtied_when, |
| 475 | (jiffies - __entry->dirtied_when) / HZ, |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 476 | __entry->writeback_index, |
| 477 | __entry->nr_to_write, |
| 478 | __entry->wrote |
| 479 | ) |
| 480 | ); |
| 481 | |
Wu Fengguang | 251d6a4 | 2010-12-01 17:33:37 -0600 | [diff] [blame] | 482 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode, |
| 483 | TP_PROTO(struct inode *inode, |
| 484 | struct writeback_control *wbc, |
| 485 | unsigned long nr_to_write), |
| 486 | TP_ARGS(inode, wbc, nr_to_write) |
| 487 | ); |
| 488 | |
Dave Chinner | 455b286 | 2010-07-07 13:24:06 +1000 | [diff] [blame] | 489 | #endif /* _TRACE_WRITEBACK_H */ |
| 490 | |
| 491 | /* This part must be outside protection */ |
| 492 | #include <trace/define_trace.h> |