2 #define TRACE_SYSTEM writeback
4 #if !defined(LTTNG_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_WRITEBACK_H
7 #include <probes/lttng-tracepoint-event.h>
8 #include <linux/tracepoint.h>
9 #include <linux/backing-dev.h>
10 #include <linux/writeback.h>
11 #include <linux/version.h>
13 #ifndef _TRACE_WRITEBACK_DEF_
14 #define _TRACE_WRITEBACK_DEF_
16 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) && \
17 LTTNG_RHEL_VERSION_CODE < LTTNG_RHEL_KERNEL_VERSION(3,10,0,327,10,1))
18 static inline struct backing_dev_info
*inode_to_bdi(struct inode
*inode
)
20 struct super_block
*sb
= inode
->i_sb
;
22 if (strcmp(sb
->s_type
->name
, "bdev") == 0)
23 return inode
->i_mapping
->backing_dev_info
;
27 #endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) */
31 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
32 #define show_inode_state(state) \
33 __print_flags(state, "|", \
34 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
35 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
36 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
38 {I_WILL_FREE, "I_WILL_FREE"}, \
39 {I_FREEING, "I_FREEING"}, \
40 {I_CLEAR, "I_CLEAR"}, \
42 {I_DIRTY_TIME, "I_DIRTY_TIME"}, \
43 {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \
44 {I_REFERENCED, "I_REFERENCED"} \
46 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
47 #define show_inode_state(state) \
48 __print_flags(state, "|", \
49 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
50 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
51 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
53 {I_WILL_FREE, "I_WILL_FREE"}, \
54 {I_FREEING, "I_FREEING"}, \
55 {I_CLEAR, "I_CLEAR"}, \
57 {I_REFERENCED, "I_REFERENCED"} \
59 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
61 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
63 LTTNG_TRACEPOINT_EVENT(writeback_dirty_page
,
64 TP_PROTO(struct page
*page
, struct address_space
*mapping
),
65 TP_ARGS(page
, mapping
),
67 ctf_array_text(char, name
,
68 mapping
? dev_name(inode_to_bdi(mapping
->host
)->dev
) : "(unknown)", 32)
69 ctf_integer(unsigned long, ino
, mapping
? mapping
->host
->i_ino
: 0)
70 ctf_integer(pgoff_t
, index
, page
->index
)
74 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template
,
75 TP_PROTO(struct inode
*inode
, int flags
),
76 TP_ARGS(inode
, flags
),
78 /* may be called for files on pseudo FSes w/ unregistered bdi */
79 ctf_array_text(char, name
,
80 inode_to_bdi(inode
)->dev
?
81 dev_name(inode_to_bdi(inode
)->dev
) : "(unknown)", 32)
82 ctf_integer(unsigned long, ino
, inode
->i_ino
)
83 ctf_integer(unsigned long, state
, inode
->i_state
)
84 ctf_integer(unsigned long, flags
, flags
)
87 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \
88 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \
89 TP_PROTO(struct inode *inode, int flags), \
90 TP_ARGS(inode, flags))
91 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start
)
92 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode
)
93 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_mark_inode_dirty
)
95 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template
,
96 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
99 ctf_array_text(char, name
,
100 dev_name(inode_to_bdi(inode
)->dev
), 32)
101 ctf_integer(unsigned long, ino
, inode
->i_ino
)
102 ctf_integer(int, sync_mode
, wbc
->sync_mode
)
106 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \
107 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \
108 TP_PROTO(struct inode *inode, struct writeback_control *wbc), \
110 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start
)
111 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode
)
113 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
115 LTTNG_TRACEPOINT_EVENT(writeback_dirty_page
,
116 TP_PROTO(struct page
*page
, struct address_space
*mapping
),
117 TP_ARGS(page
, mapping
),
119 ctf_array_text(char, name
,
120 mapping
? dev_name(mapping
->backing_dev_info
->dev
) : "(unknown)", 32)
121 ctf_integer(unsigned long, ino
, mapping
? mapping
->host
->i_ino
: 0)
122 ctf_integer(pgoff_t
, index
, page
->index
)
126 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template
,
127 TP_PROTO(struct inode
*inode
, int flags
),
128 TP_ARGS(inode
, flags
),
130 /* may be called for files on pseudo FSes w/ unregistered bdi */
131 ctf_array_text(char, name
,
132 inode
->i_mapping
->backing_dev_info
->dev
?
133 dev_name(inode
->i_mapping
->backing_dev_info
->dev
)
135 ctf_integer(unsigned long, ino
, inode
->i_ino
)
136 ctf_integer(unsigned long, flags
, flags
)
139 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \
140 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \
141 TP_PROTO(struct inode *inode, int flags), \
142 TP_ARGS(inode, flags))
143 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start
)
144 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode
)
146 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template
,
147 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
150 ctf_array_text(char, name
,
151 dev_name(inode
->i_mapping
->backing_dev_info
->dev
), 32)
152 ctf_integer(unsigned long, ino
, inode
->i_ino
)
153 ctf_integer(int, sync_mode
, wbc
->sync_mode
)
157 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \
158 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \
159 TP_PROTO(struct inode *inode, struct writeback_control *wbc), \
161 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start
)
162 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode
)
164 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */
166 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
168 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class
,
169 TP_PROTO(struct bdi_writeback
*wb
, struct wb_writeback_work
*work
),
172 ctf_array_text(char, name
, wb
->bdi
->dev
? dev_name(wb
->bdi
->dev
) :
177 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
179 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class
,
180 TP_PROTO(struct backing_dev_info
*bdi
, struct wb_writeback_work
*work
),
183 ctf_array_text(char, name
, bdi
->dev
? dev_name(bdi
->dev
) :
188 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
190 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class
,
191 TP_PROTO(struct backing_dev_info
*bdi
, struct wb_writeback_work
*work
),
194 ctf_array_text(char, name
,
195 dev_name(bdi
->dev
? bdi
->dev
:
196 default_backing_dev_info
.dev
), 32)
200 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
202 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
204 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \
205 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \
206 TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \
209 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
211 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \
212 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \
213 TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \
216 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
218 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_nothread
)
219 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_queue
)
220 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_exec
)
221 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
222 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_start
)
223 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_written
)
224 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_wait
)
227 LTTNG_TRACEPOINT_EVENT(writeback_pages_written
,
228 TP_PROTO(long pages_written
),
229 TP_ARGS(pages_written
),
231 ctf_integer(long, pages
, pages_written
)
235 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
237 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class
,
238 TP_PROTO(struct bdi_writeback
*wb
),
241 ctf_array_text(char, name
,
242 dev_name(wb
->bdi
->dev
), 32)
246 #undef DEFINE_WRITEBACK_EVENT
247 #define DEFINE_WRITEBACK_EVENT(name) \
248 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \
249 TP_PROTO(struct bdi_writeback *wb), \
252 #define DEFINE_WRITEBACK_EVENT_MAP(name, map) \
253 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \
254 TP_PROTO(struct bdi_writeback *wb), \
257 LTTNG_TRACEPOINT_EVENT(writeback_bdi_register
,
258 TP_PROTO(struct backing_dev_info
*bdi
),
261 ctf_array_text(char, name
,
262 dev_name(bdi
->dev
), 32)
266 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
268 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class
,
269 TP_PROTO(struct backing_dev_info
*bdi
),
272 ctf_array_text(char, name
,
273 dev_name(bdi
->dev
), 32)
277 #undef DEFINE_WRITEBACK_EVENT
278 #define DEFINE_WRITEBACK_EVENT(name) \
279 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \
280 TP_PROTO(struct backing_dev_info *bdi), \
283 #define DEFINE_WRITEBACK_EVENT_MAP(name, map) \
284 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \
285 TP_PROTO(struct backing_dev_info *bdi), \
288 DEFINE_WRITEBACK_EVENT(writeback_bdi_register
)
290 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
292 DEFINE_WRITEBACK_EVENT(writeback_nowork
)
293 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
294 DEFINE_WRITEBACK_EVENT(writeback_wake_background
)
296 DEFINE_WRITEBACK_EVENT(writeback_wake_thread
)
297 DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread
)
298 DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister
)
299 DEFINE_WRITEBACK_EVENT(writeback_thread_start
)
300 DEFINE_WRITEBACK_EVENT(writeback_thread_stop
)
301 #if (LTTNG_KERNEL_RANGE(3,1,0, 3,2,0))
302 DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_start
, writeback_balance_dirty_start
)
303 DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_wait
, writeback_balance_dirty_wait
)
305 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_written
,
307 writeback_balance_dirty_written
,
309 TP_PROTO(struct backing_dev_info
*bdi
, int written
),
311 TP_ARGS(bdi
, written
),
314 ctf_array_text(char, name
, dev_name(bdi
->dev
), 32)
315 ctf_integer(int, written
, written
)
320 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_wbc_class
,
321 TP_PROTO(struct writeback_control
*wbc
, struct backing_dev_info
*bdi
),
324 ctf_array_text(char, name
, dev_name(bdi
->dev
), 32)
325 ctf_integer(long, nr_to_write
, wbc
->nr_to_write
)
326 ctf_integer(long, pages_skipped
, wbc
->pages_skipped
)
327 ctf_integer(int, sync_mode
, wbc
->sync_mode
)
328 ctf_integer(int, for_kupdate
, wbc
->for_kupdate
)
329 ctf_integer(int, for_background
, wbc
->for_background
)
330 ctf_integer(int, for_reclaim
, wbc
->for_reclaim
)
331 ctf_integer(int, range_cyclic
, wbc
->range_cyclic
)
332 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
333 ctf_integer(int, more_io
, wbc
->more_io
)
334 ctf_integer(unsigned long, older_than_this
,
335 wbc
->older_than_this
? *wbc
->older_than_this
: 0)
337 ctf_integer(long, range_start
, (long) wbc
->range_start
)
338 ctf_integer(long, range_end
, (long) wbc
->range_end
)
342 #undef DEFINE_WBC_EVENT
343 #define LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(name, map) \
344 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_wbc_class, name, map, \
345 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
347 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
348 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_start
, writeback_wbc_writeback_start
)
349 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_written
, writeback_wbc_writeback_written
)
350 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_wait
, writeback_wbc_writeback_wait
)
351 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_start
, writeback_wbc_balance_dirty_start
)
352 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_written
, writeback_wbc_balance_dirty_written
)
353 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait
, writeback_wbc_balance_dirty_wait
)
355 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage
, writeback_wbc_writepage
)
357 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
358 LTTNG_TRACEPOINT_EVENT(writeback_queue_io
,
359 TP_PROTO(struct bdi_writeback
*wb
,
360 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
361 struct wb_writeback_work
*work
,
363 unsigned long *older_than_this
,
366 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
367 TP_ARGS(wb
, work
, moved
),
369 TP_ARGS(wb
, older_than_this
, moved
),
372 ctf_array_text(char, name
, dev_name(wb
->bdi
->dev
), 32)
373 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
375 ctf_integer(unsigned long, older
,
376 older_than_this
? *older_than_this
: 0)
377 ctf_integer(long, age
,
379 (jiffies
- *older_than_this
) * 1000 / HZ
382 ctf_integer(int, moved
, moved
)
386 LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state
,
388 writeback_global_dirty_state
,
390 TP_PROTO(unsigned long background_thresh
,
391 unsigned long dirty_thresh
394 TP_ARGS(background_thresh
,
399 ctf_integer(unsigned long, nr_dirty
, global_page_state(NR_FILE_DIRTY
))
400 ctf_integer(unsigned long, nr_writeback
, global_page_state(NR_WRITEBACK
))
401 ctf_integer(unsigned long, nr_unstable
, global_page_state(NR_UNSTABLE_NFS
))
402 ctf_integer(unsigned long, nr_dirtied
, global_page_state(NR_DIRTIED
))
403 ctf_integer(unsigned long, nr_written
, global_page_state(NR_WRITTEN
))
404 ctf_integer(unsigned long, background_thresh
, background_thresh
)
405 ctf_integer(unsigned long, dirty_thresh
, dirty_thresh
)
406 ctf_integer(unsigned long, dirty_limit
, global_dirty_limit
)
411 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
413 #define KBps(x) ((x) << (PAGE_SHIFT - 10))
415 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
417 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit
,
419 writeback_bdi_dirty_ratelimit
,
421 TP_PROTO(struct bdi_writeback
*wb
,
422 unsigned long dirty_rate
,
423 unsigned long task_ratelimit
),
425 TP_ARGS(wb
, dirty_rate
, task_ratelimit
),
428 ctf_array_text(char, bdi
, dev_name(wb
->bdi
->dev
), 32)
429 ctf_integer(unsigned long, write_bw
, KBps(wb
->bdi
->wb
.write_bandwidth
))
430 ctf_integer(unsigned long, avg_write_bw
, KBps(wb
->bdi
->wb
.avg_write_bandwidth
))
431 ctf_integer(unsigned long, dirty_rate
, KBps(dirty_rate
))
432 ctf_integer(unsigned long, dirty_ratelimit
, KBps(wb
->bdi
->wb
.dirty_ratelimit
))
433 ctf_integer(unsigned long, task_ratelimit
, KBps(task_ratelimit
))
434 ctf_integer(unsigned long, balanced_dirty_ratelimit
,
435 KBps(wb
->bdi
->wb
.balanced_dirty_ratelimit
))
439 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
441 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit
,
443 writeback_bdi_dirty_ratelimit
,
445 TP_PROTO(struct backing_dev_info
*bdi
,
446 unsigned long dirty_rate
,
447 unsigned long task_ratelimit
),
449 TP_ARGS(bdi
, dirty_rate
, task_ratelimit
),
452 ctf_array_text(char, bdi
, dev_name(bdi
->dev
), 32)
453 ctf_integer(unsigned long, write_bw
, KBps(bdi
->wb
.write_bandwidth
))
454 ctf_integer(unsigned long, avg_write_bw
, KBps(bdi
->wb
.avg_write_bandwidth
))
455 ctf_integer(unsigned long, dirty_rate
, KBps(dirty_rate
))
456 ctf_integer(unsigned long, dirty_ratelimit
, KBps(bdi
->wb
.dirty_ratelimit
))
457 ctf_integer(unsigned long, task_ratelimit
, KBps(task_ratelimit
))
458 ctf_integer(unsigned long, balanced_dirty_ratelimit
,
459 KBps(bdi
->wb
.balanced_dirty_ratelimit
))
463 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */
465 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit
,
467 writeback_bdi_dirty_ratelimit
,
469 TP_PROTO(struct backing_dev_info
*bdi
,
470 unsigned long dirty_rate
,
471 unsigned long task_ratelimit
),
473 TP_ARGS(bdi
, dirty_rate
, task_ratelimit
),
476 ctf_array_text(char, bdi
, dev_name(bdi
->dev
), 32)
477 ctf_integer(unsigned long, write_bw
, KBps(bdi
->write_bandwidth
))
478 ctf_integer(unsigned long, avg_write_bw
, KBps(bdi
->avg_write_bandwidth
))
479 ctf_integer(unsigned long, dirty_rate
, KBps(dirty_rate
))
480 ctf_integer(unsigned long, dirty_ratelimit
, KBps(bdi
->dirty_ratelimit
))
481 ctf_integer(unsigned long, task_ratelimit
, KBps(task_ratelimit
))
482 ctf_integer(unsigned long, balanced_dirty_ratelimit
,
483 KBps(bdi
->balanced_dirty_ratelimit
))
487 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */
489 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
491 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages
,
493 writeback_balance_dirty_pages
,
495 TP_PROTO(struct bdi_writeback
*wb
,
496 unsigned long thresh
,
497 unsigned long bg_thresh
,
499 unsigned long bdi_thresh
,
500 unsigned long bdi_dirty
,
501 unsigned long dirty_ratelimit
,
502 unsigned long task_ratelimit
,
503 unsigned long dirtied
,
504 unsigned long period
,
506 unsigned long start_time
),
508 TP_ARGS(wb
, thresh
, bg_thresh
, dirty
, bdi_thresh
, bdi_dirty
,
509 dirty_ratelimit
, task_ratelimit
,
510 dirtied
, period
, pause
, start_time
514 ctf_array_text(char, bdi
, dev_name(wb
->bdi
->dev
), 32)
515 ctf_integer(unsigned long, limit
, global_dirty_limit
)
516 ctf_integer(unsigned long, setpoint
,
517 (global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2)
518 ctf_integer(unsigned long, dirty
, dirty
)
519 ctf_integer(unsigned long, bdi_setpoint
,
520 ((global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2) *
521 bdi_thresh
/ (thresh
+ 1))
522 ctf_integer(unsigned long, bdi_dirty
, bdi_dirty
)
523 ctf_integer(unsigned long, dirty_ratelimit
,
524 KBps(dirty_ratelimit
))
525 ctf_integer(unsigned long, task_ratelimit
,
526 KBps(task_ratelimit
))
527 ctf_integer(unsigned int, dirtied
, dirtied
)
528 ctf_integer(unsigned int, dirtied_pause
,
529 current
->nr_dirtied_pause
)
530 ctf_integer(unsigned long, paused
,
531 (jiffies
- start_time
) * 1000 / HZ
)
532 ctf_integer(long, pause
, pause
* 1000 / HZ
)
533 ctf_integer(unsigned long, period
,
535 ctf_integer(long, think
,
536 current
->dirty_paused_when
== 0 ? 0 :
537 (long)(jiffies
- current
->dirty_paused_when
) * 1000/HZ
)
541 #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
543 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages
,
545 writeback_balance_dirty_pages
,
547 TP_PROTO(struct backing_dev_info
*bdi
,
548 unsigned long thresh
,
549 unsigned long bg_thresh
,
551 unsigned long bdi_thresh
,
552 unsigned long bdi_dirty
,
553 unsigned long dirty_ratelimit
,
554 unsigned long task_ratelimit
,
555 unsigned long dirtied
,
556 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
557 unsigned long period
,
560 unsigned long start_time
),
562 TP_ARGS(bdi
, thresh
, bg_thresh
, dirty
, bdi_thresh
, bdi_dirty
,
563 dirty_ratelimit
, task_ratelimit
,
564 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
565 dirtied
, period
, pause
, start_time
567 dirtied
, pause
, start_time
572 ctf_array_text(char, bdi
, dev_name(bdi
->dev
), 32)
573 ctf_integer(unsigned long, limit
, global_dirty_limit
)
574 ctf_integer(unsigned long, setpoint
,
575 (global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2)
576 ctf_integer(unsigned long, dirty
, dirty
)
577 ctf_integer(unsigned long, bdi_setpoint
,
578 ((global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2) *
579 bdi_thresh
/ (thresh
+ 1))
580 ctf_integer(unsigned long, bdi_dirty
, bdi_dirty
)
581 ctf_integer(unsigned long, dirty_ratelimit
,
582 KBps(dirty_ratelimit
))
583 ctf_integer(unsigned long, task_ratelimit
,
584 KBps(task_ratelimit
))
585 ctf_integer(unsigned int, dirtied
, dirtied
)
586 ctf_integer(unsigned int, dirtied_pause
,
587 current
->nr_dirtied_pause
)
588 ctf_integer(unsigned long, paused
,
589 (jiffies
- start_time
) * 1000 / HZ
)
590 ctf_integer(long, pause
, pause
* 1000 / HZ
)
591 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
592 ctf_integer(unsigned long, period
,
594 ctf_integer(long, think
,
595 current
->dirty_paused_when
== 0 ? 0 :
596 (long)(jiffies
- current
->dirty_paused_when
) * 1000/HZ
)
600 #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
602 #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
604 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
605 LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue
,
607 TP_PROTO(struct inode
*inode
),
611 ctf_array_text(char, name
,
612 dev_name(inode_to_bdi(inode
)->dev
), 32)
613 ctf_integer(unsigned long, ino
, inode
->i_ino
)
614 ctf_integer(unsigned long, state
, inode
->i_state
)
615 ctf_integer(unsigned long, dirtied_when
, inode
->dirtied_when
)
620 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
621 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_congest_waited_template
,
623 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
625 TP_ARGS(usec_timeout
, usec_delayed
),
628 ctf_integer(unsigned int, usec_timeout
, usec_timeout
)
629 ctf_integer(unsigned int, usec_delayed
, usec_delayed
)
633 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template
, writeback_congestion_wait
,
635 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
637 TP_ARGS(usec_timeout
, usec_delayed
)
640 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template
, writeback_wait_iff_congested
,
642 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
644 TP_ARGS(usec_timeout
, usec_delayed
)
648 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
649 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template
,
651 TP_PROTO(struct inode
*inode
,
652 struct writeback_control
*wbc
,
653 unsigned long nr_to_write
656 TP_ARGS(inode
, wbc
, nr_to_write
),
659 ctf_array_text(char, name
,
660 dev_name(inode_to_bdi(inode
)->dev
), 32)
661 ctf_integer(unsigned long, ino
, inode
->i_ino
)
662 ctf_integer(unsigned long, state
, inode
->i_state
)
663 ctf_integer(unsigned long, dirtied_when
, inode
->dirtied_when
)
664 ctf_integer(unsigned long, writeback_index
,
665 inode
->i_mapping
->writeback_index
)
666 ctf_integer(long, nr_to_write
, nr_to_write
)
667 ctf_integer(unsigned long, wrote
,
668 nr_to_write
- wbc
->nr_to_write
)
672 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
673 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template
, writeback_single_inode_requeue
,
674 TP_PROTO(struct inode
*inode
,
675 struct writeback_control
*wbc
,
676 unsigned long nr_to_write
),
677 TP_ARGS(inode
, wbc
, nr_to_write
)
681 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template
, writeback_single_inode
,
682 TP_PROTO(struct inode
*inode
,
683 struct writeback_control
*wbc
,
684 unsigned long nr_to_write
),
685 TP_ARGS(inode
, wbc
, nr_to_write
)
689 #endif /* LTTNG_TRACE_WRITEBACK_H */
691 /* This part must be outside protection */
692 #include <probes/define_trace.h>