Commit | Line | Data |
---|---|---|
9f36eaed | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
b87700e3 AG |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM writeback | |
4 | ||
3bc29f0a MD |
5 | #if !defined(LTTNG_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_WRITEBACK_H | |
b87700e3 | 7 | |
6ec43db8 | 8 | #include <probes/lttng-tracepoint-event.h> |
aa634cd1 | 9 | #include <linux/tracepoint.h> |
b87700e3 AG |
10 | #include <linux/backing-dev.h> |
11 | #include <linux/writeback.h> | |
2d042821 | 12 | #include <lttng-kernel-version.h> |
b87700e3 AG |
13 | |
14 | #ifndef _TRACE_WRITEBACK_DEF_ | |
15 | #define _TRACE_WRITEBACK_DEF_ | |
99a570c8 | 16 | |
43b2b999 MD |
17 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \ |
18 | LTTNG_KERNEL_RANGE(5,5,3, 5,6,0) || \ | |
19 | LTTNG_KERNEL_RANGE(5,4,19, 5,5,0)) | |
20 | static inline const char *lttng_bdi_dev_name(struct backing_dev_info *bdi) | |
21 | { | |
22 | return bdi_dev_name(bdi); | |
23 | } | |
24 | #else | |
25 | static inline const char *lttng_bdi_dev_name(struct backing_dev_info *bdi) | |
26 | { | |
27 | if (!bdi || !bdi->dev) | |
28 | return "(unknown)"; | |
29 | return dev_name(bdi->dev); | |
30 | } | |
31 | #endif | |
32 | ||
70f6fc80 MJ |
33 | /* |
34 | * Vanilla kernels before 4.0 do not implement inode_to_bdi | |
35 | * RHEL kernels before 3.10.0-327.10.1 do not implement inode_to_bdi | |
36 | * RHEL kernel 3.10.0-327.10.1 has inode_to_bdi | |
37 | * RHEL kernel 3.10.0-327.13.1 includes a partial merge of upstream | |
38 | * commit a212b105b07d75b48b1a166378282e8a77fbf53d which inlines | |
39 | * inode_to_bdi but not sb_is_blkdev_sb making it unusable by modules. | |
40 | */ | |
2d042821 | 41 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,0,0)) |
70f6fc80 | 42 | static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) |
b87700e3 | 43 | { |
70f6fc80 MJ |
44 | struct super_block *sb; |
45 | ||
46 | if (!inode) | |
47 | return &noop_backing_dev_info; | |
48 | ||
49 | sb = inode->i_sb; | |
b87700e3 AG |
50 | |
51 | if (strcmp(sb->s_type->name, "bdev") == 0) | |
52 | return inode->i_mapping->backing_dev_info; | |
53 | ||
54 | return sb->s_bdi; | |
55 | } | |
70f6fc80 MJ |
56 | #else |
57 | static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) | |
58 | { | |
59 | return inode_to_bdi(inode); | |
60 | } | |
2d042821 | 61 | #endif /* #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,0,0)) */ |
99a570c8 | 62 | |
b87700e3 AG |
63 | #endif |
64 | ||
2d042821 | 65 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0)) |
eae02feb MJ |
66 | #define show_inode_state(state) \ |
67 | __print_flags(state, "|", \ | |
68 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ | |
69 | {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ | |
70 | {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ | |
71 | {I_NEW, "I_NEW"}, \ | |
72 | {I_WILL_FREE, "I_WILL_FREE"}, \ | |
73 | {I_FREEING, "I_FREEING"}, \ | |
74 | {I_CLEAR, "I_CLEAR"}, \ | |
75 | {I_SYNC, "I_SYNC"}, \ | |
76 | {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ | |
77 | {I_REFERENCED, "I_REFERENCED"} \ | |
78 | ) | |
2d042821 | 79 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) |
99a570c8 MD |
80 | #define show_inode_state(state) \ |
81 | __print_flags(state, "|", \ | |
82 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ | |
83 | {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ | |
84 | {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ | |
85 | {I_NEW, "I_NEW"}, \ | |
86 | {I_WILL_FREE, "I_WILL_FREE"}, \ | |
87 | {I_FREEING, "I_FREEING"}, \ | |
88 | {I_CLEAR, "I_CLEAR"}, \ | |
89 | {I_SYNC, "I_SYNC"}, \ | |
90 | {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ | |
91 | {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \ | |
92 | {I_REFERENCED, "I_REFERENCED"} \ | |
93 | ) | |
2d042821 | 94 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) */ |
b87700e3 AG |
95 | #define show_inode_state(state) \ |
96 | __print_flags(state, "|", \ | |
97 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ | |
98 | {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ | |
99 | {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ | |
100 | {I_NEW, "I_NEW"}, \ | |
101 | {I_WILL_FREE, "I_WILL_FREE"}, \ | |
102 | {I_FREEING, "I_FREEING"}, \ | |
103 | {I_CLEAR, "I_CLEAR"}, \ | |
104 | {I_SYNC, "I_SYNC"}, \ | |
105 | {I_REFERENCED, "I_REFERENCED"} \ | |
106 | ) | |
2d042821 | 107 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) */ |
b87700e3 | 108 | |
2d042821 | 109 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) |
99a570c8 MD |
110 | |
111 | LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, | |
112 | TP_PROTO(struct page *page, struct address_space *mapping), | |
113 | TP_ARGS(page, mapping), | |
f127e61e | 114 | TP_FIELDS( |
43b2b999 | 115 | ctf_string(name, lttng_bdi_dev_name(mapping ? lttng_inode_to_bdi(mapping->host) : NULL)) |
f127e61e MD |
116 | ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) |
117 | ctf_integer(pgoff_t, index, page->index) | |
99a570c8 MD |
118 | ) |
119 | ) | |
120 | ||
121 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template, | |
122 | TP_PROTO(struct inode *inode, int flags), | |
123 | TP_ARGS(inode, flags), | |
f127e61e | 124 | TP_FIELDS( |
99a570c8 | 125 | /* may be called for files on pseudo FSes w/ unregistered bdi */ |
43b2b999 | 126 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) |
f127e61e MD |
127 | ctf_integer(unsigned long, ino, inode->i_ino) |
128 | ctf_integer(unsigned long, state, inode->i_state) | |
129 | ctf_integer(unsigned long, flags, flags) | |
99a570c8 MD |
130 | ) |
131 | ) | |
132 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \ | |
133 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \ | |
134 | TP_PROTO(struct inode *inode, int flags), \ | |
135 | TP_ARGS(inode, flags)) | |
136 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start) | |
137 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode) | |
138 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_mark_inode_dirty) | |
139 | ||
140 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template, | |
141 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | |
142 | TP_ARGS(inode, wbc), | |
f127e61e | 143 | TP_FIELDS( |
43b2b999 | 144 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) |
f127e61e MD |
145 | ctf_integer(unsigned long, ino, inode->i_ino) |
146 | ctf_integer(int, sync_mode, wbc->sync_mode) | |
99a570c8 MD |
147 | ) |
148 | ) | |
149 | ||
150 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \ | |
151 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \ | |
152 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), \ | |
153 | TP_ARGS(inode, wbc)) | |
154 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) | |
155 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) | |
156 | ||
2d042821 | 157 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) |
99a570c8 | 158 | |
aa634cd1 JD |
159 | LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, |
160 | TP_PROTO(struct page *page, struct address_space *mapping), | |
161 | TP_ARGS(page, mapping), | |
f127e61e | 162 | TP_FIELDS( |
43b2b999 | 163 | ctf_string(name, lttng_bdi_dev_name(mapping ? mapping->backing_dev_info : NULL)) |
f127e61e MD |
164 | ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) |
165 | ctf_integer(pgoff_t, index, page->index) | |
aa634cd1 JD |
166 | ) |
167 | ) | |
168 | ||
169 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template, | |
170 | TP_PROTO(struct inode *inode, int flags), | |
171 | TP_ARGS(inode, flags), | |
f127e61e | 172 | TP_FIELDS( |
aa634cd1 | 173 | /* may be called for files on pseudo FSes w/ unregistered bdi */ |
43b2b999 | 174 | ctf_string(name, lttng_bdi_dev_name(inode->i_mapping->backing_dev_info)) |
f127e61e MD |
175 | ctf_integer(unsigned long, ino, inode->i_ino) |
176 | ctf_integer(unsigned long, flags, flags) | |
aa634cd1 JD |
177 | ) |
178 | ) | |
179 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \ | |
180 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \ | |
181 | TP_PROTO(struct inode *inode, int flags), \ | |
182 | TP_ARGS(inode, flags)) | |
183 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start) | |
184 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode) | |
185 | ||
186 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template, | |
187 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | |
188 | TP_ARGS(inode, wbc), | |
f127e61e | 189 | TP_FIELDS( |
43b2b999 | 190 | ctf_string(name, lttng_bdi_dev_name(inode->i_mapping->backing_dev_info)) |
f127e61e MD |
191 | ctf_integer(unsigned long, ino, inode->i_ino) |
192 | ctf_integer(int, sync_mode, wbc->sync_mode) | |
aa634cd1 JD |
193 | ) |
194 | ) | |
195 | ||
196 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \ | |
197 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \ | |
198 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), \ | |
199 | TP_ARGS(inode, wbc)) | |
200 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) | |
201 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) | |
99a570c8 | 202 | |
2d042821 | 203 | #endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) */ |
aa634cd1 | 204 | |
2d042821 | 205 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) |
a40cb509 MD |
206 | |
207 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, | |
208 | TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), | |
209 | TP_ARGS(wb, work), | |
210 | TP_FIELDS( | |
43b2b999 | 211 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) |
a40cb509 MD |
212 | ) |
213 | ) | |
214 | ||
43b2b999 | 215 | #else |
99a570c8 | 216 | |
3bc29f0a | 217 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, |
b87700e3 AG |
218 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), |
219 | TP_ARGS(bdi, work), | |
f127e61e | 220 | TP_FIELDS( |
43b2b999 | 221 | ctf_string(name, lttng_bdi_dev_name(bdi)) |
b87700e3 | 222 | ) |
b87700e3 | 223 | ) |
99a570c8 | 224 | |
43b2b999 | 225 | #endif /* #else if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ |
99a570c8 | 226 | |
2d042821 | 227 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) |
a40cb509 MD |
228 | |
229 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ | |
230 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ | |
231 | TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \ | |
232 | TP_ARGS(wb, work)) | |
233 | ||
2d042821 | 234 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ |
a40cb509 | 235 | |
3bc29f0a MD |
236 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ |
237 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ | |
b87700e3 AG |
238 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \ |
239 | TP_ARGS(bdi, work)) | |
a40cb509 | 240 | |
2d042821 | 241 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ |
a40cb509 | 242 | |
3bc29f0a MD |
243 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_nothread) |
244 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_queue) | |
245 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_exec) | |
2d042821 | 246 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) |
3bc29f0a MD |
247 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_start) |
248 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_written) | |
249 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_wait) | |
b87700e3 AG |
250 | #endif |
251 | ||
3bc29f0a | 252 | LTTNG_TRACEPOINT_EVENT(writeback_pages_written, |
b87700e3 AG |
253 | TP_PROTO(long pages_written), |
254 | TP_ARGS(pages_written), | |
f127e61e MD |
255 | TP_FIELDS( |
256 | ctf_integer(long, pages, pages_written) | |
257 | ) | |
b87700e3 AG |
258 | ) |
259 | ||
2d042821 | 260 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) |
a40cb509 MD |
261 | |
262 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, | |
263 | TP_PROTO(struct bdi_writeback *wb), | |
264 | TP_ARGS(wb), | |
265 | TP_FIELDS( | |
43b2b999 | 266 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) |
a40cb509 MD |
267 | ) |
268 | ) | |
269 | ||
270 | #undef DEFINE_WRITEBACK_EVENT | |
271 | #define DEFINE_WRITEBACK_EVENT(name) \ | |
272 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \ | |
273 | TP_PROTO(struct bdi_writeback *wb), \ | |
274 | TP_ARGS(wb)) | |
275 | ||
276 | #define DEFINE_WRITEBACK_EVENT_MAP(name, map) \ | |
277 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \ | |
278 | TP_PROTO(struct bdi_writeback *wb), \ | |
279 | TP_ARGS(wb)) | |
280 | ||
281 | LTTNG_TRACEPOINT_EVENT(writeback_bdi_register, | |
282 | TP_PROTO(struct backing_dev_info *bdi), | |
283 | TP_ARGS(bdi), | |
284 | TP_FIELDS( | |
43b2b999 | 285 | ctf_string(name, lttng_bdi_dev_name(bdi)) |
a40cb509 MD |
286 | ) |
287 | ) | |
288 | ||
2d042821 | 289 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ |
a40cb509 | 290 | |
3bc29f0a | 291 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, |
b87700e3 AG |
292 | TP_PROTO(struct backing_dev_info *bdi), |
293 | TP_ARGS(bdi), | |
f127e61e | 294 | TP_FIELDS( |
43b2b999 | 295 | ctf_string(name, lttng_bdi_dev_name(bdi)) |
b87700e3 AG |
296 | ) |
297 | ) | |
a40cb509 | 298 | |
59fecd6c | 299 | #undef DEFINE_WRITEBACK_EVENT |
b87700e3 | 300 | #define DEFINE_WRITEBACK_EVENT(name) \ |
3bc29f0a | 301 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \ |
b87700e3 AG |
302 | TP_PROTO(struct backing_dev_info *bdi), \ |
303 | TP_ARGS(bdi)) | |
304 | ||
9cf29d3e | 305 | #define DEFINE_WRITEBACK_EVENT_MAP(name, map) \ |
3bc29f0a | 306 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \ |
9cf29d3e MD |
307 | TP_PROTO(struct backing_dev_info *bdi), \ |
308 | TP_ARGS(bdi)) | |
309 | ||
a40cb509 MD |
310 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register) |
311 | ||
2d042821 | 312 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ |
a40cb509 | 313 | |
b87700e3 | 314 | DEFINE_WRITEBACK_EVENT(writeback_nowork) |
b87700e3 | 315 | DEFINE_WRITEBACK_EVENT(writeback_wake_background) |
b87700e3 AG |
316 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread) |
317 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread) | |
b87700e3 AG |
318 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister) |
319 | DEFINE_WRITEBACK_EVENT(writeback_thread_start) | |
320 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop) | |
321 | #if (LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) | |
9cf29d3e MD |
322 | DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_start, writeback_balance_dirty_start) |
323 | DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_wait, writeback_balance_dirty_wait) | |
324 | ||
3bc29f0a | 325 | LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_written, |
b87700e3 | 326 | |
9cf29d3e | 327 | writeback_balance_dirty_written, |
b87700e3 AG |
328 | |
329 | TP_PROTO(struct backing_dev_info *bdi, int written), | |
330 | ||
331 | TP_ARGS(bdi, written), | |
332 | ||
f127e61e | 333 | TP_FIELDS( |
43b2b999 | 334 | ctf_string(name, lttng_bdi_dev_name(bdi)) |
f127e61e | 335 | ctf_integer(int, written, written) |
b87700e3 AG |
336 | ) |
337 | ) | |
338 | #endif | |
339 | ||
3bc29f0a | 340 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_wbc_class, |
b87700e3 AG |
341 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), |
342 | TP_ARGS(wbc, bdi), | |
f127e61e | 343 | TP_FIELDS( |
43b2b999 | 344 | ctf_string(name, lttng_bdi_dev_name(bdi)) |
f127e61e MD |
345 | ctf_integer(long, nr_to_write, wbc->nr_to_write) |
346 | ctf_integer(long, pages_skipped, wbc->pages_skipped) | |
347 | ctf_integer(int, sync_mode, wbc->sync_mode) | |
348 | ctf_integer(int, for_kupdate, wbc->for_kupdate) | |
349 | ctf_integer(int, for_background, wbc->for_background) | |
350 | ctf_integer(int, for_reclaim, wbc->for_reclaim) | |
351 | ctf_integer(int, range_cyclic, wbc->range_cyclic) | |
2d042821 | 352 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,1,0)) |
f127e61e MD |
353 | ctf_integer(int, more_io, wbc->more_io) |
354 | ctf_integer(unsigned long, older_than_this, | |
355 | wbc->older_than_this ? *wbc->older_than_this : 0) | |
b87700e3 | 356 | #endif |
f127e61e MD |
357 | ctf_integer(long, range_start, (long) wbc->range_start) |
358 | ctf_integer(long, range_end, (long) wbc->range_end) | |
359 | ) | |
b87700e3 AG |
360 | ) |
361 | ||
9cf29d3e | 362 | #undef DEFINE_WBC_EVENT |
3bc29f0a MD |
363 | #define LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(name, map) \ |
364 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_wbc_class, name, map, \ | |
b87700e3 AG |
365 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ |
366 | TP_ARGS(wbc, bdi)) | |
2d042821 | 367 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,1,0)) |
3bc29f0a MD |
368 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_start, writeback_wbc_writeback_start) |
369 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_written, writeback_wbc_writeback_written) | |
370 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_wait, writeback_wbc_writeback_wait) | |
371 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_start, writeback_wbc_balance_dirty_start) | |
372 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_written, writeback_wbc_balance_dirty_written) | |
373 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait, writeback_wbc_balance_dirty_wait) | |
b87700e3 | 374 | #endif |
3bc29f0a | 375 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage) |
b87700e3 | 376 | |
2d042821 | 377 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0) || \ |
b74b25f3 MJ |
378 | LTTNG_KERNEL_RANGE(5,8,6, 5,9,0) || \ |
379 | LTTNG_KERNEL_RANGE(5,4,62, 5,5,0) || \ | |
380 | LTTNG_KERNEL_RANGE(4,19,143, 4,20,0) || \ | |
381 | LTTNG_KERNEL_RANGE(4,14,196, 4,15,0) || \ | |
382 | LTTNG_KERNEL_RANGE(4,9,235, 4,10,0) || \ | |
01a12501 MJ |
383 | LTTNG_KERNEL_RANGE(4,4,235, 4,5,0) || \ |
384 | LTTNG_UBUNTU_KERNEL_RANGE(4,15,18,119, 4,16,0,0)) | |
87b2affc MJ |
385 | LTTNG_TRACEPOINT_EVENT(writeback_queue_io, |
386 | TP_PROTO(struct bdi_writeback *wb, | |
387 | struct wb_writeback_work *work, | |
388 | unsigned long dirtied_before, | |
389 | int moved), | |
390 | TP_ARGS(wb, work, dirtied_before, moved), | |
391 | TP_FIELDS( | |
43b2b999 | 392 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) |
87b2affc MJ |
393 | ctf_integer(unsigned long, older, dirtied_before) |
394 | ctf_integer(int, moved, moved) | |
395 | ) | |
396 | ) | |
2d042821 | 397 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) |
3bc29f0a | 398 | LTTNG_TRACEPOINT_EVENT(writeback_queue_io, |
b87700e3 | 399 | TP_PROTO(struct bdi_writeback *wb, |
b87700e3 | 400 | struct wb_writeback_work *work, |
b87700e3 | 401 | int moved), |
b87700e3 | 402 | TP_ARGS(wb, work, moved), |
87b2affc | 403 | TP_FIELDS( |
43b2b999 | 404 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) |
87b2affc MJ |
405 | ctf_integer(int, moved, moved) |
406 | ) | |
407 | ) | |
2d042821 | 408 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) |
87b2affc MJ |
409 | LTTNG_TRACEPOINT_EVENT(writeback_queue_io, |
410 | TP_PROTO(struct bdi_writeback *wb, | |
411 | unsigned long *older_than_this, | |
412 | int moved), | |
b87700e3 | 413 | TP_ARGS(wb, older_than_this, moved), |
f127e61e | 414 | TP_FIELDS( |
43b2b999 | 415 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) |
f127e61e MD |
416 | ctf_integer(unsigned long, older, |
417 | older_than_this ? *older_than_this : 0) | |
418 | ctf_integer(long, age, | |
419 | older_than_this ? | |
420 | (jiffies - *older_than_this) * 1000 / HZ | |
421 | : -1) | |
f127e61e | 422 | ctf_integer(int, moved, moved) |
b87700e3 | 423 | ) |
b87700e3 | 424 | ) |
87b2affc | 425 | #endif |
b87700e3 | 426 | |
2d042821 | 427 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,8,0)) |
94285cfb MJ |
428 | LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, |
429 | ||
430 | writeback_global_dirty_state, | |
431 | ||
432 | TP_PROTO(unsigned long background_thresh, | |
433 | unsigned long dirty_thresh | |
434 | ), | |
435 | ||
436 | TP_ARGS(background_thresh, | |
437 | dirty_thresh | |
438 | ), | |
439 | ||
440 | TP_FIELDS( | |
441 | ctf_integer(unsigned long, nr_dirty, global_node_page_state(NR_FILE_DIRTY)) | |
442 | ctf_integer(unsigned long, nr_writeback, global_node_page_state(NR_WRITEBACK)) | |
443 | ctf_integer(unsigned long, nr_dirtied, global_node_page_state(NR_DIRTIED)) | |
444 | ctf_integer(unsigned long, nr_written, global_node_page_state(NR_WRITTEN)) | |
445 | ctf_integer(unsigned long, background_thresh, background_thresh) | |
446 | ctf_integer(unsigned long, dirty_thresh, dirty_thresh) | |
447 | ctf_integer(unsigned long, dirty_limit, global_dirty_limit) | |
448 | ) | |
449 | ) | |
2d042821 | 450 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) |
7ceeb15d MJ |
451 | LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, |
452 | ||
453 | writeback_global_dirty_state, | |
454 | ||
455 | TP_PROTO(unsigned long background_thresh, | |
456 | unsigned long dirty_thresh | |
457 | ), | |
458 | ||
459 | TP_ARGS(background_thresh, | |
460 | dirty_thresh | |
461 | ), | |
462 | ||
463 | TP_FIELDS( | |
464 | ctf_integer(unsigned long, nr_dirty, global_node_page_state(NR_FILE_DIRTY)) | |
465 | ctf_integer(unsigned long, nr_writeback, global_node_page_state(NR_WRITEBACK)) | |
466 | ctf_integer(unsigned long, nr_unstable, global_node_page_state(NR_UNSTABLE_NFS)) | |
467 | ctf_integer(unsigned long, nr_dirtied, global_node_page_state(NR_DIRTIED)) | |
468 | ctf_integer(unsigned long, nr_written, global_node_page_state(NR_WRITTEN)) | |
469 | ctf_integer(unsigned long, background_thresh, background_thresh) | |
470 | ctf_integer(unsigned long, dirty_thresh, dirty_thresh) | |
471 | ctf_integer(unsigned long, dirty_limit, global_dirty_limit) | |
472 | ) | |
473 | ) | |
2d042821 | 474 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) |
3bc29f0a | 475 | LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, |
9cf29d3e MD |
476 | |
477 | writeback_global_dirty_state, | |
b87700e3 AG |
478 | |
479 | TP_PROTO(unsigned long background_thresh, | |
480 | unsigned long dirty_thresh | |
481 | ), | |
482 | ||
483 | TP_ARGS(background_thresh, | |
484 | dirty_thresh | |
485 | ), | |
486 | ||
f127e61e MD |
487 | TP_FIELDS( |
488 | ctf_integer(unsigned long, nr_dirty, global_page_state(NR_FILE_DIRTY)) | |
489 | ctf_integer(unsigned long, nr_writeback, global_page_state(NR_WRITEBACK)) | |
490 | ctf_integer(unsigned long, nr_unstable, global_page_state(NR_UNSTABLE_NFS)) | |
491 | ctf_integer(unsigned long, nr_dirtied, global_page_state(NR_DIRTIED)) | |
492 | ctf_integer(unsigned long, nr_written, global_page_state(NR_WRITTEN)) | |
493 | ctf_integer(unsigned long, background_thresh, background_thresh) | |
494 | ctf_integer(unsigned long, dirty_thresh, dirty_thresh) | |
495 | ctf_integer(unsigned long, dirty_limit, global_dirty_limit) | |
b87700e3 AG |
496 | ) |
497 | ) | |
498 | #endif | |
499 | ||
2d042821 | 500 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) |
b87700e3 AG |
501 | |
502 | #define KBps(x) ((x) << (PAGE_SHIFT - 10)) | |
503 | ||
2d042821 | 504 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) |
a40cb509 MD |
505 | |
506 | LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, | |
507 | ||
508 | writeback_bdi_dirty_ratelimit, | |
509 | ||
510 | TP_PROTO(struct bdi_writeback *wb, | |
511 | unsigned long dirty_rate, | |
512 | unsigned long task_ratelimit), | |
513 | ||
514 | TP_ARGS(wb, dirty_rate, task_ratelimit), | |
515 | ||
516 | TP_FIELDS( | |
43b2b999 | 517 | ctf_string(bdi, lttng_bdi_dev_name(wb->bdi)) |
a40cb509 MD |
518 | ctf_integer(unsigned long, write_bw, KBps(wb->bdi->wb.write_bandwidth)) |
519 | ctf_integer(unsigned long, avg_write_bw, KBps(wb->bdi->wb.avg_write_bandwidth)) | |
520 | ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) | |
521 | ctf_integer(unsigned long, dirty_ratelimit, KBps(wb->bdi->wb.dirty_ratelimit)) | |
522 | ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) | |
523 | ctf_integer(unsigned long, balanced_dirty_ratelimit, | |
524 | KBps(wb->bdi->wb.balanced_dirty_ratelimit)) | |
525 | ) | |
526 | ) | |
527 | ||
2d042821 | 528 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) |
c7d89a6d | 529 | |
3bc29f0a | 530 | LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, |
9cf29d3e MD |
531 | |
532 | writeback_bdi_dirty_ratelimit, | |
b87700e3 AG |
533 | |
534 | TP_PROTO(struct backing_dev_info *bdi, | |
535 | unsigned long dirty_rate, | |
536 | unsigned long task_ratelimit), | |
537 | ||
538 | TP_ARGS(bdi, dirty_rate, task_ratelimit), | |
539 | ||
f127e61e | 540 | TP_FIELDS( |
43b2b999 | 541 | ctf_string(bdi, lttng_bdi_dev_name(bdi)) |
902947a4 MJ |
542 | ctf_integer(unsigned long, write_bw, KBps(bdi->wb.write_bandwidth)) |
543 | ctf_integer(unsigned long, avg_write_bw, KBps(bdi->wb.avg_write_bandwidth)) | |
f127e61e | 544 | ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) |
902947a4 | 545 | ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->wb.dirty_ratelimit)) |
f127e61e | 546 | ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) |
902947a4 MJ |
547 | ctf_integer(unsigned long, balanced_dirty_ratelimit, |
548 | KBps(bdi->wb.balanced_dirty_ratelimit)) | |
c7d89a6d MD |
549 | ) |
550 | ) | |
551 | ||
2d042821 | 552 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ |
c7d89a6d MD |
553 | |
554 | LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, | |
555 | ||
556 | writeback_bdi_dirty_ratelimit, | |
557 | ||
558 | TP_PROTO(struct backing_dev_info *bdi, | |
559 | unsigned long dirty_rate, | |
560 | unsigned long task_ratelimit), | |
561 | ||
562 | TP_ARGS(bdi, dirty_rate, task_ratelimit), | |
563 | ||
564 | TP_FIELDS( | |
43b2b999 | 565 | ctf_string(bdi, lttng_bdi_dev_name(bdi)) |
c7d89a6d MD |
566 | ctf_integer(unsigned long, write_bw, KBps(bdi->write_bandwidth)) |
567 | ctf_integer(unsigned long, avg_write_bw, KBps(bdi->avg_write_bandwidth)) | |
568 | ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) | |
569 | ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->dirty_ratelimit)) | |
570 | ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) | |
f127e61e | 571 | ctf_integer(unsigned long, balanced_dirty_ratelimit, |
b87700e3 | 572 | KBps(bdi->balanced_dirty_ratelimit)) |
b87700e3 AG |
573 | ) |
574 | ) | |
575 | ||
2d042821 | 576 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ |
c7d89a6d | 577 | |
2d042821 | 578 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) |
a40cb509 MD |
579 | |
580 | LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, | |
581 | ||
582 | writeback_balance_dirty_pages, | |
583 | ||
584 | TP_PROTO(struct bdi_writeback *wb, | |
585 | unsigned long thresh, | |
586 | unsigned long bg_thresh, | |
587 | unsigned long dirty, | |
588 | unsigned long bdi_thresh, | |
589 | unsigned long bdi_dirty, | |
590 | unsigned long dirty_ratelimit, | |
591 | unsigned long task_ratelimit, | |
592 | unsigned long dirtied, | |
593 | unsigned long period, | |
594 | long pause, | |
595 | unsigned long start_time), | |
596 | ||
597 | TP_ARGS(wb, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, | |
598 | dirty_ratelimit, task_ratelimit, | |
599 | dirtied, period, pause, start_time | |
600 | ), | |
601 | ||
602 | TP_FIELDS( | |
43b2b999 | 603 | ctf_string(bdi, lttng_bdi_dev_name(wb->bdi)) |
a40cb509 MD |
604 | ctf_integer(unsigned long, limit, global_dirty_limit) |
605 | ctf_integer(unsigned long, setpoint, | |
606 | (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) | |
607 | ctf_integer(unsigned long, dirty, dirty) | |
608 | ctf_integer(unsigned long, bdi_setpoint, | |
609 | ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) * | |
610 | bdi_thresh / (thresh + 1)) | |
611 | ctf_integer(unsigned long, bdi_dirty, bdi_dirty) | |
612 | ctf_integer(unsigned long, dirty_ratelimit, | |
613 | KBps(dirty_ratelimit)) | |
614 | ctf_integer(unsigned long, task_ratelimit, | |
615 | KBps(task_ratelimit)) | |
616 | ctf_integer(unsigned int, dirtied, dirtied) | |
617 | ctf_integer(unsigned int, dirtied_pause, | |
618 | current->nr_dirtied_pause) | |
619 | ctf_integer(unsigned long, paused, | |
620 | (jiffies - start_time) * 1000 / HZ) | |
621 | ctf_integer(long, pause, pause * 1000 / HZ) | |
622 | ctf_integer(unsigned long, period, | |
623 | period * 1000 / HZ) | |
624 | ctf_integer(long, think, | |
625 | current->dirty_paused_when == 0 ? 0 : | |
626 | (long)(jiffies - current->dirty_paused_when) * 1000/HZ) | |
627 | ) | |
628 | ) | |
629 | ||
2d042821 | 630 | #else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ |
a40cb509 | 631 | |
3bc29f0a | 632 | LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, |
9cf29d3e MD |
633 | |
634 | writeback_balance_dirty_pages, | |
b87700e3 AG |
635 | |
636 | TP_PROTO(struct backing_dev_info *bdi, | |
637 | unsigned long thresh, | |
638 | unsigned long bg_thresh, | |
639 | unsigned long dirty, | |
640 | unsigned long bdi_thresh, | |
641 | unsigned long bdi_dirty, | |
642 | unsigned long dirty_ratelimit, | |
643 | unsigned long task_ratelimit, | |
644 | unsigned long dirtied, | |
2d042821 | 645 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) |
b87700e3 AG |
646 | unsigned long period, |
647 | #endif | |
648 | long pause, | |
649 | unsigned long start_time), | |
650 | ||
651 | TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, | |
652 | dirty_ratelimit, task_ratelimit, | |
2d042821 | 653 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) |
f127e61e | 654 | dirtied, period, pause, start_time |
b87700e3 | 655 | #else |
f127e61e | 656 | dirtied, pause, start_time |
b87700e3 AG |
657 | #endif |
658 | ), | |
659 | ||
f127e61e | 660 | TP_FIELDS( |
43b2b999 | 661 | ctf_string(bdi, lttng_bdi_dev_name(bdi)) |
f127e61e MD |
662 | ctf_integer(unsigned long, limit, global_dirty_limit) |
663 | ctf_integer(unsigned long, setpoint, | |
b87700e3 | 664 | (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) |
f127e61e MD |
665 | ctf_integer(unsigned long, dirty, dirty) |
666 | ctf_integer(unsigned long, bdi_setpoint, | |
b87700e3 | 667 | ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) * |
f127e61e MD |
668 | bdi_thresh / (thresh + 1)) |
669 | ctf_integer(unsigned long, bdi_dirty, bdi_dirty) | |
670 | ctf_integer(unsigned long, dirty_ratelimit, | |
671 | KBps(dirty_ratelimit)) | |
672 | ctf_integer(unsigned long, task_ratelimit, | |
673 | KBps(task_ratelimit)) | |
674 | ctf_integer(unsigned int, dirtied, dirtied) | |
675 | ctf_integer(unsigned int, dirtied_pause, | |
676 | current->nr_dirtied_pause) | |
677 | ctf_integer(unsigned long, paused, | |
678 | (jiffies - start_time) * 1000 / HZ) | |
679 | ctf_integer(long, pause, pause * 1000 / HZ) | |
2d042821 | 680 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) |
f127e61e MD |
681 | ctf_integer(unsigned long, period, |
682 | period * 1000 / HZ) | |
683 | ctf_integer(long, think, | |
684 | current->dirty_paused_when == 0 ? 0 : | |
685 | (long)(jiffies - current->dirty_paused_when) * 1000/HZ) | |
b87700e3 | 686 | #endif |
f127e61e | 687 | ) |
b87700e3 | 688 | ) |
2d042821 | 689 | #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ |
a40cb509 | 690 | |
2d042821 | 691 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) */ |
b87700e3 | 692 | |
2d042821 | 693 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) |
3bc29f0a | 694 | LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue, |
b87700e3 AG |
695 | |
696 | TP_PROTO(struct inode *inode), | |
697 | TP_ARGS(inode), | |
698 | ||
f127e61e | 699 | TP_FIELDS( |
43b2b999 | 700 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) |
f127e61e MD |
701 | ctf_integer(unsigned long, ino, inode->i_ino) |
702 | ctf_integer(unsigned long, state, inode->i_state) | |
703 | ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) | |
b87700e3 AG |
704 | ) |
705 | ) | |
706 | #endif | |
707 | ||
3bc29f0a | 708 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_congest_waited_template, |
b87700e3 AG |
709 | |
710 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), | |
711 | ||
712 | TP_ARGS(usec_timeout, usec_delayed), | |
713 | ||
f127e61e MD |
714 | TP_FIELDS( |
715 | ctf_integer(unsigned int, usec_timeout, usec_timeout) | |
716 | ctf_integer(unsigned int, usec_delayed, usec_delayed) | |
717 | ) | |
b87700e3 AG |
718 | ) |
719 | ||
3bc29f0a | 720 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_congestion_wait, |
b87700e3 AG |
721 | |
722 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), | |
723 | ||
724 | TP_ARGS(usec_timeout, usec_delayed) | |
725 | ) | |
726 | ||
3bc29f0a | 727 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_wait_iff_congested, |
b87700e3 AG |
728 | |
729 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), | |
730 | ||
731 | TP_ARGS(usec_timeout, usec_delayed) | |
732 | ) | |
b87700e3 | 733 | |
2d042821 | 734 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) |
3bc29f0a | 735 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template, |
b87700e3 AG |
736 | |
737 | TP_PROTO(struct inode *inode, | |
738 | struct writeback_control *wbc, | |
739 | unsigned long nr_to_write | |
740 | ), | |
741 | ||
742 | TP_ARGS(inode, wbc, nr_to_write), | |
743 | ||
f127e61e | 744 | TP_FIELDS( |
43b2b999 | 745 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) |
f127e61e MD |
746 | ctf_integer(unsigned long, ino, inode->i_ino) |
747 | ctf_integer(unsigned long, state, inode->i_state) | |
748 | ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) | |
749 | ctf_integer(unsigned long, writeback_index, | |
750 | inode->i_mapping->writeback_index) | |
751 | ctf_integer(long, nr_to_write, nr_to_write) | |
752 | ctf_integer(unsigned long, wrote, | |
753 | nr_to_write - wbc->nr_to_write) | |
b87700e3 AG |
754 | ) |
755 | ) | |
756 | ||
2d042821 | 757 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) |
3bc29f0a | 758 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode_requeue, |
b87700e3 AG |
759 | TP_PROTO(struct inode *inode, |
760 | struct writeback_control *wbc, | |
761 | unsigned long nr_to_write), | |
762 | TP_ARGS(inode, wbc, nr_to_write) | |
763 | ) | |
764 | #endif | |
765 | ||
3bc29f0a | 766 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode, |
b87700e3 AG |
767 | TP_PROTO(struct inode *inode, |
768 | struct writeback_control *wbc, | |
769 | unsigned long nr_to_write), | |
770 | TP_ARGS(inode, wbc, nr_to_write) | |
771 | ) | |
772 | #endif | |
773 | ||
3bc29f0a | 774 | #endif /* LTTNG_TRACE_WRITEBACK_H */ |
b87700e3 AG |
775 | |
776 | /* This part must be outside protection */ | |
6ec43db8 | 777 | #include <probes/define_trace.h> |