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