2 #define TRACE_SYSTEM writeback
4 #if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_WRITEBACK_H
7 #include <linux/tracepoint.h>
8 #include <linux/backing-dev.h>
9 #include <linux/writeback.h>
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"}, \
17 {I_WILL_FREE, "I_WILL_FREE"}, \
18 {I_FREEING, "I_FREEING"}, \
19 {I_CLEAR, "I_CLEAR"}, \
21 {I_DIRTY_TIME, "I_DIRTY_TIME"}, \
22 {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \
23 {I_REFERENCED, "I_REFERENCED"} \
26 /* enums need to be exported to user space */
29 #define EM(a,b) TRACE_DEFINE_ENUM(a);
30 #define EMe(a,b) TRACE_DEFINE_ENUM(a);
32 #define WB_WORK_REASON \
33 EM( WB_REASON_BACKGROUND, "background") \
34 EM( WB_REASON_TRY_TO_FREE_PAGES, "try_to_free_pages") \
35 EM( WB_REASON_SYNC, "sync") \
36 EM( WB_REASON_PERIODIC, "periodic") \
37 EM( WB_REASON_LAPTOP_TIMER, "laptop_timer") \
38 EM( WB_REASON_FREE_MORE_MEM, "free_more_memory") \
39 EM( WB_REASON_FS_FREE_SPACE, "fs_free_space") \
40 EMe(WB_REASON_FORKER_THREAD, "forker_thread")
45 * Now redefine the EM() and EMe() macros to map the enums to the strings
46 * that will be printed in the output.
50 #define EM(a,b) { a, b },
51 #define EMe(a,b) { a, b }
53 struct wb_writeback_work
;
55 TRACE_EVENT(writeback_dirty_page
,
57 TP_PROTO(struct page
*page
, struct address_space
*mapping
),
59 TP_ARGS(page
, mapping
),
62 __array(char, name
, 32)
63 __field(unsigned long, ino
)
64 __field(pgoff_t
, index
)
68 strncpy(__entry
->name
,
69 mapping
? dev_name(inode_to_bdi(mapping
->host
)->dev
) : "(unknown)", 32);
70 __entry
->ino
= mapping
? mapping
->host
->i_ino
: 0;
71 __entry
->index
= page
->index
;
74 TP_printk("bdi %s: ino=%lu index=%lu",
81 DECLARE_EVENT_CLASS(writeback_dirty_inode_template
,
83 TP_PROTO(struct inode
*inode
, int flags
),
85 TP_ARGS(inode
, flags
),
88 __array(char, name
, 32)
89 __field(unsigned long, ino
)
90 __field(unsigned long, state
)
91 __field(unsigned long, flags
)
95 struct backing_dev_info
*bdi
= inode_to_bdi(inode
);
97 /* may be called for files on pseudo FSes w/ unregistered bdi */
98 strncpy(__entry
->name
,
99 bdi
->dev
? dev_name(bdi
->dev
) : "(unknown)", 32);
100 __entry
->ino
= inode
->i_ino
;
101 __entry
->state
= inode
->i_state
;
102 __entry
->flags
= flags
;
105 TP_printk("bdi %s: ino=%lu state=%s flags=%s",
108 show_inode_state(__entry
->state
),
109 show_inode_state(__entry
->flags
)
113 DEFINE_EVENT(writeback_dirty_inode_template
, writeback_mark_inode_dirty
,
115 TP_PROTO(struct inode
*inode
, int flags
),
117 TP_ARGS(inode
, flags
)
120 DEFINE_EVENT(writeback_dirty_inode_template
, writeback_dirty_inode_start
,
122 TP_PROTO(struct inode
*inode
, int flags
),
124 TP_ARGS(inode
, flags
)
127 DEFINE_EVENT(writeback_dirty_inode_template
, writeback_dirty_inode
,
129 TP_PROTO(struct inode
*inode
, int flags
),
131 TP_ARGS(inode
, flags
)
134 #ifdef CREATE_TRACE_POINTS
135 #ifdef CONFIG_CGROUP_WRITEBACK
137 static inline size_t __trace_wb_cgroup_size(struct bdi_writeback
*wb
)
139 return kernfs_path_len(wb
->memcg_css
->cgroup
->kn
) + 1;
142 static inline void __trace_wb_assign_cgroup(char *buf
, struct bdi_writeback
*wb
)
144 struct cgroup
*cgrp
= wb
->memcg_css
->cgroup
;
147 path
= cgroup_path(cgrp
, buf
, kernfs_path_len(cgrp
->kn
) + 1);
148 WARN_ON_ONCE(path
!= buf
);
151 static inline size_t __trace_wbc_cgroup_size(struct writeback_control
*wbc
)
154 return __trace_wb_cgroup_size(wbc
->wb
);
159 static inline void __trace_wbc_assign_cgroup(char *buf
,
160 struct writeback_control
*wbc
)
163 __trace_wb_assign_cgroup(buf
, wbc
->wb
);
168 #else /* CONFIG_CGROUP_WRITEBACK */
170 static inline size_t __trace_wb_cgroup_size(struct bdi_writeback
*wb
)
175 static inline void __trace_wb_assign_cgroup(char *buf
, struct bdi_writeback
*wb
)
180 static inline size_t __trace_wbc_cgroup_size(struct writeback_control
*wbc
)
185 static inline void __trace_wbc_assign_cgroup(char *buf
,
186 struct writeback_control
*wbc
)
191 #endif /* CONFIG_CGROUP_WRITEBACK */
192 #endif /* CREATE_TRACE_POINTS */
194 DECLARE_EVENT_CLASS(writeback_write_inode_template
,
196 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
201 __array(char, name
, 32)
202 __field(unsigned long, ino
)
203 __field(int, sync_mode
)
204 __dynamic_array(char, cgroup
, __trace_wbc_cgroup_size(wbc
))
208 strncpy(__entry
->name
,
209 dev_name(inode_to_bdi(inode
)->dev
), 32);
210 __entry
->ino
= inode
->i_ino
;
211 __entry
->sync_mode
= wbc
->sync_mode
;
212 __trace_wbc_assign_cgroup(__get_str(cgroup
), wbc
);
215 TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup=%s",
223 DEFINE_EVENT(writeback_write_inode_template
, writeback_write_inode_start
,
225 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
230 DEFINE_EVENT(writeback_write_inode_template
, writeback_write_inode
,
232 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
237 DECLARE_EVENT_CLASS(writeback_work_class
,
238 TP_PROTO(struct bdi_writeback
*wb
, struct wb_writeback_work
*work
),
241 __array(char, name
, 32)
242 __field(long, nr_pages
)
243 __field(dev_t
, sb_dev
)
244 __field(int, sync_mode
)
245 __field(int, for_kupdate
)
246 __field(int, range_cyclic
)
247 __field(int, for_background
)
249 __dynamic_array(char, cgroup
, __trace_wb_cgroup_size(wb
))
252 strncpy(__entry
->name
,
253 wb
->bdi
->dev
? dev_name(wb
->bdi
->dev
) : "(unknown)", 32);
254 __entry
->nr_pages
= work
->nr_pages
;
255 __entry
->sb_dev
= work
->sb
? work
->sb
->s_dev
: 0;
256 __entry
->sync_mode
= work
->sync_mode
;
257 __entry
->for_kupdate
= work
->for_kupdate
;
258 __entry
->range_cyclic
= work
->range_cyclic
;
259 __entry
->for_background
= work
->for_background
;
260 __entry
->reason
= work
->reason
;
261 __trace_wb_assign_cgroup(__get_str(cgroup
), wb
);
263 TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d "
264 "kupdate=%d range_cyclic=%d background=%d reason=%s cgroup=%s",
266 MAJOR(__entry
->sb_dev
), MINOR(__entry
->sb_dev
),
269 __entry
->for_kupdate
,
270 __entry
->range_cyclic
,
271 __entry
->for_background
,
272 __print_symbolic(__entry
->reason
, WB_WORK_REASON
),
276 #define DEFINE_WRITEBACK_WORK_EVENT(name) \
277 DEFINE_EVENT(writeback_work_class, name, \
278 TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \
280 DEFINE_WRITEBACK_WORK_EVENT(writeback_queue
);
281 DEFINE_WRITEBACK_WORK_EVENT(writeback_exec
);
282 DEFINE_WRITEBACK_WORK_EVENT(writeback_start
);
283 DEFINE_WRITEBACK_WORK_EVENT(writeback_written
);
284 DEFINE_WRITEBACK_WORK_EVENT(writeback_wait
);
286 TRACE_EVENT(writeback_pages_written
,
287 TP_PROTO(long pages_written
),
288 TP_ARGS(pages_written
),
293 __entry
->pages
= pages_written
;
295 TP_printk("%ld", __entry
->pages
)
298 DECLARE_EVENT_CLASS(writeback_class
,
299 TP_PROTO(struct bdi_writeback
*wb
),
302 __array(char, name
, 32)
303 __dynamic_array(char, cgroup
, __trace_wb_cgroup_size(wb
))
306 strncpy(__entry
->name
, dev_name(wb
->bdi
->dev
), 32);
307 __trace_wb_assign_cgroup(__get_str(cgroup
), wb
);
309 TP_printk("bdi %s: cgroup=%s",
314 #define DEFINE_WRITEBACK_EVENT(name) \
315 DEFINE_EVENT(writeback_class, name, \
316 TP_PROTO(struct bdi_writeback *wb), \
319 DEFINE_WRITEBACK_EVENT(writeback_nowork
);
320 DEFINE_WRITEBACK_EVENT(writeback_wake_background
);
322 TRACE_EVENT(writeback_bdi_register
,
323 TP_PROTO(struct backing_dev_info
*bdi
),
326 __array(char, name
, 32)
329 strncpy(__entry
->name
, dev_name(bdi
->dev
), 32);
336 DECLARE_EVENT_CLASS(wbc_class
,
337 TP_PROTO(struct writeback_control
*wbc
, struct backing_dev_info
*bdi
),
340 __array(char, name
, 32)
341 __field(long, nr_to_write
)
342 __field(long, pages_skipped
)
343 __field(int, sync_mode
)
344 __field(int, for_kupdate
)
345 __field(int, for_background
)
346 __field(int, for_reclaim
)
347 __field(int, range_cyclic
)
348 __field(long, range_start
)
349 __field(long, range_end
)
350 __dynamic_array(char, cgroup
, __trace_wbc_cgroup_size(wbc
))
354 strncpy(__entry
->name
, dev_name(bdi
->dev
), 32);
355 __entry
->nr_to_write
= wbc
->nr_to_write
;
356 __entry
->pages_skipped
= wbc
->pages_skipped
;
357 __entry
->sync_mode
= wbc
->sync_mode
;
358 __entry
->for_kupdate
= wbc
->for_kupdate
;
359 __entry
->for_background
= wbc
->for_background
;
360 __entry
->for_reclaim
= wbc
->for_reclaim
;
361 __entry
->range_cyclic
= wbc
->range_cyclic
;
362 __entry
->range_start
= (long)wbc
->range_start
;
363 __entry
->range_end
= (long)wbc
->range_end
;
364 __trace_wbc_assign_cgroup(__get_str(cgroup
), wbc
);
367 TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d "
368 "bgrd=%d reclm=%d cyclic=%d "
369 "start=0x%lx end=0x%lx cgroup=%s",
371 __entry
->nr_to_write
,
372 __entry
->pages_skipped
,
374 __entry
->for_kupdate
,
375 __entry
->for_background
,
376 __entry
->for_reclaim
,
377 __entry
->range_cyclic
,
378 __entry
->range_start
,
384 #define DEFINE_WBC_EVENT(name) \
385 DEFINE_EVENT(wbc_class, name, \
386 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
388 DEFINE_WBC_EVENT(wbc_writepage
);
390 TRACE_EVENT(writeback_queue_io
,
391 TP_PROTO(struct bdi_writeback
*wb
,
392 struct wb_writeback_work
*work
,
394 TP_ARGS(wb
, work
, moved
),
396 __array(char, name
, 32)
397 __field(unsigned long, older
)
401 __dynamic_array(char, cgroup
, __trace_wb_cgroup_size(wb
))
404 unsigned long *older_than_this
= work
->older_than_this
;
405 strncpy(__entry
->name
, dev_name(wb
->bdi
->dev
), 32);
406 __entry
->older
= older_than_this
? *older_than_this
: 0;
407 __entry
->age
= older_than_this
?
408 (jiffies
- *older_than_this
) * 1000 / HZ
: -1;
409 __entry
->moved
= moved
;
410 __entry
->reason
= work
->reason
;
411 __trace_wb_assign_cgroup(__get_str(cgroup
), wb
);
413 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s cgroup=%s",
415 __entry
->older
, /* older_than_this in jiffies */
416 __entry
->age
, /* older_than_this in relative milliseconds */
418 __print_symbolic(__entry
->reason
, WB_WORK_REASON
),
423 TRACE_EVENT(global_dirty_state
,
425 TP_PROTO(unsigned long background_thresh
,
426 unsigned long dirty_thresh
429 TP_ARGS(background_thresh
,
434 __field(unsigned long, nr_dirty
)
435 __field(unsigned long, nr_writeback
)
436 __field(unsigned long, nr_unstable
)
437 __field(unsigned long, background_thresh
)
438 __field(unsigned long, dirty_thresh
)
439 __field(unsigned long, dirty_limit
)
440 __field(unsigned long, nr_dirtied
)
441 __field(unsigned long, nr_written
)
445 __entry
->nr_dirty
= global_page_state(NR_FILE_DIRTY
);
446 __entry
->nr_writeback
= global_page_state(NR_WRITEBACK
);
447 __entry
->nr_unstable
= global_page_state(NR_UNSTABLE_NFS
);
448 __entry
->nr_dirtied
= global_page_state(NR_DIRTIED
);
449 __entry
->nr_written
= global_page_state(NR_WRITTEN
);
450 __entry
->background_thresh
= background_thresh
;
451 __entry
->dirty_thresh
= dirty_thresh
;
452 __entry
->dirty_limit
= global_wb_domain
.dirty_limit
;
455 TP_printk("dirty=%lu writeback=%lu unstable=%lu "
456 "bg_thresh=%lu thresh=%lu limit=%lu "
457 "dirtied=%lu written=%lu",
459 __entry
->nr_writeback
,
460 __entry
->nr_unstable
,
461 __entry
->background_thresh
,
462 __entry
->dirty_thresh
,
463 __entry
->dirty_limit
,
469 #define KBps(x) ((x) << (PAGE_SHIFT - 10))
471 TRACE_EVENT(bdi_dirty_ratelimit
,
473 TP_PROTO(struct bdi_writeback
*wb
,
474 unsigned long dirty_rate
,
475 unsigned long task_ratelimit
),
477 TP_ARGS(wb
, dirty_rate
, task_ratelimit
),
480 __array(char, bdi
, 32)
481 __field(unsigned long, write_bw
)
482 __field(unsigned long, avg_write_bw
)
483 __field(unsigned long, dirty_rate
)
484 __field(unsigned long, dirty_ratelimit
)
485 __field(unsigned long, task_ratelimit
)
486 __field(unsigned long, balanced_dirty_ratelimit
)
487 __dynamic_array(char, cgroup
, __trace_wb_cgroup_size(wb
))
491 strlcpy(__entry
->bdi
, dev_name(wb
->bdi
->dev
), 32);
492 __entry
->write_bw
= KBps(wb
->write_bandwidth
);
493 __entry
->avg_write_bw
= KBps(wb
->avg_write_bandwidth
);
494 __entry
->dirty_rate
= KBps(dirty_rate
);
495 __entry
->dirty_ratelimit
= KBps(wb
->dirty_ratelimit
);
496 __entry
->task_ratelimit
= KBps(task_ratelimit
);
497 __entry
->balanced_dirty_ratelimit
=
498 KBps(wb
->balanced_dirty_ratelimit
);
499 __trace_wb_assign_cgroup(__get_str(cgroup
), wb
);
503 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
504 "dirty_ratelimit=%lu task_ratelimit=%lu "
505 "balanced_dirty_ratelimit=%lu cgroup=%s",
507 __entry
->write_bw
, /* write bandwidth */
508 __entry
->avg_write_bw
, /* avg write bandwidth */
509 __entry
->dirty_rate
, /* bdi dirty rate */
510 __entry
->dirty_ratelimit
, /* base ratelimit */
511 __entry
->task_ratelimit
, /* ratelimit with position control */
512 __entry
->balanced_dirty_ratelimit
, /* the balanced ratelimit */
517 TRACE_EVENT(balance_dirty_pages
,
519 TP_PROTO(struct bdi_writeback
*wb
,
520 unsigned long thresh
,
521 unsigned long bg_thresh
,
523 unsigned long bdi_thresh
,
524 unsigned long bdi_dirty
,
525 unsigned long dirty_ratelimit
,
526 unsigned long task_ratelimit
,
527 unsigned long dirtied
,
528 unsigned long period
,
530 unsigned long start_time
),
532 TP_ARGS(wb
, thresh
, bg_thresh
, dirty
, bdi_thresh
, bdi_dirty
,
533 dirty_ratelimit
, task_ratelimit
,
534 dirtied
, period
, pause
, start_time
),
537 __array( char, bdi
, 32)
538 __field(unsigned long, limit
)
539 __field(unsigned long, setpoint
)
540 __field(unsigned long, dirty
)
541 __field(unsigned long, bdi_setpoint
)
542 __field(unsigned long, bdi_dirty
)
543 __field(unsigned long, dirty_ratelimit
)
544 __field(unsigned long, task_ratelimit
)
545 __field(unsigned int, dirtied
)
546 __field(unsigned int, dirtied_pause
)
547 __field(unsigned long, paused
)
548 __field( long, pause
)
549 __field(unsigned long, period
)
550 __field( long, think
)
551 __dynamic_array(char, cgroup
, __trace_wb_cgroup_size(wb
))
555 unsigned long freerun
= (thresh
+ bg_thresh
) / 2;
556 strlcpy(__entry
->bdi
, dev_name(wb
->bdi
->dev
), 32);
558 __entry
->limit
= global_wb_domain
.dirty_limit
;
559 __entry
->setpoint
= (global_wb_domain
.dirty_limit
+
561 __entry
->dirty
= dirty
;
562 __entry
->bdi_setpoint
= __entry
->setpoint
*
563 bdi_thresh
/ (thresh
+ 1);
564 __entry
->bdi_dirty
= bdi_dirty
;
565 __entry
->dirty_ratelimit
= KBps(dirty_ratelimit
);
566 __entry
->task_ratelimit
= KBps(task_ratelimit
);
567 __entry
->dirtied
= dirtied
;
568 __entry
->dirtied_pause
= current
->nr_dirtied_pause
;
569 __entry
->think
= current
->dirty_paused_when
== 0 ? 0 :
570 (long)(jiffies
- current
->dirty_paused_when
) * 1000/HZ
;
571 __entry
->period
= period
* 1000 / HZ
;
572 __entry
->pause
= pause
* 1000 / HZ
;
573 __entry
->paused
= (jiffies
- start_time
) * 1000 / HZ
;
574 __trace_wb_assign_cgroup(__get_str(cgroup
), wb
);
579 "limit=%lu setpoint=%lu dirty=%lu "
580 "bdi_setpoint=%lu bdi_dirty=%lu "
581 "dirty_ratelimit=%lu task_ratelimit=%lu "
582 "dirtied=%u dirtied_pause=%u "
583 "paused=%lu pause=%ld period=%lu think=%ld cgroup=%s",
588 __entry
->bdi_setpoint
,
590 __entry
->dirty_ratelimit
,
591 __entry
->task_ratelimit
,
593 __entry
->dirtied_pause
,
594 __entry
->paused
, /* ms */
595 __entry
->pause
, /* ms */
596 __entry
->period
, /* ms */
597 __entry
->think
, /* ms */
602 TRACE_EVENT(writeback_sb_inodes_requeue
,
604 TP_PROTO(struct inode
*inode
),
608 __array(char, name
, 32)
609 __field(unsigned long, ino
)
610 __field(unsigned long, state
)
611 __field(unsigned long, dirtied_when
)
612 __dynamic_array(char, cgroup
,
613 __trace_wb_cgroup_size(inode_to_wb(inode
)))
617 strncpy(__entry
->name
,
618 dev_name(inode_to_bdi(inode
)->dev
), 32);
619 __entry
->ino
= inode
->i_ino
;
620 __entry
->state
= inode
->i_state
;
621 __entry
->dirtied_when
= inode
->dirtied_when
;
622 __trace_wb_assign_cgroup(__get_str(cgroup
), inode_to_wb(inode
));
625 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup=%s",
628 show_inode_state(__entry
->state
),
629 __entry
->dirtied_when
,
630 (jiffies
- __entry
->dirtied_when
) / HZ
,
635 DECLARE_EVENT_CLASS(writeback_congest_waited_template
,
637 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
639 TP_ARGS(usec_timeout
, usec_delayed
),
642 __field( unsigned int, usec_timeout
)
643 __field( unsigned int, usec_delayed
)
647 __entry
->usec_timeout
= usec_timeout
;
648 __entry
->usec_delayed
= usec_delayed
;
651 TP_printk("usec_timeout=%u usec_delayed=%u",
652 __entry
->usec_timeout
,
653 __entry
->usec_delayed
)
656 DEFINE_EVENT(writeback_congest_waited_template
, writeback_congestion_wait
,
658 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
660 TP_ARGS(usec_timeout
, usec_delayed
)
663 DEFINE_EVENT(writeback_congest_waited_template
, writeback_wait_iff_congested
,
665 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
667 TP_ARGS(usec_timeout
, usec_delayed
)
670 DECLARE_EVENT_CLASS(writeback_single_inode_template
,
672 TP_PROTO(struct inode
*inode
,
673 struct writeback_control
*wbc
,
674 unsigned long nr_to_write
677 TP_ARGS(inode
, wbc
, nr_to_write
),
680 __array(char, name
, 32)
681 __field(unsigned long, ino
)
682 __field(unsigned long, state
)
683 __field(unsigned long, dirtied_when
)
684 __field(unsigned long, writeback_index
)
685 __field(long, nr_to_write
)
686 __field(unsigned long, wrote
)
687 __dynamic_array(char, cgroup
, __trace_wbc_cgroup_size(wbc
))
691 strncpy(__entry
->name
,
692 dev_name(inode_to_bdi(inode
)->dev
), 32);
693 __entry
->ino
= inode
->i_ino
;
694 __entry
->state
= inode
->i_state
;
695 __entry
->dirtied_when
= inode
->dirtied_when
;
696 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
697 __entry
->nr_to_write
= nr_to_write
;
698 __entry
->wrote
= nr_to_write
- wbc
->nr_to_write
;
699 __trace_wbc_assign_cgroup(__get_str(cgroup
), wbc
);
702 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
703 "index=%lu to_write=%ld wrote=%lu cgroup=%s",
706 show_inode_state(__entry
->state
),
707 __entry
->dirtied_when
,
708 (jiffies
- __entry
->dirtied_when
) / HZ
,
709 __entry
->writeback_index
,
710 __entry
->nr_to_write
,
716 DEFINE_EVENT(writeback_single_inode_template
, writeback_single_inode_start
,
717 TP_PROTO(struct inode
*inode
,
718 struct writeback_control
*wbc
,
719 unsigned long nr_to_write
),
720 TP_ARGS(inode
, wbc
, nr_to_write
)
723 DEFINE_EVENT(writeback_single_inode_template
, writeback_single_inode
,
724 TP_PROTO(struct inode
*inode
,
725 struct writeback_control
*wbc
,
726 unsigned long nr_to_write
),
727 TP_ARGS(inode
, wbc
, nr_to_write
)
730 DECLARE_EVENT_CLASS(writeback_lazytime_template
,
731 TP_PROTO(struct inode
*inode
),
736 __field( dev_t
, dev
)
737 __field(unsigned long, ino
)
738 __field(unsigned long, state
)
739 __field( __u16
, mode
)
740 __field(unsigned long, dirtied_when
)
744 __entry
->dev
= inode
->i_sb
->s_dev
;
745 __entry
->ino
= inode
->i_ino
;
746 __entry
->state
= inode
->i_state
;
747 __entry
->mode
= inode
->i_mode
;
748 __entry
->dirtied_when
= inode
->dirtied_when
;
751 TP_printk("dev %d,%d ino %lu dirtied %lu state %s mode 0%o",
752 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
753 __entry
->ino
, __entry
->dirtied_when
,
754 show_inode_state(__entry
->state
), __entry
->mode
)
757 DEFINE_EVENT(writeback_lazytime_template
, writeback_lazytime
,
758 TP_PROTO(struct inode
*inode
),
763 DEFINE_EVENT(writeback_lazytime_template
, writeback_lazytime_iput
,
764 TP_PROTO(struct inode
*inode
),
769 DEFINE_EVENT(writeback_lazytime_template
, writeback_dirty_inode_enqueue
,
771 TP_PROTO(struct inode
*inode
),
776 #endif /* _TRACE_WRITEBACK_H */
778 /* This part must be outside protection */
779 #include <trace/define_trace.h>