Fix: compilation on 4.1-rc1 kernel, remove unused WB_WORK_REASON
[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 ctf_integer(unsigned long, write_bw, KBps(bdi->write_bandwidth))
367 ctf_integer(unsigned long, avg_write_bw, KBps(bdi->avg_write_bandwidth))
368 ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate))
369 ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->dirty_ratelimit))
370 ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit))
371 ctf_integer(unsigned long, balanced_dirty_ratelimit,
372 KBps(bdi->balanced_dirty_ratelimit))
373 )
374 )
375
376 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages,
377
378 writeback_balance_dirty_pages,
379
380 TP_PROTO(struct backing_dev_info *bdi,
381 unsigned long thresh,
382 unsigned long bg_thresh,
383 unsigned long dirty,
384 unsigned long bdi_thresh,
385 unsigned long bdi_dirty,
386 unsigned long dirty_ratelimit,
387 unsigned long task_ratelimit,
388 unsigned long dirtied,
389 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
390 unsigned long period,
391 #endif
392 long pause,
393 unsigned long start_time),
394
395 TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty,
396 dirty_ratelimit, task_ratelimit,
397 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
398 dirtied, period, pause, start_time
399 #else
400 dirtied, pause, start_time
401 #endif
402 ),
403
404 TP_FIELDS(
405 ctf_array_text(char, bdi, dev_name(bdi->dev), 32)
406 ctf_integer(unsigned long, limit, global_dirty_limit)
407 ctf_integer(unsigned long, setpoint,
408 (global_dirty_limit + (thresh + bg_thresh) / 2) / 2)
409 ctf_integer(unsigned long, dirty, dirty)
410 ctf_integer(unsigned long, bdi_setpoint,
411 ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) *
412 bdi_thresh / (thresh + 1))
413 ctf_integer(unsigned long, bdi_dirty, bdi_dirty)
414 ctf_integer(unsigned long, dirty_ratelimit,
415 KBps(dirty_ratelimit))
416 ctf_integer(unsigned long, task_ratelimit,
417 KBps(task_ratelimit))
418 ctf_integer(unsigned int, dirtied, dirtied)
419 ctf_integer(unsigned int, dirtied_pause,
420 current->nr_dirtied_pause)
421 ctf_integer(unsigned long, paused,
422 (jiffies - start_time) * 1000 / HZ)
423 ctf_integer(long, pause, pause * 1000 / HZ)
424 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
425 ctf_integer(unsigned long, period,
426 period * 1000 / HZ)
427 ctf_integer(long, think,
428 current->dirty_paused_when == 0 ? 0 :
429 (long)(jiffies - current->dirty_paused_when) * 1000/HZ)
430 #endif
431 )
432 )
433 #endif
434
435 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
436 LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue,
437
438 TP_PROTO(struct inode *inode),
439 TP_ARGS(inode),
440
441 TP_FIELDS(
442 ctf_array_text(char, name,
443 dev_name(inode_to_bdi(inode)->dev), 32)
444 ctf_integer(unsigned long, ino, inode->i_ino)
445 ctf_integer(unsigned long, state, inode->i_state)
446 ctf_integer(unsigned long, dirtied_when, inode->dirtied_when)
447 )
448 )
449 #endif
450
451 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
452 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_congest_waited_template,
453
454 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
455
456 TP_ARGS(usec_timeout, usec_delayed),
457
458 TP_FIELDS(
459 ctf_integer(unsigned int, usec_timeout, usec_timeout)
460 ctf_integer(unsigned int, usec_delayed, usec_delayed)
461 )
462 )
463
464 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_congestion_wait,
465
466 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
467
468 TP_ARGS(usec_timeout, usec_delayed)
469 )
470
471 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_wait_iff_congested,
472
473 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
474
475 TP_ARGS(usec_timeout, usec_delayed)
476 )
477 #endif
478
479 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
480 LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template,
481
482 TP_PROTO(struct inode *inode,
483 struct writeback_control *wbc,
484 unsigned long nr_to_write
485 ),
486
487 TP_ARGS(inode, wbc, nr_to_write),
488
489 TP_FIELDS(
490 ctf_array_text(char, name,
491 dev_name(inode_to_bdi(inode)->dev), 32)
492 ctf_integer(unsigned long, ino, inode->i_ino)
493 ctf_integer(unsigned long, state, inode->i_state)
494 ctf_integer(unsigned long, dirtied_when, inode->dirtied_when)
495 ctf_integer(unsigned long, writeback_index,
496 inode->i_mapping->writeback_index)
497 ctf_integer(long, nr_to_write, nr_to_write)
498 ctf_integer(unsigned long, wrote,
499 nr_to_write - wbc->nr_to_write)
500 )
501 )
502
503 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
504 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode_requeue,
505 TP_PROTO(struct inode *inode,
506 struct writeback_control *wbc,
507 unsigned long nr_to_write),
508 TP_ARGS(inode, wbc, nr_to_write)
509 )
510 #endif
511
512 LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode,
513 TP_PROTO(struct inode *inode,
514 struct writeback_control *wbc,
515 unsigned long nr_to_write),
516 TP_ARGS(inode, wbc, nr_to_write)
517 )
518 #endif
519
520 #endif /* LTTNG_TRACE_WRITEBACK_H */
521
522 /* This part must be outside protection */
523 #include "../../../probes/define_trace.h"
This page took 0.040479 seconds and 5 git commands to generate.