2 #define TRACE_SYSTEM btrfs
4 #if !defined(LTTNG_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_BTRFS_H
7 #include <probes/lttng-tracepoint-event.h>
8 #include <linux/writeback.h>
9 #include <linux/version.h>
11 #ifndef _TRACE_BTRFS_DEF_
12 #define _TRACE_BTRFS_DEF_
17 struct btrfs_ordered_extent
;
18 struct btrfs_delayed_ref_node
;
19 struct btrfs_delayed_tree_ref
;
20 struct btrfs_delayed_data_ref
;
21 struct btrfs_delayed_ref_head
;
22 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
23 struct btrfs_block_group_cache
;
24 struct btrfs_free_cluster
;
28 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
33 #define BTRFS_UUID_SIZE 16
35 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
36 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit
,
38 TP_PROTO(const struct btrfs_root
*root
),
43 ctf_integer(u64
, generation
, root
->fs_info
->generation
)
44 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
48 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode
,
50 TP_PROTO(const struct inode
*inode
),
55 ctf_integer(ino_t
, ino
, inode
->i_ino
)
56 ctf_integer(blkcnt_t
, blocks
, inode
->i_blocks
)
57 ctf_integer(u64
, disk_i_size
, BTRFS_I(inode
)->disk_i_size
)
58 ctf_integer(u64
, generation
, BTRFS_I(inode
)->generation
)
59 ctf_integer(u64
, last_trans
, BTRFS_I(inode
)->last_trans
)
60 ctf_integer(u64
, logged_trans
, BTRFS_I(inode
)->logged_trans
)
61 ctf_integer(u64
, root_objectid
,
62 BTRFS_I(inode
)->root
->root_key
.objectid
)
66 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_new
,
68 TP_PROTO(const struct inode
*inode
),
73 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_request
,
75 TP_PROTO(const struct inode
*inode
),
80 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_evict
,
82 TP_PROTO(const struct inode
*inode
),
87 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit
,
89 TP_PROTO(struct btrfs_root
*root
),
94 ctf_integer(u64
, generation
, root
->fs_info
->generation
)
95 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
99 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode
,
101 TP_PROTO(struct inode
*inode
),
106 ctf_integer(ino_t
, ino
, inode
->i_ino
)
107 ctf_integer(blkcnt_t
, blocks
, inode
->i_blocks
)
108 ctf_integer(u64
, disk_i_size
, BTRFS_I(inode
)->disk_i_size
)
109 ctf_integer(u64
, generation
, BTRFS_I(inode
)->generation
)
110 ctf_integer(u64
, last_trans
, BTRFS_I(inode
)->last_trans
)
111 ctf_integer(u64
, logged_trans
, BTRFS_I(inode
)->logged_trans
)
112 ctf_integer(u64
, root_objectid
,
113 BTRFS_I(inode
)->root
->root_key
.objectid
)
117 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_new
,
119 TP_PROTO(struct inode
*inode
),
124 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_request
,
126 TP_PROTO(struct inode
*inode
),
131 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_evict
,
133 TP_PROTO(struct inode
*inode
),
139 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
141 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
143 TP_PROTO(const struct btrfs_root
*root
, const struct btrfs_inode
*inode
,
144 const struct extent_map
*map
),
146 TP_ARGS(root
, inode
, map
),
149 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
150 ctf_integer(u64
, ino
, btrfs_ino(inode
))
151 ctf_integer(u64
, start
, map
->start
)
152 ctf_integer(u64
, len
, map
->len
)
153 ctf_integer(u64
, orig_start
, map
->orig_start
)
154 ctf_integer(u64
, block_start
, map
->block_start
)
155 ctf_integer(u64
, block_len
, map
->block_len
)
156 ctf_integer(unsigned long, flags
, map
->flags
)
157 ctf_integer(int, refs
, refcount_read(&map
->refs
))
158 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
162 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
164 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
166 TP_PROTO(struct btrfs_root
*root
, struct btrfs_inode
*inode
,
167 struct extent_map
*map
),
169 TP_ARGS(root
, inode
, map
),
172 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
173 ctf_integer(u64
, ino
, btrfs_ino(inode
))
174 ctf_integer(u64
, start
, map
->start
)
175 ctf_integer(u64
, len
, map
->len
)
176 ctf_integer(u64
, orig_start
, map
->orig_start
)
177 ctf_integer(u64
, block_start
, map
->block_start
)
178 ctf_integer(u64
, block_len
, map
->block_len
)
179 ctf_integer(unsigned long, flags
, map
->flags
)
180 ctf_integer(int, refs
, refcount_read(&map
->refs
))
181 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
185 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
187 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
189 TP_PROTO(struct btrfs_root
*root
, struct btrfs_inode
*inode
,
190 struct extent_map
*map
),
192 TP_ARGS(root
, inode
, map
),
195 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
196 ctf_integer(u64
, ino
, btrfs_ino(inode
))
197 ctf_integer(u64
, start
, map
->start
)
198 ctf_integer(u64
, len
, map
->len
)
199 ctf_integer(u64
, orig_start
, map
->orig_start
)
200 ctf_integer(u64
, block_start
, map
->block_start
)
201 ctf_integer(u64
, block_len
, map
->block_len
)
202 ctf_integer(unsigned long, flags
, map
->flags
)
203 ctf_integer(int, refs
, atomic_read(&map
->refs
))
204 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
208 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
210 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
212 TP_PROTO(struct btrfs_root
*root
, struct inode
*inode
,
213 struct extent_map
*map
),
215 TP_ARGS(root
, inode
, map
),
218 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
219 ctf_integer(u64
, ino
, btrfs_ino(inode
))
220 ctf_integer(u64
, start
, map
->start
)
221 ctf_integer(u64
, len
, map
->len
)
222 ctf_integer(u64
, orig_start
, map
->orig_start
)
223 ctf_integer(u64
, block_start
, map
->block_start
)
224 ctf_integer(u64
, block_len
, map
->block_len
)
225 ctf_integer(unsigned long, flags
, map
->flags
)
226 ctf_integer(int, refs
, atomic_read(&map
->refs
))
227 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
231 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
233 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
235 TP_PROTO(struct btrfs_root
*root
, struct extent_map
*map
),
240 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
241 ctf_integer(u64
, start
, map
->start
)
242 ctf_integer(u64
, len
, map
->len
)
243 ctf_integer(u64
, orig_start
, map
->orig_start
)
244 ctf_integer(u64
, block_start
, map
->block_start
)
245 ctf_integer(u64
, block_len
, map
->block_len
)
246 ctf_integer(unsigned long, flags
, map
->flags
)
247 ctf_integer(int, refs
, atomic_read(&map
->refs
))
248 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
252 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
254 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
255 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent
,
257 TP_PROTO(const struct inode
*inode
,
258 const struct btrfs_ordered_extent
*ordered
),
260 TP_ARGS(inode
, ordered
),
263 ctf_integer(ino_t
, ino
, inode
->i_ino
)
264 ctf_integer(u64
, file_offset
, ordered
->file_offset
)
265 ctf_integer(u64
, start
, ordered
->start
)
266 ctf_integer(u64
, len
, ordered
->len
)
267 ctf_integer(u64
, disk_len
, ordered
->disk_len
)
268 ctf_integer(u64
, bytes_left
, ordered
->bytes_left
)
269 ctf_integer(unsigned long, flags
, ordered
->flags
)
270 ctf_integer(int, compress_type
, ordered
->compress_type
)
271 ctf_integer(int, refs
, refcount_read(&ordered
->refs
))
272 ctf_integer(u64
, root_objectid
,
273 BTRFS_I(inode
)->root
->root_key
.objectid
)
276 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
277 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent
,
279 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
281 TP_ARGS(inode
, ordered
),
284 ctf_integer(ino_t
, ino
, inode
->i_ino
)
285 ctf_integer(u64
, file_offset
, ordered
->file_offset
)
286 ctf_integer(u64
, start
, ordered
->start
)
287 ctf_integer(u64
, len
, ordered
->len
)
288 ctf_integer(u64
, disk_len
, ordered
->disk_len
)
289 ctf_integer(u64
, bytes_left
, ordered
->bytes_left
)
290 ctf_integer(unsigned long, flags
, ordered
->flags
)
291 ctf_integer(int, compress_type
, ordered
->compress_type
)
292 ctf_integer(int, refs
, refcount_read(&ordered
->refs
))
293 ctf_integer(u64
, root_objectid
,
294 BTRFS_I(inode
)->root
->root_key
.objectid
)
298 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent
,
300 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
302 TP_ARGS(inode
, ordered
),
305 ctf_integer(ino_t
, ino
, inode
->i_ino
)
306 ctf_integer(u64
, file_offset
, ordered
->file_offset
)
307 ctf_integer(u64
, start
, ordered
->start
)
308 ctf_integer(u64
, len
, ordered
->len
)
309 ctf_integer(u64
, disk_len
, ordered
->disk_len
)
310 ctf_integer(u64
, bytes_left
, ordered
->bytes_left
)
311 ctf_integer(unsigned long, flags
, ordered
->flags
)
312 ctf_integer(int, compress_type
, ordered
->compress_type
)
313 ctf_integer(int, refs
, atomic_read(&ordered
->refs
))
314 ctf_integer(u64
, root_objectid
,
315 BTRFS_I(inode
)->root
->root_key
.objectid
)
320 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
321 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_add
,
323 TP_PROTO(const struct inode
*inode
,
324 const struct btrfs_ordered_extent
*ordered
),
326 TP_ARGS(inode
, ordered
)
329 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_remove
,
331 TP_PROTO(const struct inode
*inode
,
332 const struct btrfs_ordered_extent
*ordered
),
334 TP_ARGS(inode
, ordered
)
337 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_start
,
339 TP_PROTO(const struct inode
*inode
,
340 const struct btrfs_ordered_extent
*ordered
),
342 TP_ARGS(inode
, ordered
)
345 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_put
,
347 TP_PROTO(const struct inode
*inode
,
348 const struct btrfs_ordered_extent
*ordered
),
350 TP_ARGS(inode
, ordered
)
353 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage
,
355 TP_PROTO(const struct page
*page
, const struct inode
*inode
,
356 const struct writeback_control
*wbc
),
358 TP_ARGS(page
, inode
, wbc
),
361 ctf_integer(ino_t
, ino
, inode
->i_ino
)
362 ctf_integer(pgoff_t
, index
, page
->index
)
363 ctf_integer(long, nr_to_write
, wbc
->nr_to_write
)
364 ctf_integer(long, pages_skipped
, wbc
->pages_skipped
)
365 ctf_integer(loff_t
, range_start
, wbc
->range_start
)
366 ctf_integer(loff_t
, range_end
, wbc
->range_end
)
367 ctf_integer(char, for_kupdate
, wbc
->for_kupdate
)
368 ctf_integer(char, for_reclaim
, wbc
->for_reclaim
)
369 ctf_integer(char, range_cyclic
, wbc
->range_cyclic
)
370 ctf_integer(pgoff_t
, writeback_index
,
371 inode
->i_mapping
->writeback_index
)
372 ctf_integer(u64
, root_objectid
,
373 BTRFS_I(inode
)->root
->root_key
.objectid
)
377 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage
,
381 btrfs__extent_writepage
,
383 TP_PROTO(const struct page
*page
, const struct inode
*inode
,
384 const struct writeback_control
*wbc
),
386 TP_ARGS(page
, inode
, wbc
)
389 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook
,
391 TP_PROTO(const struct page
*page
, u64 start
, u64 end
, int uptodate
),
393 TP_ARGS(page
, start
, end
, uptodate
),
396 ctf_integer(ino_t
, ino
, page
->mapping
->host
->i_ino
)
397 ctf_integer(pgoff_t
, index
, page
->index
)
398 ctf_integer(u64
, start
, start
)
399 ctf_integer(u64
, end
, end
)
400 ctf_integer(int, uptodate
, uptodate
)
401 ctf_integer(u64
, root_objectid
,
402 BTRFS_I(page
->mapping
->host
)->root
->root_key
.objectid
)
406 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file
,
408 TP_PROTO(const struct file
*file
, int datasync
),
410 TP_ARGS(file
, datasync
),
413 ctf_integer(ino_t
, ino
, file
->f_path
.dentry
->d_inode
->i_ino
)
414 ctf_integer(ino_t
, parent
, file
->f_path
.dentry
->d_parent
->d_inode
->i_ino
)
415 ctf_integer(int, datasync
, datasync
)
416 ctf_integer(u64
, root_objectid
,
417 BTRFS_I(file
->f_path
.dentry
->d_inode
)->root
->root_key
.objectid
)
421 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_add
,
423 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
425 TP_ARGS(inode
, ordered
)
428 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_remove
,
430 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
432 TP_ARGS(inode
, ordered
)
435 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_start
,
437 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
439 TP_ARGS(inode
, ordered
)
442 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_put
,
444 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
446 TP_ARGS(inode
, ordered
)
449 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage
,
451 TP_PROTO(struct page
*page
, struct inode
*inode
,
452 struct writeback_control
*wbc
),
454 TP_ARGS(page
, inode
, wbc
),
457 ctf_integer(ino_t
, ino
, inode
->i_ino
)
458 ctf_integer(pgoff_t
, index
, page
->index
)
459 ctf_integer(long, nr_to_write
, wbc
->nr_to_write
)
460 ctf_integer(long, pages_skipped
, wbc
->pages_skipped
)
461 ctf_integer(loff_t
, range_start
, wbc
->range_start
)
462 ctf_integer(loff_t
, range_end
, wbc
->range_end
)
463 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
464 ctf_integer(char, nonblocking
, wbc
->nonblocking
)
466 ctf_integer(char, for_kupdate
, wbc
->for_kupdate
)
467 ctf_integer(char, for_reclaim
, wbc
->for_reclaim
)
468 ctf_integer(char, range_cyclic
, wbc
->range_cyclic
)
469 ctf_integer(pgoff_t
, writeback_index
,
470 inode
->i_mapping
->writeback_index
)
471 ctf_integer(u64
, root_objectid
,
472 BTRFS_I(inode
)->root
->root_key
.objectid
)
476 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage
,
480 btrfs__extent_writepage
,
482 TP_PROTO(struct page
*page
, struct inode
*inode
,
483 struct writeback_control
*wbc
),
485 TP_ARGS(page
, inode
, wbc
)
488 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook
,
490 TP_PROTO(struct page
*page
, u64 start
, u64 end
, int uptodate
),
492 TP_ARGS(page
, start
, end
, uptodate
),
495 ctf_integer(ino_t
, ino
, page
->mapping
->host
->i_ino
)
496 ctf_integer(pgoff_t
, index
, page
->index
)
497 ctf_integer(u64
, start
, start
)
498 ctf_integer(u64
, end
, end
)
499 ctf_integer(int, uptodate
, uptodate
)
500 ctf_integer(u64
, root_objectid
,
501 BTRFS_I(page
->mapping
->host
)->root
->root_key
.objectid
)
505 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file
,
507 TP_PROTO(struct file
*file
, int datasync
),
509 TP_ARGS(file
, datasync
),
512 ctf_integer(ino_t
, ino
, file
->f_path
.dentry
->d_inode
->i_ino
)
513 ctf_integer(ino_t
, parent
, file
->f_path
.dentry
->d_parent
->d_inode
->i_ino
)
514 ctf_integer(int, datasync
, datasync
)
515 ctf_integer(u64
, root_objectid
,
516 BTRFS_I(file
->f_path
.dentry
->d_inode
)->root
->root_key
.objectid
)
521 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
522 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs
,
524 TP_PROTO(const struct btrfs_fs_info
*fs_info
, int wait
),
526 TP_ARGS(fs_info
, wait
),
529 ctf_integer(int, wait
, wait
)
532 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
533 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs
,
535 TP_PROTO(struct btrfs_fs_info
*fs_info
, int wait
),
537 TP_ARGS(fs_info
, wait
),
540 ctf_integer(int, wait
, wait
)
544 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs
,
551 ctf_integer(int, wait
, wait
)
556 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
557 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group
,
559 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
560 const struct btrfs_block_group_cache
*block_group
, int create
),
562 TP_ARGS(fs_info
, block_group
, create
),
565 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
566 ctf_integer(u64
, offset
, block_group
->key
.objectid
)
567 ctf_integer(u64
, size
, block_group
->key
.offset
)
568 ctf_integer(u64
, flags
, block_group
->flags
)
569 ctf_integer(u64
, bytes_used
, btrfs_block_group_used(&block_group
->item
))
570 ctf_integer(u64
, bytes_super
, block_group
->bytes_super
)
571 ctf_integer(int, create
, create
)
575 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group
,
577 TP_PROTO(struct btrfs_fs_info
*fs_info
,
578 struct btrfs_block_group_cache
*block_group
, int create
),
580 TP_ARGS(fs_info
, block_group
, create
),
583 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
584 ctf_integer(u64
, offset
, block_group
->key
.objectid
)
585 ctf_integer(u64
, size
, block_group
->key
.offset
)
586 ctf_integer(u64
, flags
, block_group
->flags
)
587 ctf_integer(u64
, bytes_used
, btrfs_block_group_used(&block_group
->item
))
588 ctf_integer(u64
, bytes_super
, block_group
->bytes_super
)
589 ctf_integer(int, create
, create
)
594 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
595 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref
,
597 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
598 const struct btrfs_delayed_ref_node
*ref
,
599 const struct btrfs_delayed_tree_ref
*full_ref
,
602 TP_ARGS(fs_info
, ref
, full_ref
, action
),
605 ctf_integer(u64
, bytenr
, ref
->bytenr
)
606 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
607 ctf_integer(int, action
, action
)
608 ctf_integer(u64
, parent
, full_ref
->parent
)
609 ctf_integer(u64
, ref_root
, full_ref
->root
)
610 ctf_integer(int, level
, full_ref
->level
)
611 ctf_integer(int, type
, ref
->type
)
612 ctf_integer(u64
, seq
, ref
->seq
)
615 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
616 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref
,
618 TP_PROTO(struct btrfs_fs_info
*fs_info
,
619 struct btrfs_delayed_ref_node
*ref
,
620 struct btrfs_delayed_tree_ref
*full_ref
,
623 TP_ARGS(fs_info
, ref
, full_ref
, action
),
626 ctf_integer(u64
, bytenr
, ref
->bytenr
)
627 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
628 ctf_integer(int, action
, action
)
629 ctf_integer(u64
, parent
, full_ref
->parent
)
630 ctf_integer(u64
, ref_root
, full_ref
->root
)
631 ctf_integer(int, level
, full_ref
->level
)
632 ctf_integer(int, type
, ref
->type
)
633 ctf_integer(u64
, seq
, ref
->seq
)
637 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref
,
639 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
640 struct btrfs_delayed_tree_ref
*full_ref
,
643 TP_ARGS(ref
, full_ref
, action
),
646 ctf_integer(u64
, bytenr
, ref
->bytenr
)
647 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
648 ctf_integer(int, action
, action
)
649 ctf_integer(u64
, parent
, full_ref
->parent
)
650 ctf_integer(u64
, ref_root
, full_ref
->root
)
651 ctf_integer(int, level
, full_ref
->level
)
652 ctf_integer(int, type
, ref
->type
)
653 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
654 ctf_integer(u64
, seq
, ref
->seq
)
660 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref
,
662 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
663 struct btrfs_delayed_data_ref
*full_ref
,
666 TP_ARGS(ref
, full_ref
, action
),
669 ctf_integer(u64
, bytenr
, ref
->bytenr
)
670 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
671 ctf_integer(int, action
, action
)
672 ctf_integer(u64
, parent
, full_ref
->parent
)
673 ctf_integer(u64
, ref_root
, full_ref
->root
)
674 ctf_integer(u64
, owner
, full_ref
->objectid
)
675 ctf_integer(u64
, offset
, full_ref
->offset
)
676 ctf_integer(int, type
, ref
->type
)
677 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
678 ctf_integer(u64
, seq
, ref
->seq
)
683 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
684 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
686 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
687 const struct btrfs_delayed_ref_head
*head_ref
,
690 TP_ARGS(fs_info
, head_ref
, action
),
693 ctf_integer(u64
, bytenr
, head_ref
->bytenr
)
694 ctf_integer(u64
, num_bytes
, head_ref
->num_bytes
)
695 ctf_integer(int, action
, action
)
696 ctf_integer(int, is_data
, head_ref
->is_data
)
700 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, add_delayed_ref_head
,
702 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
703 const struct btrfs_delayed_ref_head
*head_ref
,
706 TP_ARGS(fs_info
, head_ref
, action
)
709 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, run_delayed_ref_head
,
711 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
712 const struct btrfs_delayed_ref_head
*head_ref
,
715 TP_ARGS(fs_info
, head_ref
, action
)
718 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
719 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
721 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
722 const struct btrfs_delayed_ref_node
*ref
,
723 const struct btrfs_delayed_ref_head
*head_ref
,
726 TP_ARGS(fs_info
, ref
, head_ref
, action
),
729 ctf_integer(u64
, bytenr
, ref
->bytenr
)
730 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
731 ctf_integer(int, action
, action
)
732 ctf_integer(int, is_data
, head_ref
->is_data
)
736 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, add_delayed_ref_head
,
738 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
739 const struct btrfs_delayed_ref_node
*ref
,
740 const struct btrfs_delayed_ref_head
*head_ref
,
743 TP_ARGS(fs_info
, ref
, head_ref
, action
)
746 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, run_delayed_ref_head
,
748 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
749 const struct btrfs_delayed_ref_node
*ref
,
750 const struct btrfs_delayed_ref_head
*head_ref
,
753 TP_ARGS(fs_info
, ref
, head_ref
, action
)
756 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
757 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
759 TP_PROTO(struct btrfs_fs_info
*fs_info
,
760 struct btrfs_delayed_ref_node
*ref
,
761 struct btrfs_delayed_ref_head
*head_ref
,
764 TP_ARGS(fs_info
, ref
, head_ref
, action
),
767 ctf_integer(u64
, bytenr
, ref
->bytenr
)
768 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
769 ctf_integer(int, action
, action
)
770 ctf_integer(int, is_data
, head_ref
->is_data
)
774 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, add_delayed_ref_head
,
776 TP_PROTO(struct btrfs_fs_info
*fs_info
,
777 struct btrfs_delayed_ref_node
*ref
,
778 struct btrfs_delayed_ref_head
*head_ref
,
781 TP_ARGS(fs_info
, ref
, head_ref
, action
)
784 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, run_delayed_ref_head
,
786 TP_PROTO(struct btrfs_fs_info
*fs_info
,
787 struct btrfs_delayed_ref_node
*ref
,
788 struct btrfs_delayed_ref_head
*head_ref
,
791 TP_ARGS(fs_info
, ref
, head_ref
, action
)
794 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
795 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
797 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
798 struct btrfs_delayed_ref_head
*head_ref
,
801 TP_ARGS(ref
, head_ref
, action
),
804 ctf_integer(u64
, bytenr
, ref
->bytenr
)
805 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
806 ctf_integer(int, action
, action
)
807 ctf_integer(int, is_data
, head_ref
->is_data
)
811 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, add_delayed_ref_head
,
813 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
814 struct btrfs_delayed_ref_head
*head_ref
,
817 TP_ARGS(ref
, head_ref
, action
)
820 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head
, run_delayed_ref_head
,
822 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
823 struct btrfs_delayed_ref_head
*head_ref
,
826 TP_ARGS(ref
, head_ref
, action
)
830 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head
,
832 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
833 struct btrfs_delayed_ref_head
*head_ref
,
836 TP_ARGS(ref
, head_ref
, action
),
839 ctf_integer(u64
, bytenr
, ref
->bytenr
)
840 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
841 ctf_integer(int, action
, action
)
842 ctf_integer(int, is_data
, head_ref
->is_data
)
847 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
849 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk
,
851 TP_PROTO(const struct btrfs_fs_info
*fs_info
, const struct map_lookup
*map
,
852 u64 offset
, u64 size
),
854 TP_ARGS(fs_info
, map
, offset
, size
),
857 ctf_integer(int, num_stripes
, map
->num_stripes
)
858 ctf_integer(u64
, type
, map
->type
)
859 ctf_integer(int, sub_stripes
, map
->sub_stripes
)
860 ctf_integer(u64
, offset
, offset
)
861 ctf_integer(u64
, size
, size
)
862 ctf_integer(u64
, root_objectid
, fs_info
->chunk_root
->root_key
.objectid
)
866 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_alloc
,
868 TP_PROTO(const struct btrfs_fs_info
*info
, const struct map_lookup
*map
,
869 u64 offset
, u64 size
),
871 TP_ARGS(info
, map
, offset
, size
)
874 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_free
,
876 TP_PROTO(const struct btrfs_fs_info
*info
, const struct map_lookup
*map
,
877 u64 offset
, u64 size
),
879 TP_ARGS(info
, map
, offset
, size
)
882 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
884 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk
,
886 TP_PROTO(struct btrfs_fs_info
*fs_info
, struct map_lookup
*map
,
887 u64 offset
, u64 size
),
889 TP_ARGS(fs_info
, map
, offset
, size
),
892 ctf_integer(int, num_stripes
, map
->num_stripes
)
893 ctf_integer(u64
, type
, map
->type
)
894 ctf_integer(int, sub_stripes
, map
->sub_stripes
)
895 ctf_integer(u64
, offset
, offset
)
896 ctf_integer(u64
, size
, size
)
897 ctf_integer(u64
, root_objectid
, fs_info
->chunk_root
->root_key
.objectid
)
901 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_alloc
,
903 TP_PROTO(struct btrfs_fs_info
*info
, struct map_lookup
*map
,
904 u64 offset
, u64 size
),
906 TP_ARGS(info
, map
, offset
, size
)
909 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_free
,
911 TP_PROTO(struct btrfs_fs_info
*info
, struct map_lookup
*map
,
912 u64 offset
, u64 size
),
914 TP_ARGS(info
, map
, offset
, size
)
917 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
919 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk
,
921 TP_PROTO(struct btrfs_root
*root
, struct map_lookup
*map
,
922 u64 offset
, u64 size
),
924 TP_ARGS(root
, map
, offset
, size
),
927 ctf_integer(int, num_stripes
, map
->num_stripes
)
928 ctf_integer(u64
, type
, map
->type
)
929 ctf_integer(int, sub_stripes
, map
->sub_stripes
)
930 ctf_integer(u64
, offset
, offset
)
931 ctf_integer(u64
, size
, size
)
932 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
936 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_alloc
,
938 TP_PROTO(struct btrfs_root
*root
, struct map_lookup
*map
,
939 u64 offset
, u64 size
),
941 TP_ARGS(root
, map
, offset
, size
)
944 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_free
,
946 TP_PROTO(struct btrfs_root
*root
, struct map_lookup
*map
,
947 u64 offset
, u64 size
),
949 TP_ARGS(root
, map
, offset
, size
)
952 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
954 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
955 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block
,
957 TP_PROTO(const struct btrfs_root
*root
, const struct extent_buffer
*buf
,
958 const struct extent_buffer
*cow
),
960 TP_ARGS(root
, buf
, cow
),
963 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
964 ctf_integer(u64
, buf_start
, buf
->start
)
965 ctf_integer(int, refs
, atomic_read(&buf
->refs
))
966 ctf_integer(u64
, cow_start
, cow
->start
)
967 ctf_integer(int, buf_level
, btrfs_header_level(buf
))
968 ctf_integer(int, cow_level
, btrfs_header_level(cow
))
972 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block
,
974 TP_PROTO(struct btrfs_root
*root
, struct extent_buffer
*buf
,
975 struct extent_buffer
*cow
),
977 TP_ARGS(root
, buf
, cow
),
980 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
981 ctf_integer(u64
, buf_start
, buf
->start
)
982 ctf_integer(int, refs
, atomic_read(&buf
->refs
))
983 ctf_integer(u64
, cow_start
, cow
->start
)
984 ctf_integer(int, buf_level
, btrfs_header_level(buf
))
985 ctf_integer(int, cow_level
, btrfs_header_level(cow
))
990 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
991 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation
,
993 TP_PROTO(const struct btrfs_fs_info
*fs_info
, char *type
, u64 val
,
994 u64 bytes
, int reserve
),
996 TP_ARGS(fs_info
, type
, val
, bytes
, reserve
),
999 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
1000 ctf_string(type
, type
)
1001 ctf_integer(u64
, val
, val
)
1002 ctf_integer(u64
, bytes
, bytes
)
1003 ctf_integer(int, reserve
, reserve
)
1006 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1007 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation
,
1009 TP_PROTO(struct btrfs_fs_info
*fs_info
, char *type
, u64 val
,
1010 u64 bytes
, int reserve
),
1012 TP_ARGS(fs_info
, type
, val
, bytes
, reserve
),
1015 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
1016 ctf_string(type
, type
)
1017 ctf_integer(u64
, val
, val
)
1018 ctf_integer(u64
, bytes
, bytes
)
1019 ctf_integer(int, reserve
, reserve
)
1024 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1026 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent
,
1028 TP_PROTO(const struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1030 TP_ARGS(info
, start
, len
),
1033 ctf_integer(u64
, start
, start
)
1034 ctf_integer(u64
, len
, len
)
1038 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_alloc
,
1040 TP_PROTO(const struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1042 TP_ARGS(info
, start
, len
)
1045 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_free
,
1047 TP_PROTO(const struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1049 TP_ARGS(info
, start
, len
)
1052 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1054 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent
,
1056 TP_PROTO(struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1058 TP_ARGS(info
, start
, len
),
1061 ctf_integer(u64
, start
, start
)
1062 ctf_integer(u64
, len
, len
)
1066 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_alloc
,
1068 TP_PROTO(struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1070 TP_ARGS(info
, start
, len
)
1073 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_free
,
1075 TP_PROTO(struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1077 TP_ARGS(info
, start
, len
)
1080 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1082 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent
,
1084 TP_PROTO(struct btrfs_root
*root
, u64 start
, u64 len
),
1086 TP_ARGS(root
, start
, len
),
1089 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1090 ctf_integer(u64
, start
, start
)
1091 ctf_integer(u64
, len
, len
)
1095 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_alloc
,
1097 TP_PROTO(struct btrfs_root
*root
, u64 start
, u64 len
),
1099 TP_ARGS(root
, start
, len
)
1102 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_free
,
1104 TP_PROTO(struct btrfs_root
*root
, u64 start
, u64 len
),
1106 TP_ARGS(root
, start
, len
)
1109 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1111 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1113 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent
,
1115 btrfs_find_free_extent
,
1117 TP_PROTO(const struct btrfs_fs_info
*info
, u64 num_bytes
, u64 empty_size
,
1120 TP_ARGS(info
, num_bytes
, empty_size
, data
),
1123 ctf_integer(u64
, num_bytes
, num_bytes
)
1124 ctf_integer(u64
, empty_size
, empty_size
)
1125 ctf_integer(u64
, data
, data
)
1129 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent
,
1131 TP_PROTO(const struct btrfs_fs_info
*info
,
1132 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1135 TP_ARGS(info
, block_group
, start
, len
),
1138 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1139 ctf_integer(u64
, flags
, block_group
->flags
)
1140 ctf_integer(u64
, start
, start
)
1141 ctf_integer(u64
, len
, len
)
1145 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent
,
1147 TP_PROTO(const struct btrfs_fs_info
*info
,
1148 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1151 TP_ARGS(info
, block_group
, start
, len
)
1154 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent_cluster
,
1156 TP_PROTO(const struct btrfs_fs_info
*info
,
1157 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1160 TP_ARGS(info
, block_group
, start
, len
)
1163 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1165 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent
,
1167 btrfs_find_free_extent
,
1169 TP_PROTO(struct btrfs_fs_info
*info
, u64 num_bytes
, u64 empty_size
,
1172 TP_ARGS(info
, num_bytes
, empty_size
, data
),
1175 ctf_integer(u64
, num_bytes
, num_bytes
)
1176 ctf_integer(u64
, empty_size
, empty_size
)
1177 ctf_integer(u64
, data
, data
)
1181 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent
,
1183 TP_PROTO(struct btrfs_fs_info
*info
,
1184 struct btrfs_block_group_cache
*block_group
, u64 start
,
1187 TP_ARGS(info
, block_group
, start
, len
),
1190 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1191 ctf_integer(u64
, flags
, block_group
->flags
)
1192 ctf_integer(u64
, start
, start
)
1193 ctf_integer(u64
, len
, len
)
1197 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent
,
1199 TP_PROTO(struct btrfs_fs_info
*info
,
1200 struct btrfs_block_group_cache
*block_group
, u64 start
,
1203 TP_ARGS(info
, block_group
, start
, len
)
1206 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent_cluster
,
1208 TP_PROTO(struct btrfs_fs_info
*info
,
1209 struct btrfs_block_group_cache
*block_group
, u64 start
,
1212 TP_ARGS(info
, block_group
, start
, len
)
1215 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1217 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent
,
1219 btrfs_find_free_extent
,
1221 TP_PROTO(struct btrfs_root
*root
, u64 num_bytes
, u64 empty_size
,
1224 TP_ARGS(root
, num_bytes
, empty_size
, data
),
1227 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1228 ctf_integer(u64
, num_bytes
, num_bytes
)
1229 ctf_integer(u64
, empty_size
, empty_size
)
1230 ctf_integer(u64
, data
, data
)
1234 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent
,
1236 TP_PROTO(struct btrfs_root
*root
,
1237 struct btrfs_block_group_cache
*block_group
, u64 start
,
1240 TP_ARGS(root
, block_group
, start
, len
),
1243 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1244 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1245 ctf_integer(u64
, flags
, block_group
->flags
)
1246 ctf_integer(u64
, start
, start
)
1247 ctf_integer(u64
, len
, len
)
1251 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent
,
1253 TP_PROTO(struct btrfs_root
*root
,
1254 struct btrfs_block_group_cache
*block_group
, u64 start
,
1257 TP_ARGS(root
, block_group
, start
, len
)
1260 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent_cluster
,
1262 TP_PROTO(struct btrfs_root
*root
,
1263 struct btrfs_block_group_cache
*block_group
, u64 start
,
1266 TP_ARGS(root
, block_group
, start
, len
)
1269 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1271 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1272 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster
,
1274 TP_PROTO(const struct btrfs_block_group_cache
*block_group
, u64 start
,
1275 u64 bytes
, u64 empty_size
, u64 min_bytes
),
1277 TP_ARGS(block_group
, start
, bytes
, empty_size
, min_bytes
),
1280 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1281 ctf_integer(u64
, flags
, block_group
->flags
)
1282 ctf_integer(u64
, start
, start
)
1283 ctf_integer(u64
, bytes
, bytes
)
1284 ctf_integer(u64
, empty_size
, empty_size
)
1285 ctf_integer(u64
, min_bytes
, min_bytes
)
1289 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup
,
1291 TP_PROTO(const struct btrfs_block_group_cache
*block_group
),
1293 TP_ARGS(block_group
),
1296 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1300 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster
,
1302 TP_PROTO(const struct btrfs_block_group_cache
*block_group
,
1303 const struct btrfs_free_cluster
*cluster
, u64 size
, int bitmap
),
1305 TP_ARGS(block_group
, cluster
, size
, bitmap
),
1308 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1309 ctf_integer(u64
, flags
, block_group
->flags
)
1310 ctf_integer(u64
, start
, cluster
->window_start
)
1311 ctf_integer(u64
, max_size
, cluster
->max_size
)
1312 ctf_integer(u64
, size
, size
)
1313 ctf_integer(int, bitmap
, bitmap
)
1316 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1317 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster
,
1319 TP_PROTO(struct btrfs_block_group_cache
*block_group
, u64 start
,
1320 u64 bytes
, u64 empty_size
, u64 min_bytes
),
1322 TP_ARGS(block_group
, start
, bytes
, empty_size
, min_bytes
),
1325 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1326 ctf_integer(u64
, flags
, block_group
->flags
)
1327 ctf_integer(u64
, start
, start
)
1328 ctf_integer(u64
, bytes
, bytes
)
1329 ctf_integer(u64
, empty_size
, empty_size
)
1330 ctf_integer(u64
, min_bytes
, min_bytes
)
1334 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup
,
1336 TP_PROTO(struct btrfs_block_group_cache
*block_group
),
1338 TP_ARGS(block_group
),
1341 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1345 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster
,
1347 TP_PROTO(struct btrfs_block_group_cache
*block_group
,
1348 struct btrfs_free_cluster
*cluster
, u64 size
, int bitmap
),
1350 TP_ARGS(block_group
, cluster
, size
, bitmap
),
1353 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1354 ctf_integer(u64
, flags
, block_group
->flags
)
1355 ctf_integer(u64
, start
, cluster
->window_start
)
1356 ctf_integer(u64
, max_size
, cluster
->max_size
)
1357 ctf_integer(u64
, size
, size
)
1358 ctf_integer(int, bitmap
, bitmap
)
1363 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1364 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state
,
1366 btrfs_alloc_extent_state
,
1368 TP_PROTO(const struct extent_state
*state
, gfp_t mask
, unsigned long IP
),
1370 TP_ARGS(state
, mask
, IP
),
1373 ctf_integer_hex(const struct extent_state
*, state
, state
)
1374 ctf_integer(gfp_t
, mask
, mask
)
1375 ctf_integer(unsigned long, ip
, IP
)
1379 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state
,
1381 btrfs_free_extent_state
,
1383 TP_PROTO(const struct extent_state
*state
, unsigned long IP
),
1388 ctf_integer_hex(const struct extent_state
*, state
, state
)
1389 ctf_integer(unsigned long, ip
, IP
)
1392 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
1393 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state
,
1395 btrfs_alloc_extent_state
,
1397 TP_PROTO(struct extent_state
*state
, gfp_t mask
, unsigned long IP
),
1399 TP_ARGS(state
, mask
, IP
),
1402 ctf_integer_hex(struct extent_state
*, state
, state
)
1403 ctf_integer(gfp_t
, mask
, mask
)
1404 ctf_integer(unsigned long, ip
, IP
)
1408 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state
,
1410 btrfs_free_extent_state
,
1412 TP_PROTO(struct extent_state
*state
, unsigned long IP
),
1417 ctf_integer_hex(struct extent_state
*, state
, state
)
1418 ctf_integer(unsigned long, ip
, IP
)
1423 #endif /* LTTNG_TRACE_BTRFS_H */
1425 /* This part must be outside protection */
1426 #include <probes/define_trace.h>