Fix: btrfs instrumentation namespacing
[lttng-modules.git] / instrumentation / events / lttng-module / btrfs.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM btrfs
4
5 #if !defined(LTTNG_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_BTRFS_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/writeback.h>
10 #include <linux/version.h>
11
12 #ifndef _TRACE_BTRFS_DEF_
13 #define _TRACE_BTRFS_DEF_
14 struct btrfs_root;
15 struct btrfs_fs_info;
16 struct btrfs_inode;
17 struct extent_map;
18 struct btrfs_ordered_extent;
19 struct btrfs_delayed_ref_node;
20 struct btrfs_delayed_tree_ref;
21 struct btrfs_delayed_data_ref;
22 struct btrfs_delayed_ref_head;
23 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
24 struct btrfs_block_group_cache;
25 struct btrfs_free_cluster;
26 #endif
27 struct map_lookup;
28 struct extent_buffer;
29 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
30 struct extent_state;
31 #endif
32 #endif
33
34 #define BTRFS_UUID_SIZE 16
35
36 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
37 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
38 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
39 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
40 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
41 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
42
43 TP_PROTO(const struct btrfs_root *root),
44
45 TP_ARGS(root),
46
47 TP_FIELDS(
48 ctf_integer(u64, generation, root->fs_info->generation)
49 ctf_integer(u64, root_objectid, root->root_key.objectid)
50 )
51 )
52
53 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
54
55 TP_PROTO(const struct inode *inode),
56
57 TP_ARGS(inode),
58
59 TP_FIELDS(
60 ctf_integer(ino_t, ino, inode->i_ino)
61 ctf_integer(blkcnt_t, blocks, inode->i_blocks)
62 ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size)
63 ctf_integer(u64, generation, BTRFS_I(inode)->generation)
64 ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans)
65 ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans)
66 ctf_integer(u64, root_objectid,
67 BTRFS_I(inode)->root->root_key.objectid)
68 )
69 )
70
71 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new,
72
73 TP_PROTO(const struct inode *inode),
74
75 TP_ARGS(inode)
76 )
77
78 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request,
79
80 TP_PROTO(const struct inode *inode),
81
82 TP_ARGS(inode)
83 )
84
85 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
86
87 TP_PROTO(const struct inode *inode),
88
89 TP_ARGS(inode)
90 )
91 #else
92 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
93
94 TP_PROTO(struct btrfs_root *root),
95
96 TP_ARGS(root),
97
98 TP_FIELDS(
99 ctf_integer(u64, generation, root->fs_info->generation)
100 ctf_integer(u64, root_objectid, root->root_key.objectid)
101 )
102 )
103
104 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
105
106 TP_PROTO(struct inode *inode),
107
108 TP_ARGS(inode),
109
110 TP_FIELDS(
111 ctf_integer(ino_t, ino, inode->i_ino)
112 ctf_integer(blkcnt_t, blocks, inode->i_blocks)
113 ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size)
114 ctf_integer(u64, generation, BTRFS_I(inode)->generation)
115 ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans)
116 ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans)
117 ctf_integer(u64, root_objectid,
118 BTRFS_I(inode)->root->root_key.objectid)
119 )
120 )
121
122 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new,
123
124 TP_PROTO(struct inode *inode),
125
126 TP_ARGS(inode)
127 )
128
129 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request,
130
131 TP_PROTO(struct inode *inode),
132
133 TP_ARGS(inode)
134 )
135
136 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
137
138 TP_PROTO(struct inode *inode),
139
140 TP_ARGS(inode)
141 )
142 #endif
143
144 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
145
146 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
147
148 TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode,
149 const struct extent_map *map),
150
151 TP_ARGS(root, inode, map),
152
153 TP_FIELDS(
154 ctf_integer(u64, root_objectid, root->root_key.objectid)
155 ctf_integer(u64, ino, btrfs_ino(inode))
156 ctf_integer(u64, start, map->start)
157 ctf_integer(u64, len, map->len)
158 ctf_integer(u64, orig_start, map->orig_start)
159 ctf_integer(u64, block_start, map->block_start)
160 ctf_integer(u64, block_len, map->block_len)
161 ctf_integer(unsigned long, flags, map->flags)
162 ctf_integer(int, refs, refcount_read(&map->refs))
163 ctf_integer(unsigned int, compress_type, map->compress_type)
164 )
165 )
166
167 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
168
169 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
170
171 TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
172 struct extent_map *map),
173
174 TP_ARGS(root, inode, map),
175
176 TP_FIELDS(
177 ctf_integer(u64, root_objectid, root->root_key.objectid)
178 ctf_integer(u64, ino, btrfs_ino(inode))
179 ctf_integer(u64, start, map->start)
180 ctf_integer(u64, len, map->len)
181 ctf_integer(u64, orig_start, map->orig_start)
182 ctf_integer(u64, block_start, map->block_start)
183 ctf_integer(u64, block_len, map->block_len)
184 ctf_integer(unsigned long, flags, map->flags)
185 ctf_integer(int, refs, refcount_read(&map->refs))
186 ctf_integer(unsigned int, compress_type, map->compress_type)
187 )
188 )
189
190 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
191
192 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
193
194 TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
195 struct extent_map *map),
196
197 TP_ARGS(root, inode, map),
198
199 TP_FIELDS(
200 ctf_integer(u64, root_objectid, root->root_key.objectid)
201 ctf_integer(u64, ino, btrfs_ino(inode))
202 ctf_integer(u64, start, map->start)
203 ctf_integer(u64, len, map->len)
204 ctf_integer(u64, orig_start, map->orig_start)
205 ctf_integer(u64, block_start, map->block_start)
206 ctf_integer(u64, block_len, map->block_len)
207 ctf_integer(unsigned long, flags, map->flags)
208 ctf_integer(int, refs, atomic_read(&map->refs))
209 ctf_integer(unsigned int, compress_type, map->compress_type)
210 )
211 )
212
213 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
214
215 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
216
217 TP_PROTO(struct btrfs_root *root, struct inode *inode,
218 struct extent_map *map),
219
220 TP_ARGS(root, inode, map),
221
222 TP_FIELDS(
223 ctf_integer(u64, root_objectid, root->root_key.objectid)
224 ctf_integer(u64, ino, btrfs_ino(inode))
225 ctf_integer(u64, start, map->start)
226 ctf_integer(u64, len, map->len)
227 ctf_integer(u64, orig_start, map->orig_start)
228 ctf_integer(u64, block_start, map->block_start)
229 ctf_integer(u64, block_len, map->block_len)
230 ctf_integer(unsigned long, flags, map->flags)
231 ctf_integer(int, refs, atomic_read(&map->refs))
232 ctf_integer(unsigned int, compress_type, map->compress_type)
233 )
234 )
235
236 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
237 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
238 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
239 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
240
241 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
242
243 TP_PROTO(const struct btrfs_root *root, const struct extent_map *map),
244
245 TP_ARGS(root, map),
246
247 TP_FIELDS(
248 ctf_integer(u64, root_objectid, root->root_key.objectid)
249 ctf_integer(u64, start, map->start)
250 ctf_integer(u64, len, map->len)
251 ctf_integer(u64, orig_start, map->orig_start)
252 ctf_integer(u64, block_start, map->block_start)
253 ctf_integer(u64, block_len, map->block_len)
254 ctf_integer(unsigned long, flags, map->flags)
255 ctf_integer(int, refs, atomic_read(&map->refs))
256 ctf_integer(unsigned int, compress_type, map->compress_type)
257 )
258 )
259
260 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
261
262 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
263
264 TP_PROTO(struct btrfs_root *root, struct extent_map *map),
265
266 TP_ARGS(root, map),
267
268 TP_FIELDS(
269 ctf_integer(u64, root_objectid, root->root_key.objectid)
270 ctf_integer(u64, start, map->start)
271 ctf_integer(u64, len, map->len)
272 ctf_integer(u64, orig_start, map->orig_start)
273 ctf_integer(u64, block_start, map->block_start)
274 ctf_integer(u64, block_len, map->block_len)
275 ctf_integer(unsigned long, flags, map->flags)
276 ctf_integer(int, refs, atomic_read(&map->refs))
277 ctf_integer(unsigned int, compress_type, map->compress_type)
278 )
279 )
280
281 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
282
283 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
284 LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
285
286 TP_PROTO(struct btrfs_fs_info *fs_info,
287 const struct extent_map *existing, const struct extent_map *map,
288 u64 start, u64 len),
289
290 TP_ARGS(fs_info, existing, map, start, len),
291
292 TP_FIELDS(
293 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
294 ctf_integer(u64, e_start, existing->start)
295 ctf_integer(u64, e_len, existing->len)
296 ctf_integer(u64, map_start, map->start)
297 ctf_integer(u64, map_len, map->len)
298 ctf_integer(u64, start, start)
299 ctf_integer(u64, len, len)
300 )
301 )
302 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
303 LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
304
305 TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len),
306
307 TP_ARGS(existing, map, start, len),
308
309 TP_FIELDS(
310 ctf_integer(u64, e_start, existing->start)
311 ctf_integer(u64, e_len, existing->len)
312 ctf_integer(u64, map_start, map->start)
313 ctf_integer(u64, map_len, map->len)
314 ctf_integer(u64, start, start)
315 ctf_integer(u64, len, len)
316 )
317 )
318 #endif
319
320 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
321 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
322
323 TP_PROTO(const struct inode *inode,
324 const struct btrfs_ordered_extent *ordered),
325
326 TP_ARGS(inode, ordered),
327
328 TP_FIELDS(
329 ctf_integer(ino_t, ino, inode->i_ino)
330 ctf_integer(u64, file_offset, ordered->file_offset)
331 ctf_integer(u64, start, ordered->start)
332 ctf_integer(u64, len, ordered->len)
333 ctf_integer(u64, disk_len, ordered->disk_len)
334 ctf_integer(u64, bytes_left, ordered->bytes_left)
335 ctf_integer(unsigned long, flags, ordered->flags)
336 ctf_integer(int, compress_type, ordered->compress_type)
337 ctf_integer(int, refs, refcount_read(&ordered->refs))
338 ctf_integer(u64, root_objectid,
339 BTRFS_I(inode)->root->root_key.objectid)
340 )
341 )
342 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
343 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
344
345 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
346
347 TP_ARGS(inode, ordered),
348
349 TP_FIELDS(
350 ctf_integer(ino_t, ino, inode->i_ino)
351 ctf_integer(u64, file_offset, ordered->file_offset)
352 ctf_integer(u64, start, ordered->start)
353 ctf_integer(u64, len, ordered->len)
354 ctf_integer(u64, disk_len, ordered->disk_len)
355 ctf_integer(u64, bytes_left, ordered->bytes_left)
356 ctf_integer(unsigned long, flags, ordered->flags)
357 ctf_integer(int, compress_type, ordered->compress_type)
358 ctf_integer(int, refs, refcount_read(&ordered->refs))
359 ctf_integer(u64, root_objectid,
360 BTRFS_I(inode)->root->root_key.objectid)
361 )
362 )
363 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
364 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
365 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
366 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
367 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
368
369 TP_PROTO(const struct inode *inode, const struct btrfs_ordered_extent *ordered),
370
371 TP_ARGS(inode, ordered),
372
373 TP_FIELDS(
374 ctf_integer(ino_t, ino, inode->i_ino)
375 ctf_integer(u64, file_offset, ordered->file_offset)
376 ctf_integer(u64, start, ordered->start)
377 ctf_integer(u64, len, ordered->len)
378 ctf_integer(u64, disk_len, ordered->disk_len)
379 ctf_integer(u64, bytes_left, ordered->bytes_left)
380 ctf_integer(unsigned long, flags, ordered->flags)
381 ctf_integer(int, compress_type, ordered->compress_type)
382 ctf_integer(int, refs, atomic_read(&ordered->refs))
383 ctf_integer(u64, root_objectid,
384 BTRFS_I(inode)->root->root_key.objectid)
385 )
386 )
387 #else
388 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
389
390 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
391
392 TP_ARGS(inode, ordered),
393
394 TP_FIELDS(
395 ctf_integer(ino_t, ino, inode->i_ino)
396 ctf_integer(u64, file_offset, ordered->file_offset)
397 ctf_integer(u64, start, ordered->start)
398 ctf_integer(u64, len, ordered->len)
399 ctf_integer(u64, disk_len, ordered->disk_len)
400 ctf_integer(u64, bytes_left, ordered->bytes_left)
401 ctf_integer(unsigned long, flags, ordered->flags)
402 ctf_integer(int, compress_type, ordered->compress_type)
403 ctf_integer(int, refs, atomic_read(&ordered->refs))
404 ctf_integer(u64, root_objectid,
405 BTRFS_I(inode)->root->root_key.objectid)
406 )
407 )
408 #endif
409
410 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
411 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
412 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
413 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
414 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
415 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
416
417 TP_PROTO(const struct inode *inode,
418 const struct btrfs_ordered_extent *ordered),
419
420 TP_ARGS(inode, ordered)
421 )
422
423 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
424
425 TP_PROTO(const struct inode *inode,
426 const struct btrfs_ordered_extent *ordered),
427
428 TP_ARGS(inode, ordered)
429 )
430
431 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
432
433 TP_PROTO(const struct inode *inode,
434 const struct btrfs_ordered_extent *ordered),
435
436 TP_ARGS(inode, ordered)
437 )
438
439 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
440
441 TP_PROTO(const struct inode *inode,
442 const struct btrfs_ordered_extent *ordered),
443
444 TP_ARGS(inode, ordered)
445 )
446
447 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
448
449 TP_PROTO(const struct page *page, const struct inode *inode,
450 const struct writeback_control *wbc),
451
452 TP_ARGS(page, inode, wbc),
453
454 TP_FIELDS(
455 ctf_integer(ino_t, ino, inode->i_ino)
456 ctf_integer(pgoff_t, index, page->index)
457 ctf_integer(long, nr_to_write, wbc->nr_to_write)
458 ctf_integer(long, pages_skipped, wbc->pages_skipped)
459 ctf_integer(loff_t, range_start, wbc->range_start)
460 ctf_integer(loff_t, range_end, wbc->range_end)
461 ctf_integer(char, for_kupdate, wbc->for_kupdate)
462 ctf_integer(char, for_reclaim, wbc->for_reclaim)
463 ctf_integer(char, range_cyclic, wbc->range_cyclic)
464 ctf_integer(pgoff_t, writeback_index,
465 inode->i_mapping->writeback_index)
466 ctf_integer(u64, root_objectid,
467 BTRFS_I(inode)->root->root_key.objectid)
468 )
469 )
470
471 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
472
473 __extent_writepage,
474
475 btrfs__extent_writepage,
476
477 TP_PROTO(const struct page *page, const struct inode *inode,
478 const struct writeback_control *wbc),
479
480 TP_ARGS(page, inode, wbc)
481 )
482
483 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
484
485 TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate),
486
487 TP_ARGS(page, start, end, uptodate),
488
489 TP_FIELDS(
490 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
491 ctf_integer(pgoff_t, index, page->index)
492 ctf_integer(u64, start, start)
493 ctf_integer(u64, end, end)
494 ctf_integer(int, uptodate, uptodate)
495 ctf_integer(u64, root_objectid,
496 BTRFS_I(page->mapping->host)->root->root_key.objectid)
497 )
498 )
499
500 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
501
502 TP_PROTO(const struct file *file, int datasync),
503
504 TP_ARGS(file, datasync),
505
506 TP_FIELDS(
507 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
508 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
509 ctf_integer(int, datasync, datasync)
510 ctf_integer(u64, root_objectid,
511 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
512 )
513 )
514 #else
515 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
516
517 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
518
519 TP_ARGS(inode, ordered)
520 )
521
522 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
523
524 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
525
526 TP_ARGS(inode, ordered)
527 )
528
529 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
530
531 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
532
533 TP_ARGS(inode, ordered)
534 )
535
536 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
537
538 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
539
540 TP_ARGS(inode, ordered)
541 )
542
543 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
544
545 TP_PROTO(struct page *page, struct inode *inode,
546 struct writeback_control *wbc),
547
548 TP_ARGS(page, inode, wbc),
549
550 TP_FIELDS(
551 ctf_integer(ino_t, ino, inode->i_ino)
552 ctf_integer(pgoff_t, index, page->index)
553 ctf_integer(long, nr_to_write, wbc->nr_to_write)
554 ctf_integer(long, pages_skipped, wbc->pages_skipped)
555 ctf_integer(loff_t, range_start, wbc->range_start)
556 ctf_integer(loff_t, range_end, wbc->range_end)
557 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
558 ctf_integer(char, nonblocking, wbc->nonblocking)
559 #endif
560 ctf_integer(char, for_kupdate, wbc->for_kupdate)
561 ctf_integer(char, for_reclaim, wbc->for_reclaim)
562 ctf_integer(char, range_cyclic, wbc->range_cyclic)
563 ctf_integer(pgoff_t, writeback_index,
564 inode->i_mapping->writeback_index)
565 ctf_integer(u64, root_objectid,
566 BTRFS_I(inode)->root->root_key.objectid)
567 )
568 )
569
570 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
571
572 __extent_writepage,
573
574 btrfs__extent_writepage,
575
576 TP_PROTO(struct page *page, struct inode *inode,
577 struct writeback_control *wbc),
578
579 TP_ARGS(page, inode, wbc)
580 )
581
582 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
583
584 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
585
586 TP_ARGS(page, start, end, uptodate),
587
588 TP_FIELDS(
589 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
590 ctf_integer(pgoff_t, index, page->index)
591 ctf_integer(u64, start, start)
592 ctf_integer(u64, end, end)
593 ctf_integer(int, uptodate, uptodate)
594 ctf_integer(u64, root_objectid,
595 BTRFS_I(page->mapping->host)->root->root_key.objectid)
596 )
597 )
598
599 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
600
601 TP_PROTO(struct file *file, int datasync),
602
603 TP_ARGS(file, datasync),
604
605 TP_FIELDS(
606 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
607 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
608 ctf_integer(int, datasync, datasync)
609 ctf_integer(u64, root_objectid,
610 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
611 )
612 )
613 #endif
614
615 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
616 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
617 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
618 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
619 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
620 LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
621 LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
622 LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
623 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
624
625 TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
626
627 TP_ARGS(fs_info, wait),
628
629 TP_FIELDS(
630 ctf_integer(int, wait, wait)
631 )
632 )
633 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
634 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
635
636 TP_PROTO(struct btrfs_fs_info *fs_info, int wait),
637
638 TP_ARGS(fs_info, wait),
639
640 TP_FIELDS(
641 ctf_integer(int, wait, wait)
642 )
643 )
644 #else
645 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
646
647 TP_PROTO(int wait),
648
649 TP_ARGS(wait),
650
651 TP_FIELDS(
652 ctf_integer(int, wait, wait)
653 )
654 )
655 #endif
656
657 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
658 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
659 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
660 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
661 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
662 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
663
664 TP_PROTO(const struct btrfs_fs_info *fs_info,
665 const struct btrfs_block_group_cache *block_group, int create),
666
667 TP_ARGS(fs_info, block_group, create),
668
669 TP_FIELDS(
670 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
671 ctf_integer(u64, offset, block_group->key.objectid)
672 ctf_integer(u64, size, block_group->key.offset)
673 ctf_integer(u64, flags, block_group->flags)
674 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
675 ctf_integer(u64, bytes_super, block_group->bytes_super)
676 ctf_integer(int, create, create)
677 )
678 )
679 #else
680 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
681
682 TP_PROTO(struct btrfs_fs_info *fs_info,
683 struct btrfs_block_group_cache *block_group, int create),
684
685 TP_ARGS(fs_info, block_group, create),
686
687 TP_FIELDS(
688 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
689 ctf_integer(u64, offset, block_group->key.objectid)
690 ctf_integer(u64, size, block_group->key.offset)
691 ctf_integer(u64, flags, block_group->flags)
692 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
693 ctf_integer(u64, bytes_super, block_group->bytes_super)
694 ctf_integer(int, create, create)
695 )
696 )
697 #endif
698
699 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
700 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
701 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
702 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
703 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
704 LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
705 LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
706 LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
707 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
708
709 TP_PROTO(const struct btrfs_fs_info *fs_info,
710 const struct btrfs_delayed_ref_node *ref,
711 const struct btrfs_delayed_tree_ref *full_ref,
712 int action),
713
714 TP_ARGS(fs_info, ref, full_ref, action),
715
716 TP_FIELDS(
717 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
718 ctf_integer(u64, bytenr, ref->bytenr)
719 ctf_integer(u64, num_bytes, ref->num_bytes)
720 ctf_integer(int, action, action)
721 ctf_integer(u64, parent, full_ref->parent)
722 ctf_integer(u64, ref_root, full_ref->root)
723 ctf_integer(int, level, full_ref->level)
724 ctf_integer(int, type, ref->type)
725 ctf_integer(u64, seq, ref->seq)
726 )
727 )
728
729 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
730
731 add_delayed_tree_ref,
732
733 btrfs_add_delayed_tree_ref,
734
735 TP_PROTO(const struct btrfs_fs_info *fs_info,
736 const struct btrfs_delayed_ref_node *ref,
737 const struct btrfs_delayed_tree_ref *full_ref,
738 int action),
739
740 TP_ARGS(fs_info, ref, full_ref, action)
741 )
742
743 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
744
745 run_delayed_tree_ref,
746
747 btrfs_run_delayed_tree_ref,
748
749 TP_PROTO(const struct btrfs_fs_info *fs_info,
750 const struct btrfs_delayed_ref_node *ref,
751 const struct btrfs_delayed_tree_ref *full_ref,
752 int action),
753
754 TP_ARGS(fs_info, ref, full_ref, action)
755 )
756 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
757 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
758
759 TP_PROTO(struct btrfs_fs_info *fs_info,
760 struct btrfs_delayed_ref_node *ref,
761 struct btrfs_delayed_tree_ref *full_ref,
762 int action),
763
764 TP_ARGS(fs_info, ref, full_ref, action),
765
766 TP_FIELDS(
767 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
768 ctf_integer(u64, bytenr, ref->bytenr)
769 ctf_integer(u64, num_bytes, ref->num_bytes)
770 ctf_integer(int, action, action)
771 ctf_integer(u64, parent, full_ref->parent)
772 ctf_integer(u64, ref_root, full_ref->root)
773 ctf_integer(int, level, full_ref->level)
774 ctf_integer(int, type, ref->type)
775 ctf_integer(u64, seq, ref->seq)
776 )
777 )
778
779 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
780
781 add_delayed_tree_ref,
782
783 btrfs_add_delayed_tree_ref,
784
785 TP_PROTO(struct btrfs_fs_info *fs_info,
786 struct btrfs_delayed_ref_node *ref,
787 struct btrfs_delayed_tree_ref *full_ref,
788 int action),
789
790 TP_ARGS(fs_info, ref, full_ref, action)
791 )
792
793 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
794
795 run_delayed_tree_ref,
796
797 btrfs_run_delayed_tree_ref,
798
799 TP_PROTO(struct btrfs_fs_info *fs_info,
800 struct btrfs_delayed_ref_node *ref,
801 struct btrfs_delayed_tree_ref *full_ref,
802 int action),
803
804 TP_ARGS(fs_info, ref, full_ref, action)
805 )
806 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0))
807 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
808
809 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
810 const struct btrfs_delayed_tree_ref *full_ref,
811 int action),
812
813 TP_ARGS(ref, full_ref, action),
814
815 TP_FIELDS(
816 ctf_integer(u64, bytenr, ref->bytenr)
817 ctf_integer(u64, num_bytes, ref->num_bytes)
818 ctf_integer(int, action, action)
819 ctf_integer(u64, parent, full_ref->parent)
820 ctf_integer(u64, ref_root, full_ref->root)
821 ctf_integer(int, level, full_ref->level)
822 ctf_integer(int, type, ref->type)
823 ctf_integer(u64, seq, ref->seq)
824 )
825 )
826
827 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
828
829 add_delayed_tree_ref,
830
831 btrfs_add_delayed_tree_ref,
832
833 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
834 const struct btrfs_delayed_tree_ref *full_ref,
835 int action),
836
837 TP_ARGS(ref, full_ref, action)
838 )
839
840 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
841
842 run_delayed_tree_ref,
843
844 btrfs_run_delayed_tree_ref,
845
846 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
847 const struct btrfs_delayed_tree_ref *full_ref,
848 int action),
849
850 TP_ARGS(ref, full_ref, action)
851 )
852 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
853 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
854
855 TP_PROTO(struct btrfs_delayed_ref_node *ref,
856 struct btrfs_delayed_tree_ref *full_ref,
857 int action),
858
859 TP_ARGS(ref, full_ref, action),
860
861 TP_FIELDS(
862 ctf_integer(u64, bytenr, ref->bytenr)
863 ctf_integer(u64, num_bytes, ref->num_bytes)
864 ctf_integer(int, action, action)
865 ctf_integer(u64, parent, full_ref->parent)
866 ctf_integer(u64, ref_root, full_ref->root)
867 ctf_integer(int, level, full_ref->level)
868 ctf_integer(int, type, ref->type)
869 ctf_integer(u64, seq, ref->seq)
870 )
871 )
872
873 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
874
875 add_delayed_tree_ref,
876
877 btrfs_add_delayed_tree_ref,
878
879 TP_PROTO(struct btrfs_delayed_ref_node *ref,
880 struct btrfs_delayed_tree_ref *full_ref,
881 int action),
882
883 TP_ARGS(ref, full_ref, action)
884 )
885
886 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
887
888 run_delayed_tree_ref,
889
890 btrfs_run_delayed_tree_ref,
891
892 TP_PROTO(struct btrfs_delayed_ref_node *ref,
893 struct btrfs_delayed_tree_ref *full_ref,
894 int action),
895
896 TP_ARGS(ref, full_ref, action)
897 )
898 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
899 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
900
901 TP_PROTO(struct btrfs_delayed_ref_node *ref,
902 struct btrfs_delayed_tree_ref *full_ref,
903 int action),
904
905 TP_ARGS(ref, full_ref, action),
906
907 TP_FIELDS(
908 ctf_integer(u64, bytenr, ref->bytenr)
909 ctf_integer(u64, num_bytes, ref->num_bytes)
910 ctf_integer(int, action, action)
911 ctf_integer(u64, parent, full_ref->parent)
912 ctf_integer(u64, ref_root, full_ref->root)
913 ctf_integer(int, level, full_ref->level)
914 ctf_integer(int, type, ref->type)
915 ctf_integer(u64, seq, ref->seq)
916 )
917 )
918 #else
919 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
920
921 TP_PROTO(struct btrfs_delayed_ref_node *ref,
922 struct btrfs_delayed_tree_ref *full_ref,
923 int action),
924
925 TP_ARGS(ref, full_ref, action),
926
927 TP_FIELDS(
928 ctf_integer(u64, bytenr, ref->bytenr)
929 ctf_integer(u64, num_bytes, ref->num_bytes)
930 ctf_integer(int, action, action)
931 ctf_integer(u64, parent, full_ref->parent)
932 ctf_integer(u64, ref_root, full_ref->root)
933 ctf_integer(int, level, full_ref->level)
934 ctf_integer(int, type, ref->type)
935 )
936 )
937 #endif
938
939 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
940 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
941 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
942 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
943 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
944 LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
945 LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
946 LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
947 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
948
949 TP_PROTO(const struct btrfs_fs_info *fs_info,
950 const struct btrfs_delayed_ref_node *ref,
951 const struct btrfs_delayed_data_ref *full_ref,
952 int action),
953
954 TP_ARGS(fs_info, ref, full_ref, action),
955
956 TP_FIELDS(
957 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
958 ctf_integer(u64, bytenr, ref->bytenr)
959 ctf_integer(u64, num_bytes, ref->num_bytes)
960 ctf_integer(int, action, action)
961 ctf_integer(u64, parent, full_ref->parent)
962 ctf_integer(u64, ref_root, full_ref->root)
963 ctf_integer(u64, owner, full_ref->objectid)
964 ctf_integer(u64, offset, full_ref->offset)
965 ctf_integer(int, type, ref->type)
966 ctf_integer(u64, seq, ref->seq)
967 )
968 )
969
970 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
971
972 add_delayed_data_ref,
973
974 btrfs_add_delayed_data_ref,
975
976 TP_PROTO(const struct btrfs_fs_info *fs_info,
977 const struct btrfs_delayed_ref_node *ref,
978 const struct btrfs_delayed_data_ref *full_ref,
979 int action),
980
981 TP_ARGS(fs_info, ref, full_ref, action)
982 )
983
984 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
985
986 run_delayed_data_ref,
987
988 btrfs_run_delayed_data_ref,
989
990 TP_PROTO(const struct btrfs_fs_info *fs_info,
991 const struct btrfs_delayed_ref_node *ref,
992 const struct btrfs_delayed_data_ref *full_ref,
993 int action),
994
995 TP_ARGS(fs_info, ref, full_ref, action)
996 )
997 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
998 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
999
1000 TP_PROTO(struct btrfs_fs_info *fs_info,
1001 struct btrfs_delayed_ref_node *ref,
1002 struct btrfs_delayed_data_ref *full_ref,
1003 int action),
1004
1005 TP_ARGS(fs_info, ref, full_ref, action),
1006
1007 TP_FIELDS(
1008 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1009 ctf_integer(u64, bytenr, ref->bytenr)
1010 ctf_integer(u64, num_bytes, ref->num_bytes)
1011 ctf_integer(int, action, action)
1012 ctf_integer(u64, parent, full_ref->parent)
1013 ctf_integer(u64, ref_root, full_ref->root)
1014 ctf_integer(u64, owner, full_ref->objectid)
1015 ctf_integer(u64, offset, full_ref->offset)
1016 ctf_integer(int, type, ref->type)
1017 ctf_integer(u64, seq, ref->seq)
1018 )
1019 )
1020
1021 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
1022
1023 add_delayed_data_ref,
1024
1025 btrfs_add_delayed_data_ref,
1026
1027 TP_PROTO(struct btrfs_fs_info *fs_info,
1028 struct btrfs_delayed_ref_node *ref,
1029 struct btrfs_delayed_data_ref *full_ref,
1030 int action),
1031
1032 TP_ARGS(fs_info, ref, full_ref, action)
1033 )
1034
1035 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
1036
1037 run_delayed_data_ref,
1038
1039 btrfs_run_delayed_data_ref,
1040
1041 TP_PROTO(struct btrfs_fs_info *fs_info,
1042 struct btrfs_delayed_ref_node *ref,
1043 struct btrfs_delayed_data_ref *full_ref,
1044 int action),
1045
1046 TP_ARGS(fs_info, ref, full_ref, action)
1047 )
1048 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0))
1049 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
1050
1051 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
1052 const struct btrfs_delayed_data_ref *full_ref,
1053 int action),
1054
1055 TP_ARGS(ref, full_ref, action),
1056
1057 TP_FIELDS(
1058 ctf_integer(u64, bytenr, ref->bytenr)
1059 ctf_integer(u64, num_bytes, ref->num_bytes)
1060 ctf_integer(int, action, action)
1061 ctf_integer(u64, parent, full_ref->parent)
1062 ctf_integer(u64, ref_root, full_ref->root)
1063 ctf_integer(u64, owner, full_ref->objectid)
1064 ctf_integer(u64, offset, full_ref->offset)
1065 ctf_integer(int, type, ref->type)
1066 ctf_integer(u64, seq, ref->seq)
1067 )
1068 )
1069
1070 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
1071
1072 add_delayed_data_ref,
1073
1074 btrfs_add_delayed_data_ref,
1075
1076 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
1077 const struct btrfs_delayed_data_ref *full_ref,
1078 int action),
1079
1080 TP_ARGS(fs_info, ref, full_ref, action)
1081 )
1082
1083 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
1084
1085 run_delayed_data_ref,
1086
1087 btrfs_run_delayed_data_ref,
1088
1089 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
1090 const struct btrfs_delayed_data_ref *full_ref,
1091 int action),
1092
1093 TP_ARGS(fs_info, ref, full_ref, action)
1094 )
1095 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
1096 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
1097
1098 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1099 struct btrfs_delayed_data_ref *full_ref,
1100 int action),
1101
1102 TP_ARGS(ref, full_ref, action),
1103
1104 TP_FIELDS(
1105 ctf_integer(u64, bytenr, ref->bytenr)
1106 ctf_integer(u64, num_bytes, ref->num_bytes)
1107 ctf_integer(int, action, action)
1108 ctf_integer(u64, parent, full_ref->parent)
1109 ctf_integer(u64, ref_root, full_ref->root)
1110 ctf_integer(u64, owner, full_ref->objectid)
1111 ctf_integer(u64, offset, full_ref->offset)
1112 ctf_integer(int, type, ref->type)
1113 ctf_integer(u64, seq, ref->seq)
1114 )
1115 )
1116
1117 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
1118
1119 add_delayed_data_ref,
1120
1121 btrfs_add_delayed_data_ref,
1122
1123 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1124 struct btrfs_delayed_data_ref *full_ref,
1125 int action),
1126
1127 TP_ARGS(fs_info, ref, full_ref, action)
1128 )
1129
1130 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
1131
1132 run_delayed_data_ref,
1133
1134 btrfs_run_delayed_data_ref,
1135
1136 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1137 struct btrfs_delayed_data_ref *full_ref,
1138 int action),
1139
1140 TP_ARGS(fs_info, ref, full_ref, action)
1141 )
1142 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
1143 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
1144
1145 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1146 struct btrfs_delayed_data_ref *full_ref,
1147 int action),
1148
1149 TP_ARGS(ref, full_ref, action),
1150
1151 TP_FIELDS(
1152 ctf_integer(u64, bytenr, ref->bytenr)
1153 ctf_integer(u64, num_bytes, ref->num_bytes)
1154 ctf_integer(int, action, action)
1155 ctf_integer(u64, parent, full_ref->parent)
1156 ctf_integer(u64, ref_root, full_ref->root)
1157 ctf_integer(u64, owner, full_ref->objectid)
1158 ctf_integer(u64, offset, full_ref->offset)
1159 ctf_integer(int, type, ref->type)
1160 ctf_integer(u64, seq, ref->seq)
1161 )
1162 )
1163 #else
1164 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
1165
1166 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1167 struct btrfs_delayed_data_ref *full_ref,
1168 int action),
1169
1170 TP_ARGS(ref, full_ref, action),
1171
1172 TP_FIELDS(
1173 ctf_integer(u64, bytenr, ref->bytenr)
1174 ctf_integer(u64, num_bytes, ref->num_bytes)
1175 ctf_integer(int, action, action)
1176 ctf_integer(u64, parent, full_ref->parent)
1177 ctf_integer(u64, ref_root, full_ref->root)
1178 ctf_integer(u64, owner, full_ref->objectid)
1179 ctf_integer(u64, offset, full_ref->offset)
1180 ctf_integer(int, type, ref->type)
1181 )
1182 )
1183 #endif
1184
1185 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
1186 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
1187
1188 TP_PROTO(const struct btrfs_fs_info *fs_info,
1189 const struct btrfs_delayed_ref_head *head_ref,
1190 int action),
1191
1192 TP_ARGS(fs_info, head_ref, action),
1193
1194 TP_FIELDS(
1195 ctf_integer(u64, bytenr, head_ref->bytenr)
1196 ctf_integer(u64, num_bytes, head_ref->num_bytes)
1197 ctf_integer(int, action, action)
1198 ctf_integer(int, is_data, head_ref->is_data)
1199 )
1200 )
1201
1202 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1203
1204 add_delayed_ref_head,
1205
1206 btrfs_add_delayed_ref_head,
1207
1208 TP_PROTO(const struct btrfs_fs_info *fs_info,
1209 const struct btrfs_delayed_ref_head *head_ref,
1210 int action),
1211
1212 TP_ARGS(fs_info, head_ref, action)
1213 )
1214
1215 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1216
1217 run_delayed_ref_head,
1218
1219 btrfs_run_delayed_ref_head,
1220
1221 TP_PROTO(const struct btrfs_fs_info *fs_info,
1222 const struct btrfs_delayed_ref_head *head_ref,
1223 int action),
1224
1225 TP_ARGS(fs_info, head_ref, action)
1226 )
1227
1228 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1229 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
1230 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
1231 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
1232 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
1233 LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
1234 LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
1235 LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
1236
1237 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
1238
1239 TP_PROTO(const struct btrfs_fs_info *fs_info,
1240 const struct btrfs_delayed_ref_node *ref,
1241 const struct btrfs_delayed_ref_head *head_ref,
1242 int action),
1243
1244 TP_ARGS(fs_info, ref, head_ref, action),
1245
1246 TP_FIELDS(
1247 ctf_integer(u64, bytenr, ref->bytenr)
1248 ctf_integer(u64, num_bytes, ref->num_bytes)
1249 ctf_integer(int, action, action)
1250 ctf_integer(int, is_data, head_ref->is_data)
1251 )
1252 )
1253
1254 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1255
1256 add_delayed_ref_head,
1257
1258 btrfs_add_delayed_ref_head,
1259
1260 TP_PROTO(const struct btrfs_fs_info *fs_info,
1261 const struct btrfs_delayed_ref_node *ref,
1262 const struct btrfs_delayed_ref_head *head_ref,
1263 int action),
1264
1265 TP_ARGS(fs_info, ref, head_ref, action)
1266 )
1267
1268 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1269
1270 run_delayed_ref_head,
1271
1272 btrfs_run_delayed_ref_head,
1273
1274 TP_PROTO(const struct btrfs_fs_info *fs_info,
1275 const struct btrfs_delayed_ref_node *ref,
1276 const struct btrfs_delayed_ref_head *head_ref,
1277 int action),
1278
1279 TP_ARGS(fs_info, ref, head_ref, action)
1280 )
1281
1282 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
1283 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
1284
1285 TP_PROTO(struct btrfs_fs_info *fs_info,
1286 struct btrfs_delayed_ref_node *ref,
1287 struct btrfs_delayed_ref_head *head_ref,
1288 int action),
1289
1290 TP_ARGS(fs_info, ref, head_ref, action),
1291
1292 TP_FIELDS(
1293 ctf_integer(u64, bytenr, ref->bytenr)
1294 ctf_integer(u64, num_bytes, ref->num_bytes)
1295 ctf_integer(int, action, action)
1296 ctf_integer(int, is_data, head_ref->is_data)
1297 )
1298 )
1299
1300 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1301
1302 add_delayed_ref_head,
1303
1304 btrfs_add_delayed_ref_head,
1305
1306 TP_PROTO(struct btrfs_fs_info *fs_info,
1307 struct btrfs_delayed_ref_node *ref,
1308 struct btrfs_delayed_ref_head *head_ref,
1309 int action),
1310
1311 TP_ARGS(fs_info, ref, head_ref, action)
1312 )
1313
1314 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1315
1316 run_delayed_ref_head,
1317
1318 btrfs_run_delayed_ref_head,
1319
1320 TP_PROTO(struct btrfs_fs_info *fs_info,
1321 struct btrfs_delayed_ref_node *ref,
1322 struct btrfs_delayed_ref_head *head_ref,
1323 int action),
1324
1325 TP_ARGS(fs_info, ref, head_ref, action)
1326 )
1327
1328 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0))
1329 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
1330
1331 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
1332 const struct btrfs_delayed_ref_head *head_ref,
1333 int action),
1334
1335 TP_ARGS(ref, head_ref, action),
1336
1337 TP_FIELDS(
1338 ctf_integer(u64, bytenr, ref->bytenr)
1339 ctf_integer(u64, num_bytes, ref->num_bytes)
1340 ctf_integer(int, action, action)
1341 ctf_integer(int, is_data, head_ref->is_data)
1342 )
1343 )
1344
1345 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1346
1347 add_delayed_ref_head,
1348
1349 btrfs_add_delayed_ref_head,
1350
1351 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
1352 const struct btrfs_delayed_ref_head *head_ref,
1353 int action),
1354
1355 TP_ARGS(ref, head_ref, action)
1356 )
1357
1358 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1359
1360 run_delayed_ref_head,
1361
1362 btrfs_run_delayed_ref_head,
1363
1364 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
1365 const struct btrfs_delayed_ref_head *head_ref,
1366 int action),
1367
1368 TP_ARGS(ref, head_ref, action)
1369 )
1370
1371 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
1372 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
1373
1374 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1375 struct btrfs_delayed_ref_head *head_ref,
1376 int action),
1377
1378 TP_ARGS(ref, head_ref, action),
1379
1380 TP_FIELDS(
1381 ctf_integer(u64, bytenr, ref->bytenr)
1382 ctf_integer(u64, num_bytes, ref->num_bytes)
1383 ctf_integer(int, action, action)
1384 ctf_integer(int, is_data, head_ref->is_data)
1385 )
1386 )
1387
1388 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1389
1390 add_delayed_ref_head,
1391
1392 btrfs_add_delayed_ref_head,
1393
1394 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1395 struct btrfs_delayed_ref_head *head_ref,
1396 int action),
1397
1398 TP_ARGS(ref, head_ref, action)
1399 )
1400
1401 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1402
1403 run_delayed_ref_head,
1404
1405 btrfs_run_delayed_ref_head,
1406
1407 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1408 struct btrfs_delayed_ref_head *head_ref,
1409 int action),
1410
1411 TP_ARGS(ref, head_ref, action)
1412 )
1413
1414 #else
1415 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
1416
1417 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1418 struct btrfs_delayed_ref_head *head_ref,
1419 int action),
1420
1421 TP_ARGS(ref, head_ref, action),
1422
1423 TP_FIELDS(
1424 ctf_integer(u64, bytenr, ref->bytenr)
1425 ctf_integer(u64, num_bytes, ref->num_bytes)
1426 ctf_integer(int, action, action)
1427 ctf_integer(int, is_data, head_ref->is_data)
1428 )
1429 )
1430 #endif
1431
1432 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1433
1434 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1435
1436 TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
1437 u64 offset, u64 size),
1438
1439 TP_ARGS(fs_info, map, offset, size),
1440
1441 TP_FIELDS(
1442 ctf_integer(int, num_stripes, map->num_stripes)
1443 ctf_integer(u64, type, map->type)
1444 ctf_integer(int, sub_stripes, map->sub_stripes)
1445 ctf_integer(u64, offset, offset)
1446 ctf_integer(u64, size, size)
1447 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
1448 )
1449 )
1450
1451 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1452
1453 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
1454 u64 offset, u64 size),
1455
1456 TP_ARGS(info, map, offset, size)
1457 )
1458
1459 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1460
1461 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
1462 u64 offset, u64 size),
1463
1464 TP_ARGS(info, map, offset, size)
1465 )
1466
1467 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1468
1469 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1470
1471 TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
1472 u64 offset, u64 size),
1473
1474 TP_ARGS(fs_info, map, offset, size),
1475
1476 TP_FIELDS(
1477 ctf_integer(int, num_stripes, map->num_stripes)
1478 ctf_integer(u64, type, map->type)
1479 ctf_integer(int, sub_stripes, map->sub_stripes)
1480 ctf_integer(u64, offset, offset)
1481 ctf_integer(u64, size, size)
1482 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
1483 )
1484 )
1485
1486 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1487
1488 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
1489 u64 offset, u64 size),
1490
1491 TP_ARGS(info, map, offset, size)
1492 )
1493
1494 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1495
1496 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
1497 u64 offset, u64 size),
1498
1499 TP_ARGS(info, map, offset, size)
1500 )
1501
1502 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
1503 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
1504 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
1505 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1506
1507 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1508
1509 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1510 u64 offset, u64 size),
1511
1512 TP_ARGS(root, map, offset, size),
1513
1514 TP_FIELDS(
1515 ctf_integer(int, num_stripes, map->num_stripes)
1516 ctf_integer(u64, type, map->type)
1517 ctf_integer(int, sub_stripes, map->sub_stripes)
1518 ctf_integer(u64, offset, offset)
1519 ctf_integer(u64, size, size)
1520 ctf_integer(u64, root_objectid, root->root_key.objectid)
1521 )
1522 )
1523
1524 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1525
1526 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1527 u64 offset, u64 size),
1528
1529 TP_ARGS(root, map, offset, size)
1530 )
1531
1532 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1533
1534 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1535 u64 offset, u64 size),
1536
1537 TP_ARGS(root, map, offset, size)
1538 )
1539
1540 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1541
1542 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1543
1544 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1545 u64 offset, u64 size),
1546
1547 TP_ARGS(root, map, offset, size),
1548
1549 TP_FIELDS(
1550 ctf_integer(int, num_stripes, map->num_stripes)
1551 ctf_integer(u64, type, map->type)
1552 ctf_integer(int, sub_stripes, map->sub_stripes)
1553 ctf_integer(u64, offset, offset)
1554 ctf_integer(u64, size, size)
1555 ctf_integer(u64, root_objectid, root->root_key.objectid)
1556 )
1557 )
1558
1559 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1560
1561 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1562 u64 offset, u64 size),
1563
1564 TP_ARGS(root, map, offset, size)
1565 )
1566
1567 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1568
1569 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1570 u64 offset, u64 size),
1571
1572 TP_ARGS(root, map, offset, size)
1573 )
1574
1575 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1576
1577 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1578 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
1579 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
1580 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
1581 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1582 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
1583
1584 TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf,
1585 const struct extent_buffer *cow),
1586
1587 TP_ARGS(root, buf, cow),
1588
1589 TP_FIELDS(
1590 ctf_integer(u64, root_objectid, root->root_key.objectid)
1591 ctf_integer(u64, buf_start, buf->start)
1592 ctf_integer(int, refs, atomic_read(&buf->refs))
1593 ctf_integer(u64, cow_start, cow->start)
1594 ctf_integer(int, buf_level, btrfs_header_level(buf))
1595 ctf_integer(int, cow_level, btrfs_header_level(cow))
1596 )
1597 )
1598 #else
1599 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
1600
1601 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
1602 struct extent_buffer *cow),
1603
1604 TP_ARGS(root, buf, cow),
1605
1606 TP_FIELDS(
1607 ctf_integer(u64, root_objectid, root->root_key.objectid)
1608 ctf_integer(u64, buf_start, buf->start)
1609 ctf_integer(int, refs, atomic_read(&buf->refs))
1610 ctf_integer(u64, cow_start, cow->start)
1611 ctf_integer(int, buf_level, btrfs_header_level(buf))
1612 ctf_integer(int, cow_level, btrfs_header_level(cow))
1613 )
1614 )
1615 #endif
1616
1617 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1618 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
1619 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
1620 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
1621 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1622 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
1623
1624 TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val,
1625 u64 bytes, int reserve),
1626
1627 TP_ARGS(fs_info, type, val, bytes, reserve),
1628
1629 TP_FIELDS(
1630 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1631 ctf_string(type, type)
1632 ctf_integer(u64, val, val)
1633 ctf_integer(u64, bytes, bytes)
1634 ctf_integer(int, reserve, reserve)
1635 )
1636 )
1637 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1638 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
1639
1640 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
1641 u64 bytes, int reserve),
1642
1643 TP_ARGS(fs_info, type, val, bytes, reserve),
1644
1645 TP_FIELDS(
1646 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1647 ctf_string(type, type)
1648 ctf_integer(u64, val, val)
1649 ctf_integer(u64, bytes, bytes)
1650 ctf_integer(int, reserve, reserve)
1651 )
1652 )
1653 #endif
1654
1655 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1656
1657 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1658
1659 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1660
1661 TP_ARGS(info, start, len),
1662
1663 TP_FIELDS(
1664 ctf_integer(u64, start, start)
1665 ctf_integer(u64, len, len)
1666 )
1667 )
1668
1669 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1670
1671 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1672
1673 TP_ARGS(info, start, len)
1674 )
1675
1676 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1677
1678 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1679
1680 TP_ARGS(info, start, len)
1681 )
1682
1683 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1684
1685 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1686
1687 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1688
1689 TP_ARGS(info, start, len),
1690
1691 TP_FIELDS(
1692 ctf_integer(u64, start, start)
1693 ctf_integer(u64, len, len)
1694 )
1695 )
1696
1697 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1698
1699 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1700
1701 TP_ARGS(info, start, len)
1702 )
1703
1704 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1705
1706 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1707
1708 TP_ARGS(info, start, len)
1709 )
1710
1711 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
1712 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
1713 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
1714 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1715
1716 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1717
1718 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1719
1720 TP_ARGS(root, start, len),
1721
1722 TP_FIELDS(
1723 ctf_integer(u64, root_objectid, root->root_key.objectid)
1724 ctf_integer(u64, start, start)
1725 ctf_integer(u64, len, len)
1726 )
1727 )
1728
1729 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1730
1731 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1732
1733 TP_ARGS(root, start, len)
1734 )
1735
1736 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1737
1738 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1739
1740 TP_ARGS(root, start, len)
1741 )
1742
1743 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1744
1745 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1746
1747 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1748
1749 TP_ARGS(root, start, len),
1750
1751 TP_FIELDS(
1752 ctf_integer(u64, root_objectid, root->root_key.objectid)
1753 ctf_integer(u64, start, start)
1754 ctf_integer(u64, len, len)
1755 )
1756 )
1757
1758 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1759
1760 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1761
1762 TP_ARGS(root, start, len)
1763 )
1764
1765 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1766
1767 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1768
1769 TP_ARGS(root, start, len)
1770 )
1771
1772 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1773
1774 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
1775 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1776
1777 btrfs_find_free_extent,
1778
1779 TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1780 u64 data),
1781
1782 TP_ARGS(info, num_bytes, empty_size, data),
1783
1784 TP_FIELDS(
1785 ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
1786 ctf_integer(u64, num_bytes, num_bytes)
1787 ctf_integer(u64, empty_size, empty_size)
1788 ctf_integer(u64, data, data)
1789 )
1790 )
1791
1792 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1793
1794 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
1795 u64 len),
1796
1797 TP_ARGS(block_group, start, len),
1798
1799 TP_FIELDS(
1800 ctf_array(u8, fsid, block_group->fs_info->fsid, BTRFS_UUID_SIZE)
1801 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1802 ctf_integer(u64, flags, block_group->flags)
1803 ctf_integer(u64, start, start)
1804 ctf_integer(u64, len, len)
1805 )
1806 )
1807
1808 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1809
1810 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
1811 u64 len),
1812
1813 TP_ARGS(block_group, start, len)
1814 )
1815
1816 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1817
1818 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
1819 u64 len),
1820
1821 TP_ARGS(block_group, start, len)
1822 )
1823
1824 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1825 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1826
1827 btrfs_find_free_extent,
1828
1829 TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1830 u64 data),
1831
1832 TP_ARGS(info, num_bytes, empty_size, data),
1833
1834 TP_FIELDS(
1835 ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
1836 ctf_integer(u64, num_bytes, num_bytes)
1837 ctf_integer(u64, empty_size, empty_size)
1838 ctf_integer(u64, data, data)
1839 )
1840 )
1841
1842 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1843
1844 TP_PROTO(const struct btrfs_fs_info *info,
1845 const struct btrfs_block_group_cache *block_group, u64 start,
1846 u64 len),
1847
1848 TP_ARGS(info, block_group, start, len),
1849
1850 TP_FIELDS(
1851 ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
1852 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1853 ctf_integer(u64, flags, block_group->flags)
1854 ctf_integer(u64, start, start)
1855 ctf_integer(u64, len, len)
1856 )
1857 )
1858
1859 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1860
1861 TP_PROTO(const struct btrfs_fs_info *info,
1862 const struct btrfs_block_group_cache *block_group, u64 start,
1863 u64 len),
1864
1865 TP_ARGS(info, block_group, start, len)
1866 )
1867
1868 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1869
1870 TP_PROTO(const struct btrfs_fs_info *info,
1871 const struct btrfs_block_group_cache *block_group, u64 start,
1872 u64 len),
1873
1874 TP_ARGS(info, block_group, start, len)
1875 )
1876
1877 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1878
1879 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1880
1881 btrfs_find_free_extent,
1882
1883 TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1884 u64 data),
1885
1886 TP_ARGS(info, num_bytes, empty_size, data),
1887
1888 TP_FIELDS(
1889 ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
1890 ctf_integer(u64, num_bytes, num_bytes)
1891 ctf_integer(u64, empty_size, empty_size)
1892 ctf_integer(u64, data, data)
1893 )
1894 )
1895
1896 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1897
1898 TP_PROTO(struct btrfs_fs_info *info,
1899 struct btrfs_block_group_cache *block_group, u64 start,
1900 u64 len),
1901
1902 TP_ARGS(info, block_group, start, len),
1903
1904 TP_FIELDS(
1905 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1906 ctf_integer(u64, flags, block_group->flags)
1907 ctf_integer(u64, start, start)
1908 ctf_integer(u64, len, len)
1909 )
1910 )
1911
1912 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1913
1914 TP_PROTO(struct btrfs_fs_info *info,
1915 struct btrfs_block_group_cache *block_group, u64 start,
1916 u64 len),
1917
1918 TP_ARGS(info, block_group, start, len)
1919 )
1920
1921 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1922
1923 TP_PROTO(struct btrfs_fs_info *info,
1924 struct btrfs_block_group_cache *block_group, u64 start,
1925 u64 len),
1926
1927 TP_ARGS(info, block_group, start, len)
1928 )
1929 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
1930 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
1931 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
1932 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1933
1934 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1935
1936 btrfs_find_free_extent,
1937
1938 TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1939 u64 data),
1940
1941 TP_ARGS(root, num_bytes, empty_size, data),
1942
1943 TP_FIELDS(
1944 ctf_integer(u64, root_objectid, root->root_key.objectid)
1945 ctf_integer(u64, num_bytes, num_bytes)
1946 ctf_integer(u64, empty_size, empty_size)
1947 ctf_integer(u64, data, data)
1948 )
1949 )
1950
1951 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1952
1953 TP_PROTO(const struct btrfs_root *root,
1954 const struct btrfs_block_group_cache *block_group, u64 start,
1955 u64 len),
1956
1957 TP_ARGS(root, block_group, start, len),
1958
1959 TP_FIELDS(
1960 ctf_integer(u64, root_objectid, root->root_key.objectid)
1961 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1962 ctf_integer(u64, flags, block_group->flags)
1963 ctf_integer(u64, start, start)
1964 ctf_integer(u64, len, len)
1965 )
1966 )
1967
1968 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1969
1970 TP_PROTO(const struct btrfs_root *root,
1971 const struct btrfs_block_group_cache *block_group, u64 start,
1972 u64 len),
1973
1974 TP_ARGS(root, block_group, start, len)
1975 )
1976
1977 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1978
1979 TP_PROTO(const struct btrfs_root *root,
1980 const struct btrfs_block_group_cache *block_group, u64 start,
1981 u64 len),
1982
1983 TP_ARGS(root, block_group, start, len)
1984 )
1985
1986 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1987
1988 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1989
1990 btrfs_find_free_extent,
1991
1992 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1993 u64 data),
1994
1995 TP_ARGS(root, num_bytes, empty_size, data),
1996
1997 TP_FIELDS(
1998 ctf_integer(u64, root_objectid, root->root_key.objectid)
1999 ctf_integer(u64, num_bytes, num_bytes)
2000 ctf_integer(u64, empty_size, empty_size)
2001 ctf_integer(u64, data, data)
2002 )
2003 )
2004
2005 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
2006
2007 TP_PROTO(struct btrfs_root *root,
2008 struct btrfs_block_group_cache *block_group, u64 start,
2009 u64 len),
2010
2011 TP_ARGS(root, block_group, start, len),
2012
2013 TP_FIELDS(
2014 ctf_integer(u64, root_objectid, root->root_key.objectid)
2015 ctf_integer(u64, bg_objectid, block_group->key.objectid)
2016 ctf_integer(u64, flags, block_group->flags)
2017 ctf_integer(u64, start, start)
2018 ctf_integer(u64, len, len)
2019 )
2020 )
2021
2022 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
2023
2024 TP_PROTO(struct btrfs_root *root,
2025 struct btrfs_block_group_cache *block_group, u64 start,
2026 u64 len),
2027
2028 TP_ARGS(root, block_group, start, len)
2029 )
2030
2031 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
2032
2033 TP_PROTO(struct btrfs_root *root,
2034 struct btrfs_block_group_cache *block_group, u64 start,
2035 u64 len),
2036
2037 TP_ARGS(root, block_group, start, len)
2038 )
2039
2040 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
2041
2042 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
2043 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
2044 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
2045 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
2046 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
2047 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
2048
2049 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
2050 u64 bytes, u64 empty_size, u64 min_bytes),
2051
2052 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
2053
2054 TP_FIELDS(
2055 ctf_integer(u64, bg_objectid, block_group->key.objectid)
2056 ctf_integer(u64, flags, block_group->flags)
2057 ctf_integer(u64, start, start)
2058 ctf_integer(u64, bytes, bytes)
2059 ctf_integer(u64, empty_size, empty_size)
2060 ctf_integer(u64, min_bytes, min_bytes)
2061 )
2062 )
2063
2064 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
2065
2066 TP_PROTO(const struct btrfs_block_group_cache *block_group),
2067
2068 TP_ARGS(block_group),
2069
2070 TP_FIELDS(
2071 ctf_integer(u64, bg_objectid, block_group->key.objectid)
2072 )
2073 )
2074
2075 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
2076
2077 TP_PROTO(const struct btrfs_block_group_cache *block_group,
2078 const struct btrfs_free_cluster *cluster, u64 size, int bitmap),
2079
2080 TP_ARGS(block_group, cluster, size, bitmap),
2081
2082 TP_FIELDS(
2083 ctf_integer(u64, bg_objectid, block_group->key.objectid)
2084 ctf_integer(u64, flags, block_group->flags)
2085 ctf_integer(u64, start, cluster->window_start)
2086 ctf_integer(u64, max_size, cluster->max_size)
2087 ctf_integer(u64, size, size)
2088 ctf_integer(int, bitmap, bitmap)
2089 )
2090 )
2091 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
2092 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
2093
2094 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
2095 u64 bytes, u64 empty_size, u64 min_bytes),
2096
2097 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
2098
2099 TP_FIELDS(
2100 ctf_integer(u64, bg_objectid, block_group->key.objectid)
2101 ctf_integer(u64, flags, block_group->flags)
2102 ctf_integer(u64, start, start)
2103 ctf_integer(u64, bytes, bytes)
2104 ctf_integer(u64, empty_size, empty_size)
2105 ctf_integer(u64, min_bytes, min_bytes)
2106 )
2107 )
2108
2109 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
2110
2111 TP_PROTO(struct btrfs_block_group_cache *block_group),
2112
2113 TP_ARGS(block_group),
2114
2115 TP_FIELDS(
2116 ctf_integer(u64, bg_objectid, block_group->key.objectid)
2117 )
2118 )
2119
2120 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
2121
2122 TP_PROTO(struct btrfs_block_group_cache *block_group,
2123 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
2124
2125 TP_ARGS(block_group, cluster, size, bitmap),
2126
2127 TP_FIELDS(
2128 ctf_integer(u64, bg_objectid, block_group->key.objectid)
2129 ctf_integer(u64, flags, block_group->flags)
2130 ctf_integer(u64, start, cluster->window_start)
2131 ctf_integer(u64, max_size, cluster->max_size)
2132 ctf_integer(u64, size, size)
2133 ctf_integer(int, bitmap, bitmap)
2134 )
2135 )
2136 #endif
2137
2138 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
2139 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
2140 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
2141 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
2142 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
2143 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
2144
2145 btrfs_alloc_extent_state,
2146
2147 TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP),
2148
2149 TP_ARGS(state, mask, IP),
2150
2151 TP_FIELDS(
2152 ctf_integer_hex(const struct extent_state *, state, state)
2153 ctf_integer(gfp_t, mask, mask)
2154 ctf_integer(unsigned long, ip, IP)
2155 )
2156 )
2157
2158 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
2159
2160 btrfs_free_extent_state,
2161
2162 TP_PROTO(const struct extent_state *state, unsigned long IP),
2163
2164 TP_ARGS(state, IP),
2165
2166 TP_FIELDS(
2167 ctf_integer_hex(const struct extent_state *, state, state)
2168 ctf_integer(unsigned long, ip, IP)
2169 )
2170 )
2171 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
2172 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
2173
2174 btrfs_alloc_extent_state,
2175
2176 TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP),
2177
2178 TP_ARGS(state, mask, IP),
2179
2180 TP_FIELDS(
2181 ctf_integer_hex(struct extent_state *, state, state)
2182 ctf_integer(gfp_t, mask, mask)
2183 ctf_integer(unsigned long, ip, IP)
2184 )
2185 )
2186
2187 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
2188
2189 btrfs_free_extent_state,
2190
2191 TP_PROTO(struct extent_state *state, unsigned long IP),
2192
2193 TP_ARGS(state, IP),
2194
2195 TP_FIELDS(
2196 ctf_integer_hex(struct extent_state *, state, state)
2197 ctf_integer(unsigned long, ip, IP)
2198 )
2199 )
2200 #endif
2201
2202 #endif /* LTTNG_TRACE_BTRFS_H */
2203
2204 /* This part must be outside protection */
2205 #include <probes/define_trace.h>
This page took 0.142949 seconds and 4 git commands to generate.