2 #define TRACE_SYSTEM writeback
4 #if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_WRITEBACK_H
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"}, \
16 {I_WILL_FREE, "I_WILL_FREE"}, \
17 {I_FREEING, "I_FREEING"}, \
18 {I_CLEAR, "I_CLEAR"}, \
20 {I_REFERENCED, "I_REFERENCED"} \
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"}
61 TP_printk(
"bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d "
62 "kupdate=%d range_cyclic=%d background=%d reason=%s",
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), \
109 #define DEFINE_WRITEBACK_EVENT(name) \
110 DEFINE_EVENT(writeback_class, name, \
111 TP_PROTO(struct backing_dev_info *bdi), \
152 TP_printk(
"bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d "
153 "bgrd=%d reclm=%d cyclic=%d "
154 "start=0x%lx end=0x%lx",
167 #define DEFINE_WBC_EVENT(name) \
168 DEFINE_EVENT(wbc_class, name, \
169 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
194 TP_printk(
"bdi %s: older=%lu age=%ld enqueue=%d reason=%s",
205 TP_PROTO(
unsigned long background_thresh,
206 unsigned long dirty_thresh
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)
230 __entry->background_thresh = background_thresh;
231 __entry->dirty_thresh = dirty_thresh;
235 TP_printk(
"dirty=%lu writeback=%lu unstable=%lu "
236 "bg_thresh=%lu thresh=%lu limit=%lu "
237 "dirtied=%lu written=%lu",
249 #define KBps(x) ((x) << (PAGE_SHIFT - 10))
254 unsigned long dirty_rate,
255 unsigned long task_ratelimit),
257 TP_ARGS(bdi, dirty_rate, task_ratelimit),
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)
276 __entry->balanced_dirty_ratelimit =
281 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
282 "dirty_ratelimit=%lu task_ratelimit=%lu "
283 "balanced_dirty_ratelimit=%lu",
290 __entry->balanced_dirty_ratelimit
297 unsigned long thresh,
298 unsigned long bg_thresh,
300 unsigned long bdi_thresh,
301 unsigned long bdi_dirty,
302 unsigned long dirty_ratelimit,
303 unsigned long task_ratelimit,
304 unsigned long dirtied,
309 TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty,
310 dirty_ratelimit, task_ratelimit,
311 dirtied, period, pause, start_time),
316 __field(
unsigned long, setpoint)
318 __field(
unsigned long, bdi_setpoint)
319 __field(
unsigned long, bdi_dirty)
320 __field(
unsigned long, dirty_ratelimit)
321 __field(
unsigned long, task_ratelimit)
323 __field(
unsigned int, dirtied_pause)
331 unsigned long freerun = (thresh + bg_thresh) / 2;
338 bdi_thresh / (thresh + 1);
339 __entry->bdi_dirty = bdi_dirty;
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 "
357 "paused=%lu pause=%ld period=%lu think=%ld",
384 __field(
unsigned long, dirtied_when)
389 dev_name(inode_to_bdi(inode)->
dev), 32);
395 TP_printk(
"bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu",
406 TP_PROTO(
unsigned int usec_timeout,
unsigned int usec_delayed),
408 TP_ARGS(usec_timeout, usec_delayed),
411 __field(
unsigned int, usec_timeout )
412 __field(
unsigned int, usec_delayed )
416 __entry->usec_timeout = usec_timeout;
417 __entry->usec_delayed = usec_delayed;
420 TP_printk(
"usec_timeout=%u usec_delayed=%u",
425 DEFINE_EVENT(writeback_congest_waited_template, writeback_congestion_wait,
427 TP_PROTO(
unsigned int usec_timeout,
unsigned int usec_delayed),
429 TP_ARGS(usec_timeout, usec_delayed)
432 DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested,
434 TP_PROTO(
unsigned int usec_timeout,
unsigned int usec_delayed),
436 TP_ARGS(usec_timeout, usec_delayed)
443 unsigned long nr_to_write
446 TP_ARGS(inode, wbc, nr_to_write),
452 __field(
unsigned long, dirtied_when)
460 dev_name(inode_to_bdi(inode)->
dev), 32);
465 __entry->nr_to_write = nr_to_write;
469 TP_printk(
"bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
470 "index=%lu to_write=%ld wrote=%lu",
482 DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode,
485 unsigned long nr_to_write),
486 TP_ARGS(inode, wbc, nr_to_write)