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 static inline struct backing_dev_info
*inode_to_bdi(struct inode
*inode
)
19 struct super_block
*sb
= inode
->i_sb
;
21 if (strcmp(sb
->s_type
->name
, "bdev") == 0)
22 return inode
->i_mapping
->backing_dev_info
;
26 #endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) */
30 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
31 #define show_inode_state(state) \
32 __print_flags(state, "|", \
33 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
34 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
35 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
37 {I_WILL_FREE, "I_WILL_FREE"}, \
38 {I_FREEING, "I_FREEING"}, \
39 {I_CLEAR, "I_CLEAR"}, \
41 {I_DIRTY_TIME, "I_DIRTY_TIME"}, \
42 {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \
43 {I_REFERENCED, "I_REFERENCED"} \
45 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
46 #define show_inode_state(state) \
47 __print_flags(state, "|", \
48 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
49 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
50 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
52 {I_WILL_FREE, "I_WILL_FREE"}, \
53 {I_FREEING, "I_FREEING"}, \
54 {I_CLEAR, "I_CLEAR"}, \
56 {I_REFERENCED, "I_REFERENCED"} \
58 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
60 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
62 LTTNG_TRACEPOINT_EVENT(writeback_dirty_page
,
63 TP_PROTO(struct page
*page
, struct address_space
*mapping
),
64 TP_ARGS(page
, mapping
),
66 ctf_array_text(char, name
,
67 mapping
? dev_name(inode_to_bdi(mapping
->host
)->dev
) : "(unknown)", 32)
68 ctf_integer(unsigned long, ino
, mapping
? mapping
->host
->i_ino
: 0)
69 ctf_integer(pgoff_t
, index
, page
->index
)
73 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template
,
74 TP_PROTO(struct inode
*inode
, int flags
),
75 TP_ARGS(inode
, flags
),
77 /* may be called for files on pseudo FSes w/ unregistered bdi */
78 ctf_array_text(char, name
,
79 inode_to_bdi(inode
)->dev
?
80 dev_name(inode_to_bdi(inode
)->dev
) : "(unknown)", 32)
81 ctf_integer(unsigned long, ino
, inode
->i_ino
)
82 ctf_integer(unsigned long, state
, inode
->i_state
)
83 ctf_integer(unsigned long, flags
, flags
)
86 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \
87 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \
88 TP_PROTO(struct inode *inode, int flags), \
89 TP_ARGS(inode, flags))
90 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start
)
91 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode
)
92 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_mark_inode_dirty
)
94 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template
,
95 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
98 ctf_array_text(char, name
,
99 dev_name(inode_to_bdi(inode
)->dev
), 32)
100 ctf_integer(unsigned long, ino
, inode
->i_ino
)
101 ctf_integer(int, sync_mode
, wbc
->sync_mode
)
105 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \
106 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \
107 TP_PROTO(struct inode *inode, struct writeback_control *wbc), \
109 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start
)
110 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode
)
112 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
114 LTTNG_TRACEPOINT_EVENT(writeback_dirty_page
,
115 TP_PROTO(struct page
*page
, struct address_space
*mapping
),
116 TP_ARGS(page
, mapping
),
118 ctf_array_text(char, name
,
119 mapping
? dev_name(mapping
->backing_dev_info
->dev
) : "(unknown)", 32)
120 ctf_integer(unsigned long, ino
, mapping
? mapping
->host
->i_ino
: 0)
121 ctf_integer(pgoff_t
, index
, page
->index
)
125 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template
,
126 TP_PROTO(struct inode
*inode
, int flags
),
127 TP_ARGS(inode
, flags
),
129 /* may be called for files on pseudo FSes w/ unregistered bdi */
130 ctf_array_text(char, name
,
131 inode
->i_mapping
->backing_dev_info
->dev
?
132 dev_name(inode
->i_mapping
->backing_dev_info
->dev
)
134 ctf_integer(unsigned long, ino
, inode
->i_ino
)
135 ctf_integer(unsigned long, flags
, flags
)
138 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \
139 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \
140 TP_PROTO(struct inode *inode, int flags), \
141 TP_ARGS(inode, flags))
142 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start
)
143 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode
)
145 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template
,
146 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
149 ctf_array_text(char, name
,
150 dev_name(inode
->i_mapping
->backing_dev_info
->dev
), 32)
151 ctf_integer(unsigned long, ino
, inode
->i_ino
)
152 ctf_integer(int, sync_mode
, wbc
->sync_mode
)
156 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \
157 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \
158 TP_PROTO(struct inode *inode, struct writeback_control *wbc), \
160 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start
)
161 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode
)
163 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */
165 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
167 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class
,
168 TP_PROTO(struct bdi_writeback
*wb
, struct wb_writeback_work
*work
),
171 ctf_array_text(char, name
, wb
->bdi
->dev
? dev_name(wb
->bdi
->dev
) :
176 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
178 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class
,
179 TP_PROTO(struct backing_dev_info
*bdi
, struct wb_writeback_work
*work
),
182 ctf_array_text(char, name
, bdi
->dev
? dev_name(bdi
->dev
) :
187 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
189 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class
,
190 TP_PROTO(struct backing_dev_info
*bdi
, struct wb_writeback_work
*work
),
193 ctf_array_text(char, name
,
194 dev_name(bdi
->dev
? bdi
->dev
:
195 default_backing_dev_info
.dev
), 32)
199 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
201 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
203 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \
204 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \
205 TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \
208 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
210 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \
211 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \
212 TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \
215 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
217 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_nothread
)
218 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_queue
)
219 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_exec
)
220 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
221 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_start
)
222 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_written
)
223 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_wait
)
226 LTTNG_TRACEPOINT_EVENT(writeback_pages_written
,
227 TP_PROTO(long pages_written
),
228 TP_ARGS(pages_written
),
230 ctf_integer(long, pages
, pages_written
)
234 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
236 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class
,
237 TP_PROTO(struct bdi_writeback
*wb
),
240 ctf_array_text(char, name
,
241 dev_name(wb
->bdi
->dev
), 32)
245 #undef DEFINE_WRITEBACK_EVENT
246 #define DEFINE_WRITEBACK_EVENT(name) \
247 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \
248 TP_PROTO(struct bdi_writeback *wb), \
251 #define DEFINE_WRITEBACK_EVENT_MAP(name, map) \
252 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \
253 TP_PROTO(struct bdi_writeback *wb), \
256 LTTNG_TRACEPOINT_EVENT(writeback_bdi_register
,
257 TP_PROTO(struct backing_dev_info
*bdi
),
260 ctf_array_text(char, name
,
261 dev_name(bdi
->dev
), 32)
265 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
267 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class
,
268 TP_PROTO(struct backing_dev_info
*bdi
),
271 ctf_array_text(char, name
,
272 dev_name(bdi
->dev
), 32)
276 #undef DEFINE_WRITEBACK_EVENT
277 #define DEFINE_WRITEBACK_EVENT(name) \
278 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \
279 TP_PROTO(struct backing_dev_info *bdi), \
282 #define DEFINE_WRITEBACK_EVENT_MAP(name, map) \
283 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \
284 TP_PROTO(struct backing_dev_info *bdi), \
287 DEFINE_WRITEBACK_EVENT(writeback_bdi_register
)
289 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
291 DEFINE_WRITEBACK_EVENT(writeback_nowork
)
292 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
293 DEFINE_WRITEBACK_EVENT(writeback_wake_background
)
295 DEFINE_WRITEBACK_EVENT(writeback_wake_thread
)
296 DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread
)
297 DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister
)
298 DEFINE_WRITEBACK_EVENT(writeback_thread_start
)
299 DEFINE_WRITEBACK_EVENT(writeback_thread_stop
)
300 #if (LTTNG_KERNEL_RANGE(3,1,0, 3,2,0))
301 DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_start
, writeback_balance_dirty_start
)
302 DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_wait
, writeback_balance_dirty_wait
)
304 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_written
,
306 writeback_balance_dirty_written
,
308 TP_PROTO(struct backing_dev_info
*bdi
, int written
),
310 TP_ARGS(bdi
, written
),
313 ctf_array_text(char, name
, dev_name(bdi
->dev
), 32)
314 ctf_integer(int, written
, written
)
319 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_wbc_class
,
320 TP_PROTO(struct writeback_control
*wbc
, struct backing_dev_info
*bdi
),
323 ctf_array_text(char, name
, dev_name(bdi
->dev
), 32)
324 ctf_integer(long, nr_to_write
, wbc
->nr_to_write
)
325 ctf_integer(long, pages_skipped
, wbc
->pages_skipped
)
326 ctf_integer(int, sync_mode
, wbc
->sync_mode
)
327 ctf_integer(int, for_kupdate
, wbc
->for_kupdate
)
328 ctf_integer(int, for_background
, wbc
->for_background
)
329 ctf_integer(int, for_reclaim
, wbc
->for_reclaim
)
330 ctf_integer(int, range_cyclic
, wbc
->range_cyclic
)
331 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
332 ctf_integer(int, more_io
, wbc
->more_io
)
333 ctf_integer(unsigned long, older_than_this
,
334 wbc
->older_than_this
? *wbc
->older_than_this
: 0)
336 ctf_integer(long, range_start
, (long) wbc
->range_start
)
337 ctf_integer(long, range_end
, (long) wbc
->range_end
)
341 #undef DEFINE_WBC_EVENT
342 #define LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(name, map) \
343 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_wbc_class, name, map, \
344 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
346 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
347 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_start
, writeback_wbc_writeback_start
)
348 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_written
, writeback_wbc_writeback_written
)
349 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_wait
, writeback_wbc_writeback_wait
)
350 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_start
, writeback_wbc_balance_dirty_start
)
351 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_written
, writeback_wbc_balance_dirty_written
)
352 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait
, writeback_wbc_balance_dirty_wait
)
354 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage
, writeback_wbc_writepage
)
356 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
357 LTTNG_TRACEPOINT_EVENT(writeback_queue_io
,
358 TP_PROTO(struct bdi_writeback
*wb
,
359 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
360 struct wb_writeback_work
*work
,
362 unsigned long *older_than_this
,
365 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
366 TP_ARGS(wb
, work
, moved
),
368 TP_ARGS(wb
, older_than_this
, moved
),
371 ctf_array_text(char, name
, dev_name(wb
->bdi
->dev
), 32)
372 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
374 ctf_integer(unsigned long, older
,
375 older_than_this
? *older_than_this
: 0)
376 ctf_integer(long, age
,
378 (jiffies
- *older_than_this
) * 1000 / HZ
381 ctf_integer(int, moved
, moved
)
385 LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state
,
387 writeback_global_dirty_state
,
389 TP_PROTO(unsigned long background_thresh
,
390 unsigned long dirty_thresh
393 TP_ARGS(background_thresh
,
398 ctf_integer(unsigned long, nr_dirty
, global_page_state(NR_FILE_DIRTY
))
399 ctf_integer(unsigned long, nr_writeback
, global_page_state(NR_WRITEBACK
))
400 ctf_integer(unsigned long, nr_unstable
, global_page_state(NR_UNSTABLE_NFS
))
401 ctf_integer(unsigned long, nr_dirtied
, global_page_state(NR_DIRTIED
))
402 ctf_integer(unsigned long, nr_written
, global_page_state(NR_WRITTEN
))
403 ctf_integer(unsigned long, background_thresh
, background_thresh
)
404 ctf_integer(unsigned long, dirty_thresh
, dirty_thresh
)
405 ctf_integer(unsigned long, dirty_limit
, global_dirty_limit
)
410 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
412 #define KBps(x) ((x) << (PAGE_SHIFT - 10))
414 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
416 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit
,
418 writeback_bdi_dirty_ratelimit
,
420 TP_PROTO(struct bdi_writeback
*wb
,
421 unsigned long dirty_rate
,
422 unsigned long task_ratelimit
),
424 TP_ARGS(wb
, dirty_rate
, task_ratelimit
),
427 ctf_array_text(char, bdi
, dev_name(wb
->bdi
->dev
), 32)
428 ctf_integer(unsigned long, write_bw
, KBps(wb
->bdi
->wb
.write_bandwidth
))
429 ctf_integer(unsigned long, avg_write_bw
, KBps(wb
->bdi
->wb
.avg_write_bandwidth
))
430 ctf_integer(unsigned long, dirty_rate
, KBps(dirty_rate
))
431 ctf_integer(unsigned long, dirty_ratelimit
, KBps(wb
->bdi
->wb
.dirty_ratelimit
))
432 ctf_integer(unsigned long, task_ratelimit
, KBps(task_ratelimit
))
433 ctf_integer(unsigned long, balanced_dirty_ratelimit
,
434 KBps(wb
->bdi
->wb
.balanced_dirty_ratelimit
))
438 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
440 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit
,
442 writeback_bdi_dirty_ratelimit
,
444 TP_PROTO(struct backing_dev_info
*bdi
,
445 unsigned long dirty_rate
,
446 unsigned long task_ratelimit
),
448 TP_ARGS(bdi
, dirty_rate
, task_ratelimit
),
451 ctf_array_text(char, bdi
, dev_name(bdi
->dev
), 32)
452 ctf_integer(unsigned long, write_bw
, KBps(bdi
->wb
.write_bandwidth
))
453 ctf_integer(unsigned long, avg_write_bw
, KBps(bdi
->wb
.avg_write_bandwidth
))
454 ctf_integer(unsigned long, dirty_rate
, KBps(dirty_rate
))
455 ctf_integer(unsigned long, dirty_ratelimit
, KBps(bdi
->wb
.dirty_ratelimit
))
456 ctf_integer(unsigned long, task_ratelimit
, KBps(task_ratelimit
))
457 ctf_integer(unsigned long, balanced_dirty_ratelimit
,
458 KBps(bdi
->wb
.balanced_dirty_ratelimit
))
462 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */
464 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit
,
466 writeback_bdi_dirty_ratelimit
,
468 TP_PROTO(struct backing_dev_info
*bdi
,
469 unsigned long dirty_rate
,
470 unsigned long task_ratelimit
),
472 TP_ARGS(bdi
, dirty_rate
, task_ratelimit
),
475 ctf_array_text(char, bdi
, dev_name(bdi
->dev
), 32)
476 ctf_integer(unsigned long, write_bw
, KBps(bdi
->write_bandwidth
))
477 ctf_integer(unsigned long, avg_write_bw
, KBps(bdi
->avg_write_bandwidth
))
478 ctf_integer(unsigned long, dirty_rate
, KBps(dirty_rate
))
479 ctf_integer(unsigned long, dirty_ratelimit
, KBps(bdi
->dirty_ratelimit
))
480 ctf_integer(unsigned long, task_ratelimit
, KBps(task_ratelimit
))
481 ctf_integer(unsigned long, balanced_dirty_ratelimit
,
482 KBps(bdi
->balanced_dirty_ratelimit
))
486 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */
488 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
490 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages
,
492 writeback_balance_dirty_pages
,
494 TP_PROTO(struct bdi_writeback
*wb
,
495 unsigned long thresh
,
496 unsigned long bg_thresh
,
498 unsigned long bdi_thresh
,
499 unsigned long bdi_dirty
,
500 unsigned long dirty_ratelimit
,
501 unsigned long task_ratelimit
,
502 unsigned long dirtied
,
503 unsigned long period
,
505 unsigned long start_time
),
507 TP_ARGS(wb
, thresh
, bg_thresh
, dirty
, bdi_thresh
, bdi_dirty
,
508 dirty_ratelimit
, task_ratelimit
,
509 dirtied
, period
, pause
, start_time
513 ctf_array_text(char, bdi
, dev_name(wb
->bdi
->dev
), 32)
514 ctf_integer(unsigned long, limit
, global_dirty_limit
)
515 ctf_integer(unsigned long, setpoint
,
516 (global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2)
517 ctf_integer(unsigned long, dirty
, dirty
)
518 ctf_integer(unsigned long, bdi_setpoint
,
519 ((global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2) *
520 bdi_thresh
/ (thresh
+ 1))
521 ctf_integer(unsigned long, bdi_dirty
, bdi_dirty
)
522 ctf_integer(unsigned long, dirty_ratelimit
,
523 KBps(dirty_ratelimit
))
524 ctf_integer(unsigned long, task_ratelimit
,
525 KBps(task_ratelimit
))
526 ctf_integer(unsigned int, dirtied
, dirtied
)
527 ctf_integer(unsigned int, dirtied_pause
,
528 current
->nr_dirtied_pause
)
529 ctf_integer(unsigned long, paused
,
530 (jiffies
- start_time
) * 1000 / HZ
)
531 ctf_integer(long, pause
, pause
* 1000 / HZ
)
532 ctf_integer(unsigned long, period
,
534 ctf_integer(long, think
,
535 current
->dirty_paused_when
== 0 ? 0 :
536 (long)(jiffies
- current
->dirty_paused_when
) * 1000/HZ
)
540 #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
542 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages
,
544 writeback_balance_dirty_pages
,
546 TP_PROTO(struct backing_dev_info
*bdi
,
547 unsigned long thresh
,
548 unsigned long bg_thresh
,
550 unsigned long bdi_thresh
,
551 unsigned long bdi_dirty
,
552 unsigned long dirty_ratelimit
,
553 unsigned long task_ratelimit
,
554 unsigned long dirtied
,
555 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
556 unsigned long period
,
559 unsigned long start_time
),
561 TP_ARGS(bdi
, thresh
, bg_thresh
, dirty
, bdi_thresh
, bdi_dirty
,
562 dirty_ratelimit
, task_ratelimit
,
563 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
564 dirtied
, period
, pause
, start_time
566 dirtied
, pause
, start_time
571 ctf_array_text(char, bdi
, dev_name(bdi
->dev
), 32)
572 ctf_integer(unsigned long, limit
, global_dirty_limit
)
573 ctf_integer(unsigned long, setpoint
,
574 (global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2)
575 ctf_integer(unsigned long, dirty
, dirty
)
576 ctf_integer(unsigned long, bdi_setpoint
,
577 ((global_dirty_limit
+ (thresh
+ bg_thresh
) / 2) / 2) *
578 bdi_thresh
/ (thresh
+ 1))
579 ctf_integer(unsigned long, bdi_dirty
, bdi_dirty
)
580 ctf_integer(unsigned long, dirty_ratelimit
,
581 KBps(dirty_ratelimit
))
582 ctf_integer(unsigned long, task_ratelimit
,
583 KBps(task_ratelimit
))
584 ctf_integer(unsigned int, dirtied
, dirtied
)
585 ctf_integer(unsigned int, dirtied_pause
,
586 current
->nr_dirtied_pause
)
587 ctf_integer(unsigned long, paused
,
588 (jiffies
- start_time
) * 1000 / HZ
)
589 ctf_integer(long, pause
, pause
* 1000 / HZ
)
590 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
591 ctf_integer(unsigned long, period
,
593 ctf_integer(long, think
,
594 current
->dirty_paused_when
== 0 ? 0 :
595 (long)(jiffies
- current
->dirty_paused_when
) * 1000/HZ
)
599 #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
601 #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
603 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
604 LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue
,
606 TP_PROTO(struct inode
*inode
),
610 ctf_array_text(char, name
,
611 dev_name(inode_to_bdi(inode
)->dev
), 32)
612 ctf_integer(unsigned long, ino
, inode
->i_ino
)
613 ctf_integer(unsigned long, state
, inode
->i_state
)
614 ctf_integer(unsigned long, dirtied_when
, inode
->dirtied_when
)
619 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
620 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_congest_waited_template
,
622 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
624 TP_ARGS(usec_timeout
, usec_delayed
),
627 ctf_integer(unsigned int, usec_timeout
, usec_timeout
)
628 ctf_integer(unsigned int, usec_delayed
, usec_delayed
)
632 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template
, writeback_congestion_wait
,
634 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
636 TP_ARGS(usec_timeout
, usec_delayed
)
639 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template
, writeback_wait_iff_congested
,
641 TP_PROTO(unsigned int usec_timeout
, unsigned int usec_delayed
),
643 TP_ARGS(usec_timeout
, usec_delayed
)
647 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
648 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template
,
650 TP_PROTO(struct inode
*inode
,
651 struct writeback_control
*wbc
,
652 unsigned long nr_to_write
655 TP_ARGS(inode
, wbc
, nr_to_write
),
658 ctf_array_text(char, name
,
659 dev_name(inode_to_bdi(inode
)->dev
), 32)
660 ctf_integer(unsigned long, ino
, inode
->i_ino
)
661 ctf_integer(unsigned long, state
, inode
->i_state
)
662 ctf_integer(unsigned long, dirtied_when
, inode
->dirtied_when
)
663 ctf_integer(unsigned long, writeback_index
,
664 inode
->i_mapping
->writeback_index
)
665 ctf_integer(long, nr_to_write
, nr_to_write
)
666 ctf_integer(unsigned long, wrote
,
667 nr_to_write
- wbc
->nr_to_write
)
671 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
672 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template
, writeback_single_inode_requeue
,
673 TP_PROTO(struct inode
*inode
,
674 struct writeback_control
*wbc
,
675 unsigned long nr_to_write
),
676 TP_ARGS(inode
, wbc
, nr_to_write
)
680 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template
, writeback_single_inode
,
681 TP_PROTO(struct inode
*inode
,
682 struct writeback_control
*wbc
,
683 unsigned long nr_to_write
),
684 TP_ARGS(inode
, wbc
, nr_to_write
)
688 #endif /* LTTNG_TRACE_WRITEBACK_H */
690 /* This part must be outside protection */
691 #include "../../../probes/define_trace.h"