Fix: writeback instrumentation for 4.2 kernels
[lttng-modules.git] / instrumentation / events / lttng-module / writeback.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM writeback
3
4 #if !defined(LTTNG_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_WRITEBACK_H
6
7 #include "../../../probes/lttng-tracepoint-event.h"
8 #include <linux/tracepoint.h>
9 #include <linux/backing-dev.h>
10 #include <linux/writeback.h>
11 #include <linux/version.h>
12
13 #ifndef _TRACE_WRITEBACK_DEF_
14 #define _TRACE_WRITEBACK_DEF_
15
16 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0))
17 static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
18 {
19 struct super_block *sb = inode->i_sb;
20
21 if (strcmp(sb->s_type->name, "bdev") == 0)
22 return inode->i_mapping->backing_dev_info;
23
24 return sb->s_bdi;
25 }
26 #endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) */
27
28 #endif
29
30 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
31 #define show_inode_state(state) \
32 __print_flags(state, "|", \
33 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
34 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
35 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
36 {I_NEW, "I_NEW"}, \
37 {I_WILL_FREE, "I_WILL_FREE"}, \
38 {I_FREEING, "I_FREEING"}, \
39 {I_CLEAR, "I_CLEAR"}, \
40 {I_SYNC, "I_SYNC"}, \
41 {I_DIRTY_TIME, "I_DIRTY_TIME"}, \
42 {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \
43 {I_REFERENCED, "I_REFERENCED"} \
44 )
45 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
46 #define show_inode_state(state) \
47 __print_flags(state, "|", \
48 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
49 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
50 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
51 {I_NEW, "I_NEW"}, \
52 {I_WILL_FREE, "I_WILL_FREE"}, \
53 {I_FREEING, "I_FREEING"}, \
54 {I_CLEAR, "I_CLEAR"}, \
55 {I_SYNC, "I_SYNC"}, \
56 {I_REFERENCED, "I_REFERENCED"} \
57 )
58 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
59
60 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
61
62 LTTNG_TRACEPOINT_EVENT(writeback_dirty_page,
63 TP_PROTO(struct page *page, struct address_space *mapping),
64 TP_ARGS(page, mapping),
65 TP_FIELDS(
66 ctf_array_text(char, name,
67 mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)", 32)
68 ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0)
69 ctf_integer(pgoff_t, index, page->index)
70 )
71 )
72
73 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template,
74 TP_PROTO(struct inode *inode, int flags),
75 TP_ARGS(inode, flags),
76 TP_FIELDS(
77 /* may be called for files on pseudo FSes w/ unregistered bdi */
78 ctf_array_text(char, name,
79 inode_to_bdi(inode)->dev ?
80 dev_name(inode_to_bdi(inode)->dev) : "(unknown)", 32)
81 ctf_integer(unsigned long, ino, inode->i_ino)
82 ctf_integer(unsigned long, state, inode->i_state)
83 ctf_integer(unsigned long, flags, flags)
84 )
85 )
86 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \
87 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \
88 TP_PROTO(struct inode *inode, int flags), \
89 TP_ARGS(inode, flags))
90 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start)
91 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode)
92 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_mark_inode_dirty)
93
94 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template,
95 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
96 TP_ARGS(inode, wbc),
97 TP_FIELDS(
98 ctf_array_text(char, name,
99 dev_name(inode_to_bdi(inode)->dev), 32)
100 ctf_integer(unsigned long, ino, inode->i_ino)
101 ctf_integer(int, sync_mode, wbc->sync_mode)
102 )
103 )
104
105 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \
106 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \
107 TP_PROTO(struct inode *inode, struct writeback_control *wbc), \
108 TP_ARGS(inode, wbc))
109 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start)
110 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode)
111
112 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
113
114 LTTNG_TRACEPOINT_EVENT(writeback_dirty_page,
115 TP_PROTO(struct page *page, struct address_space *mapping),
116 TP_ARGS(page, mapping),
117 TP_FIELDS(
118 ctf_array_text(char, name,
119 mapping ? dev_name(mapping->backing_dev_info->dev) : "(unknown)", 32)
120 ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0)
121 ctf_integer(pgoff_t, index, page->index)
122 )
123 )
124
125 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template,
126 TP_PROTO(struct inode *inode, int flags),
127 TP_ARGS(inode, flags),
128 TP_FIELDS(
129 /* may be called for files on pseudo FSes w/ unregistered bdi */
130 ctf_array_text(char, name,
131 inode->i_mapping->backing_dev_info->dev ?
132 dev_name(inode->i_mapping->backing_dev_info->dev)
133 : "(unknown)", 32)
134 ctf_integer(unsigned long, ino, inode->i_ino)
135 ctf_integer(unsigned long, flags, flags)
136 )
137 )
138 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \
139 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \
140 TP_PROTO(struct inode *inode, int flags), \
141 TP_ARGS(inode, flags))
142 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start)
143 LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode)
144
145 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template,
146 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
147 TP_ARGS(inode, wbc),
148 TP_FIELDS(
149 ctf_array_text(char, name,
150 dev_name(inode->i_mapping->backing_dev_info->dev), 32)
151 ctf_integer(unsigned long, ino, inode->i_ino)
152 ctf_integer(int, sync_mode, wbc->sync_mode)
153 )
154 )
155
156 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \
157 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \
158 TP_PROTO(struct inode *inode, struct writeback_control *wbc), \
159 TP_ARGS(inode, wbc))
160 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start)
161 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode)
162
163 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */
164
165 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
166
167 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class,
168 TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work),
169 TP_ARGS(bdi, work),
170 TP_FIELDS(
171 ctf_array_text(char, name, bdi->dev ? dev_name(bdi->dev) :
172 "(unknown)", 32)
173 )
174 )
175
176 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
177
178 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class,
179 TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work),
180 TP_ARGS(bdi, work),
181 TP_FIELDS(
182 ctf_array_text(char, name,
183 dev_name(bdi->dev ? bdi->dev :
184 default_backing_dev_info.dev), 32)
185 )
186 )
187
188 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */
189
190 #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \
191 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \
192 TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \
193 TP_ARGS(bdi, work))
194 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_nothread)
195 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_queue)
196 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_exec)
197 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
198 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_start)
199 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_written)
200 LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_wait)
201 #endif
202
203 LTTNG_TRACEPOINT_EVENT(writeback_pages_written,
204 TP_PROTO(long pages_written),
205 TP_ARGS(pages_written),
206 TP_FIELDS(
207 ctf_integer(long, pages, pages_written)
208 )
209 )
210
211 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class,
212 TP_PROTO(struct backing_dev_info *bdi),
213 TP_ARGS(bdi),
214 TP_FIELDS(
215 ctf_array_text(char, name,
216 dev_name(bdi->dev), 32)
217 )
218 )
219 #undef DEFINE_WRITEBACK_EVENT
220 #define DEFINE_WRITEBACK_EVENT(name) \
221 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \
222 TP_PROTO(struct backing_dev_info *bdi), \
223 TP_ARGS(bdi))
224
225 #define DEFINE_WRITEBACK_EVENT_MAP(name, map) \
226 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \
227 TP_PROTO(struct backing_dev_info *bdi), \
228 TP_ARGS(bdi))
229
230 DEFINE_WRITEBACK_EVENT(writeback_nowork)
231 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
232 DEFINE_WRITEBACK_EVENT(writeback_wake_background)
233 #endif
234 DEFINE_WRITEBACK_EVENT(writeback_wake_thread)
235 DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread)
236 DEFINE_WRITEBACK_EVENT(writeback_bdi_register)
237 DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister)
238 DEFINE_WRITEBACK_EVENT(writeback_thread_start)
239 DEFINE_WRITEBACK_EVENT(writeback_thread_stop)
240 #if (LTTNG_KERNEL_RANGE(3,1,0, 3,2,0))
241 DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_start, writeback_balance_dirty_start)
242 DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_wait, writeback_balance_dirty_wait)
243
244 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_written,
245
246 writeback_balance_dirty_written,
247
248 TP_PROTO(struct backing_dev_info *bdi, int written),
249
250 TP_ARGS(bdi, written),
251
252 TP_FIELDS(
253 ctf_array_text(char, name, dev_name(bdi->dev), 32)
254 ctf_integer(int, written, written)
255 )
256 )
257 #endif
258
259 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_wbc_class,
260 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),
261 TP_ARGS(wbc, bdi),
262 TP_FIELDS(
263 ctf_array_text(char, name, dev_name(bdi->dev), 32)
264 ctf_integer(long, nr_to_write, wbc->nr_to_write)
265 ctf_integer(long, pages_skipped, wbc->pages_skipped)
266 ctf_integer(int, sync_mode, wbc->sync_mode)
267 ctf_integer(int, for_kupdate, wbc->for_kupdate)
268 ctf_integer(int, for_background, wbc->for_background)
269 ctf_integer(int, for_reclaim, wbc->for_reclaim)
270 ctf_integer(int, range_cyclic, wbc->range_cyclic)
271 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
272 ctf_integer(int, more_io, wbc->more_io)
273 ctf_integer(unsigned long, older_than_this,
274 wbc->older_than_this ? *wbc->older_than_this : 0)
275 #endif
276 ctf_integer(long, range_start, (long) wbc->range_start)
277 ctf_integer(long, range_end, (long) wbc->range_end)
278 )
279 )
280
281 #undef DEFINE_WBC_EVENT
282 #define LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(name, map) \
283 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_wbc_class, name, map, \
284 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
285 TP_ARGS(wbc, bdi))
286 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
287 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_start, writeback_wbc_writeback_start)
288 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_written, writeback_wbc_writeback_written)
289 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_wait, writeback_wbc_writeback_wait)
290 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_start, writeback_wbc_balance_dirty_start)
291 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_written, writeback_wbc_balance_dirty_written)
292 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait, writeback_wbc_balance_dirty_wait)
293 #endif
294 LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage)
295
296 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
297 LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
298 TP_PROTO(struct bdi_writeback *wb,
299 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
300 struct wb_writeback_work *work,
301 #else
302 unsigned long *older_than_this,
303 #endif
304 int moved),
305 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
306 TP_ARGS(wb, work, moved),
307 #else
308 TP_ARGS(wb, older_than_this, moved),
309 #endif
310 TP_FIELDS(
311 ctf_array_text(char, name, dev_name(wb->bdi->dev), 32)
312 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
313 #else
314 ctf_integer(unsigned long, older,
315 older_than_this ? *older_than_this : 0)
316 ctf_integer(long, age,
317 older_than_this ?
318 (jiffies - *older_than_this) * 1000 / HZ
319 : -1)
320 #endif
321 ctf_integer(int, moved, moved)
322 )
323 )
324
325 LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
326
327 writeback_global_dirty_state,
328
329 TP_PROTO(unsigned long background_thresh,
330 unsigned long dirty_thresh
331 ),
332
333 TP_ARGS(background_thresh,
334 dirty_thresh
335 ),
336
337 TP_FIELDS(
338 ctf_integer(unsigned long, nr_dirty, global_page_state(NR_FILE_DIRTY))
339 ctf_integer(unsigned long, nr_writeback, global_page_state(NR_WRITEBACK))
340 ctf_integer(unsigned long, nr_unstable, global_page_state(NR_UNSTABLE_NFS))
341 ctf_integer(unsigned long, nr_dirtied, global_page_state(NR_DIRTIED))
342 ctf_integer(unsigned long, nr_written, global_page_state(NR_WRITTEN))
343 ctf_integer(unsigned long, background_thresh, background_thresh)
344 ctf_integer(unsigned long, dirty_thresh, dirty_thresh)
345 ctf_integer(unsigned long, dirty_limit, global_dirty_limit)
346 )
347 )
348 #endif
349
350 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
351
352 #define KBps(x) ((x) << (PAGE_SHIFT - 10))
353
354 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit,
355
356 writeback_bdi_dirty_ratelimit,
357
358 TP_PROTO(struct backing_dev_info *bdi,
359 unsigned long dirty_rate,
360 unsigned long task_ratelimit),
361
362 TP_ARGS(bdi, dirty_rate, task_ratelimit),
363
364 TP_FIELDS(
365 ctf_array_text(char, bdi, dev_name(bdi->dev), 32)
366 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
367 ctf_integer(unsigned long, write_bw, KBps(bdi->wb.write_bandwidth))
368 ctf_integer(unsigned long, avg_write_bw, KBps(bdi->wb.avg_write_bandwidth))
369 #else
370 ctf_integer(unsigned long, write_bw, KBps(bdi->write_bandwidth))
371 ctf_integer(unsigned long, avg_write_bw, KBps(bdi->avg_write_bandwidth))
372 #endif
373 ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate))
374 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
375 ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->wb.dirty_ratelimit))
376 #else
377 ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->dirty_ratelimit))
378 #endif
379 ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit))
380 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
381 ctf_integer(unsigned long, balanced_dirty_ratelimit,
382 KBps(bdi->wb.balanced_dirty_ratelimit))
383 #else
384 ctf_integer(unsigned long, balanced_dirty_ratelimit,
385 KBps(bdi->balanced_dirty_ratelimit))
386 #endif
387 )
388 )
389
390 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages,
391
392 writeback_balance_dirty_pages,
393
394 TP_PROTO(struct backing_dev_info *bdi,
395 unsigned long thresh,
396 unsigned long bg_thresh,
397 unsigned long dirty,
398 unsigned long bdi_thresh,
399 unsigned long bdi_dirty,
400 unsigned long dirty_ratelimit,
401 unsigned long task_ratelimit,
402 unsigned long dirtied,
403 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
404 unsigned long period,
405 #endif
406 long pause,
407 unsigned long start_time),
408
409 TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty,
410 dirty_ratelimit, task_ratelimit,
411 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
412 dirtied, period, pause, start_time
413 #else
414 dirtied, pause, start_time
415 #endif
416 ),
417
418 TP_FIELDS(
419 ctf_array_text(char, bdi, dev_name(bdi->dev), 32)
420 ctf_integer(unsigned long, limit, global_dirty_limit)
421 ctf_integer(unsigned long, setpoint,
422 (global_dirty_limit + (thresh + bg_thresh) / 2) / 2)
423 ctf_integer(unsigned long, dirty, dirty)
424 ctf_integer(unsigned long, bdi_setpoint,
425 ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) *
426 bdi_thresh / (thresh + 1))
427 ctf_integer(unsigned long, bdi_dirty, bdi_dirty)
428 ctf_integer(unsigned long, dirty_ratelimit,
429 KBps(dirty_ratelimit))
430 ctf_integer(unsigned long, task_ratelimit,
431 KBps(task_ratelimit))
432 ctf_integer(unsigned int, dirtied, dirtied)
433 ctf_integer(unsigned int, dirtied_pause,
434 current->nr_dirtied_pause)
435 ctf_integer(unsigned long, paused,
436 (jiffies - start_time) * 1000 / HZ)
437 ctf_integer(long, pause, pause * 1000 / HZ)
438 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
439 ctf_integer(unsigned long, period,
440 period * 1000 / HZ)
441 ctf_integer(long, think,
442 current->dirty_paused_when == 0 ? 0 :
443 (long)(jiffies - current->dirty_paused_when) * 1000/HZ)
444 #endif
445 )
446 )
447 #endif
448
449 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
450 LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue,
451
452 TP_PROTO(struct inode *inode),
453 TP_ARGS(inode),
454
455 TP_FIELDS(
456 ctf_array_text(char, name,
457 dev_name(inode_to_bdi(inode)->dev), 32)
458 ctf_integer(unsigned long, ino, inode->i_ino)
459 ctf_integer(unsigned long, state, inode->i_state)
460 ctf_integer(unsigned long, dirtied_when, inode->dirtied_when)
461 )
462 )
463 #endif
464
465 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
466 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_congest_waited_template,
467
468 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
469
470 TP_ARGS(usec_timeout, usec_delayed),
471
472 TP_FIELDS(
473 ctf_integer(unsigned int, usec_timeout, usec_timeout)
474 ctf_integer(unsigned int, usec_delayed, usec_delayed)
475 )
476 )
477
478 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_congestion_wait,
479
480 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
481
482 TP_ARGS(usec_timeout, usec_delayed)
483 )
484
485 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_wait_iff_congested,
486
487 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
488
489 TP_ARGS(usec_timeout, usec_delayed)
490 )
491 #endif
492
493 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
494 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template,
495
496 TP_PROTO(struct inode *inode,
497 struct writeback_control *wbc,
498 unsigned long nr_to_write
499 ),
500
501 TP_ARGS(inode, wbc, nr_to_write),
502
503 TP_FIELDS(
504 ctf_array_text(char, name,
505 dev_name(inode_to_bdi(inode)->dev), 32)
506 ctf_integer(unsigned long, ino, inode->i_ino)
507 ctf_integer(unsigned long, state, inode->i_state)
508 ctf_integer(unsigned long, dirtied_when, inode->dirtied_when)
509 ctf_integer(unsigned long, writeback_index,
510 inode->i_mapping->writeback_index)
511 ctf_integer(long, nr_to_write, nr_to_write)
512 ctf_integer(unsigned long, wrote,
513 nr_to_write - wbc->nr_to_write)
514 )
515 )
516
517 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
518 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode_requeue,
519 TP_PROTO(struct inode *inode,
520 struct writeback_control *wbc,
521 unsigned long nr_to_write),
522 TP_ARGS(inode, wbc, nr_to_write)
523 )
524 #endif
525
526 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode,
527 TP_PROTO(struct inode *inode,
528 struct writeback_control *wbc,
529 unsigned long nr_to_write),
530 TP_ARGS(inode, wbc, nr_to_write)
531 )
532 #endif
533
534 #endif /* LTTNG_TRACE_WRITEBACK_H */
535
536 /* This part must be outside protection */
537 #include "../../../probes/define_trace.h"
This page took 0.040971 seconds and 5 git commands to generate.