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