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