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_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
37 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit
,
39 TP_PROTO(const struct btrfs_root
*root
),
44 ctf_integer(u64
, generation
, root
->fs_info
->generation
)
45 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
49 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode
,
51 TP_PROTO(const struct inode
*inode
),
56 ctf_integer(ino_t
, ino
, inode
->i_ino
)
57 ctf_integer(blkcnt_t
, blocks
, inode
->i_blocks
)
58 ctf_integer(u64
, disk_i_size
, BTRFS_I(inode
)->disk_i_size
)
59 ctf_integer(u64
, generation
, BTRFS_I(inode
)->generation
)
60 ctf_integer(u64
, last_trans
, BTRFS_I(inode
)->last_trans
)
61 ctf_integer(u64
, logged_trans
, BTRFS_I(inode
)->logged_trans
)
62 ctf_integer(u64
, root_objectid
,
63 BTRFS_I(inode
)->root
->root_key
.objectid
)
67 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_new
,
69 TP_PROTO(const struct inode
*inode
),
74 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_request
,
76 TP_PROTO(const struct inode
*inode
),
81 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_evict
,
83 TP_PROTO(const struct inode
*inode
),
88 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit
,
90 TP_PROTO(struct btrfs_root
*root
),
95 ctf_integer(u64
, generation
, root
->fs_info
->generation
)
96 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
100 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode
,
102 TP_PROTO(struct inode
*inode
),
107 ctf_integer(ino_t
, ino
, inode
->i_ino
)
108 ctf_integer(blkcnt_t
, blocks
, inode
->i_blocks
)
109 ctf_integer(u64
, disk_i_size
, BTRFS_I(inode
)->disk_i_size
)
110 ctf_integer(u64
, generation
, BTRFS_I(inode
)->generation
)
111 ctf_integer(u64
, last_trans
, BTRFS_I(inode
)->last_trans
)
112 ctf_integer(u64
, logged_trans
, BTRFS_I(inode
)->logged_trans
)
113 ctf_integer(u64
, root_objectid
,
114 BTRFS_I(inode
)->root
->root_key
.objectid
)
118 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_new
,
120 TP_PROTO(struct inode
*inode
),
125 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_request
,
127 TP_PROTO(struct inode
*inode
),
132 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode
, btrfs_inode_evict
,
134 TP_PROTO(struct inode
*inode
),
140 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
142 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
144 TP_PROTO(const struct btrfs_root
*root
, const struct btrfs_inode
*inode
,
145 const struct extent_map
*map
),
147 TP_ARGS(root
, inode
, map
),
150 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
151 ctf_integer(u64
, ino
, btrfs_ino(inode
))
152 ctf_integer(u64
, start
, map
->start
)
153 ctf_integer(u64
, len
, map
->len
)
154 ctf_integer(u64
, orig_start
, map
->orig_start
)
155 ctf_integer(u64
, block_start
, map
->block_start
)
156 ctf_integer(u64
, block_len
, map
->block_len
)
157 ctf_integer(unsigned long, flags
, map
->flags
)
158 ctf_integer(int, refs
, refcount_read(&map
->refs
))
159 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
163 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
165 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
167 TP_PROTO(struct btrfs_root
*root
, struct btrfs_inode
*inode
,
168 struct extent_map
*map
),
170 TP_ARGS(root
, inode
, map
),
173 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
174 ctf_integer(u64
, ino
, btrfs_ino(inode
))
175 ctf_integer(u64
, start
, map
->start
)
176 ctf_integer(u64
, len
, map
->len
)
177 ctf_integer(u64
, orig_start
, map
->orig_start
)
178 ctf_integer(u64
, block_start
, map
->block_start
)
179 ctf_integer(u64
, block_len
, map
->block_len
)
180 ctf_integer(unsigned long, flags
, map
->flags
)
181 ctf_integer(int, refs
, refcount_read(&map
->refs
))
182 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
186 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
188 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
190 TP_PROTO(struct btrfs_root
*root
, struct btrfs_inode
*inode
,
191 struct extent_map
*map
),
193 TP_ARGS(root
, inode
, map
),
196 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
197 ctf_integer(u64
, ino
, btrfs_ino(inode
))
198 ctf_integer(u64
, start
, map
->start
)
199 ctf_integer(u64
, len
, map
->len
)
200 ctf_integer(u64
, orig_start
, map
->orig_start
)
201 ctf_integer(u64
, block_start
, map
->block_start
)
202 ctf_integer(u64
, block_len
, map
->block_len
)
203 ctf_integer(unsigned long, flags
, map
->flags
)
204 ctf_integer(int, refs
, atomic_read(&map
->refs
))
205 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
209 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
211 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
213 TP_PROTO(struct btrfs_root
*root
, struct inode
*inode
,
214 struct extent_map
*map
),
216 TP_ARGS(root
, inode
, map
),
219 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
220 ctf_integer(u64
, ino
, btrfs_ino(inode
))
221 ctf_integer(u64
, start
, map
->start
)
222 ctf_integer(u64
, len
, map
->len
)
223 ctf_integer(u64
, orig_start
, map
->orig_start
)
224 ctf_integer(u64
, block_start
, map
->block_start
)
225 ctf_integer(u64
, block_len
, map
->block_len
)
226 ctf_integer(unsigned long, flags
, map
->flags
)
227 ctf_integer(int, refs
, atomic_read(&map
->refs
))
228 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
232 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
234 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
236 TP_PROTO(const struct btrfs_root
*root
, const struct extent_map
*map
),
241 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
242 ctf_integer(u64
, start
, map
->start
)
243 ctf_integer(u64
, len
, map
->len
)
244 ctf_integer(u64
, orig_start
, map
->orig_start
)
245 ctf_integer(u64
, block_start
, map
->block_start
)
246 ctf_integer(u64
, block_len
, map
->block_len
)
247 ctf_integer(unsigned long, flags
, map
->flags
)
248 ctf_integer(int, refs
, atomic_read(&map
->refs
))
249 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
253 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
255 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent
,
257 TP_PROTO(struct btrfs_root
*root
, struct extent_map
*map
),
262 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
263 ctf_integer(u64
, start
, map
->start
)
264 ctf_integer(u64
, len
, map
->len
)
265 ctf_integer(u64
, orig_start
, map
->orig_start
)
266 ctf_integer(u64
, block_start
, map
->block_start
)
267 ctf_integer(u64
, block_len
, map
->block_len
)
268 ctf_integer(unsigned long, flags
, map
->flags
)
269 ctf_integer(int, refs
, atomic_read(&map
->refs
))
270 ctf_integer(unsigned int, compress_type
, map
->compress_type
)
274 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
276 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
277 LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist
,
279 TP_PROTO(const struct extent_map
*existing
, const struct extent_map
*map
, u64 start
, u64 len
),
281 TP_ARGS(existing
, map
, start
, len
),
284 ctf_integer(u64
, e_start
, existing
->start
)
285 ctf_integer(u64
, e_len
, existing
->len
)
286 ctf_integer(u64
, map_start
, map
->start
)
287 ctf_integer(u64
, map_len
, map
->len
)
288 ctf_integer(u64
, start
, start
)
289 ctf_integer(u64
, len
, len
)
294 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
295 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__file_extent_item_regular
,
297 TP_PROTO(struct btrfs_inode
*bi
, struct extent_buffer
*l
,
298 struct btrfs_file_extent_item
*fi
, u64 start
),
300 TP_ARGS(bi
, l
, fi
, start
),
303 ctf_array(u8
, fsid
, bi
->root
->fs_info
, BTRFS_FSID_SIZE
)
304 ctf_integer(u64
, root_obj
, bi
->root
->objectid
)
305 ctf_integer(u64
, ino
, btrfs_ino(bi
))
306 ctf_integer(loff_t
, isize
, bi
->vfs_inode
.i_size
)
307 ctf_integer(u64
, disk_isize
, bi
->disk_i_size
)
308 ctf_integer(u64
, num_bytes
, btrfs_file_extent_num_bytes(l
, fi
))
309 ctf_integer(u64
, ram_bytes
, btrfs_file_extent_ram_bytes(l
, fi
))
310 ctf_integer(u64
, disk_bytenr
, btrfs_file_extent_disk_bytenr(l
, fi
))
311 ctf_integer(u64
, disk_num_bytes
, btrfs_file_extent_disk_num_bytes(l
, fi
))
312 ctf_integer(u64
, extent_offset
, btrfs_file_extent_offset(l
, fi
))
313 ctf_integer(u8
, extent_type
, btrfs_file_extent_type(l
, fi
))
314 ctf_integer(u8
, compression
, btrfs_file_extent_compression(l
, fi
))
315 ctf_integer(u64
, extent_start
, start
)
316 ctf_integer(u64
, extent_end
, (start
+ btrfs_file_extent_num_bytes(l
, fi
)))
320 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__file_extent_item_inline
,
322 TP_PROTO(struct btrfs_inode
*bi
, struct extent_buffer
*l
,
323 struct btrfs_file_extent_item
*fi
, int slot
, u64 start
),
325 TP_ARGS(bi
, l
, fi
, slot
, start
),
328 ctf_array(u8
, fsid
, bi
->root
->fs_info
, BTRFS_FSID_SIZE
)
329 ctf_integer(u64
, root_obj
, bi
->root
->objectid
)
330 ctf_integer(u64
, ino
, btrfs_ino(bi
))
331 ctf_integer(loff_t
, isize
, bi
->vfs_inode
.i_size
)
332 ctf_integer(u64
, disk_isize
, bi
->disk_i_size
)
333 ctf_integer(u8
, extent_type
, btrfs_file_extent_type(l
, fi
))
334 ctf_integer(u8
, compression
, btrfs_file_extent_compression(l
, fi
))
335 ctf_integer(u64
, extent_start
, start
)
336 ctf_integer(u64
, extent_end
, (start
+ btrfs_file_extent_inline_len(l
, slot
, fi
)))
340 LTTNG_TRACEPOINT_EVENT_INSTANCE(
341 btrfs__file_extent_item_regular
, btrfs_get_extent_show_fi_regular
,
343 TP_PROTO(struct btrfs_inode
*bi
, struct extent_buffer
*l
,
344 struct btrfs_file_extent_item
*fi
, u64 start
),
346 TP_ARGS(bi
, l
, fi
, start
)
349 LTTNG_TRACEPOINT_EVENT_INSTANCE(
350 btrfs__file_extent_item_regular
, btrfs_truncate_show_fi_regular
,
352 TP_PROTO(struct btrfs_inode
*bi
, struct extent_buffer
*l
,
353 struct btrfs_file_extent_item
*fi
, u64 start
),
355 TP_ARGS(bi
, l
, fi
, start
)
358 LTTNG_TRACEPOINT_EVENT_INSTANCE(
359 btrfs__file_extent_item_inline
, btrfs_get_extent_show_fi_inline
,
361 TP_PROTO(struct btrfs_inode
*bi
, struct extent_buffer
*l
,
362 struct btrfs_file_extent_item
*fi
, int slot
, u64 start
),
364 TP_ARGS(bi
, l
, fi
, slot
, start
)
367 LTTNG_TRACEPOINT_EVENT_INSTANCE(
368 btrfs__file_extent_item_inline
, btrfs_truncate_show_fi_inline
,
370 TP_PROTO(struct btrfs_inode
*bi
, struct extent_buffer
*l
,
371 struct btrfs_file_extent_item
*fi
, int slot
, u64 start
),
373 TP_ARGS(bi
, l
, fi
, slot
, start
)
377 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
378 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent
,
380 TP_PROTO(const struct inode
*inode
,
381 const struct btrfs_ordered_extent
*ordered
),
383 TP_ARGS(inode
, ordered
),
386 ctf_integer(ino_t
, ino
, inode
->i_ino
)
387 ctf_integer(u64
, file_offset
, ordered
->file_offset
)
388 ctf_integer(u64
, start
, ordered
->start
)
389 ctf_integer(u64
, len
, ordered
->len
)
390 ctf_integer(u64
, disk_len
, ordered
->disk_len
)
391 ctf_integer(u64
, bytes_left
, ordered
->bytes_left
)
392 ctf_integer(unsigned long, flags
, ordered
->flags
)
393 ctf_integer(int, compress_type
, ordered
->compress_type
)
394 ctf_integer(int, refs
, refcount_read(&ordered
->refs
))
395 ctf_integer(u64
, root_objectid
,
396 BTRFS_I(inode
)->root
->root_key
.objectid
)
399 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
400 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent
,
402 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
404 TP_ARGS(inode
, ordered
),
407 ctf_integer(ino_t
, ino
, inode
->i_ino
)
408 ctf_integer(u64
, file_offset
, ordered
->file_offset
)
409 ctf_integer(u64
, start
, ordered
->start
)
410 ctf_integer(u64
, len
, ordered
->len
)
411 ctf_integer(u64
, disk_len
, ordered
->disk_len
)
412 ctf_integer(u64
, bytes_left
, ordered
->bytes_left
)
413 ctf_integer(unsigned long, flags
, ordered
->flags
)
414 ctf_integer(int, compress_type
, ordered
->compress_type
)
415 ctf_integer(int, refs
, refcount_read(&ordered
->refs
))
416 ctf_integer(u64
, root_objectid
,
417 BTRFS_I(inode
)->root
->root_key
.objectid
)
420 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
421 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent
,
423 TP_PROTO(const struct inode
*inode
, const struct btrfs_ordered_extent
*ordered
),
425 TP_ARGS(inode
, ordered
),
428 ctf_integer(ino_t
, ino
, inode
->i_ino
)
429 ctf_integer(u64
, file_offset
, ordered
->file_offset
)
430 ctf_integer(u64
, start
, ordered
->start
)
431 ctf_integer(u64
, len
, ordered
->len
)
432 ctf_integer(u64
, disk_len
, ordered
->disk_len
)
433 ctf_integer(u64
, bytes_left
, ordered
->bytes_left
)
434 ctf_integer(unsigned long, flags
, ordered
->flags
)
435 ctf_integer(int, compress_type
, ordered
->compress_type
)
436 ctf_integer(int, refs
, atomic_read(&ordered
->refs
))
437 ctf_integer(u64
, root_objectid
,
438 BTRFS_I(inode
)->root
->root_key
.objectid
)
442 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent
,
444 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
446 TP_ARGS(inode
, ordered
),
449 ctf_integer(ino_t
, ino
, inode
->i_ino
)
450 ctf_integer(u64
, file_offset
, ordered
->file_offset
)
451 ctf_integer(u64
, start
, ordered
->start
)
452 ctf_integer(u64
, len
, ordered
->len
)
453 ctf_integer(u64
, disk_len
, ordered
->disk_len
)
454 ctf_integer(u64
, bytes_left
, ordered
->bytes_left
)
455 ctf_integer(unsigned long, flags
, ordered
->flags
)
456 ctf_integer(int, compress_type
, ordered
->compress_type
)
457 ctf_integer(int, refs
, atomic_read(&ordered
->refs
))
458 ctf_integer(u64
, root_objectid
,
459 BTRFS_I(inode
)->root
->root_key
.objectid
)
464 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
465 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
466 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_add
,
468 TP_PROTO(const struct inode
*inode
,
469 const struct btrfs_ordered_extent
*ordered
),
471 TP_ARGS(inode
, ordered
)
474 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_remove
,
476 TP_PROTO(const struct inode
*inode
,
477 const struct btrfs_ordered_extent
*ordered
),
479 TP_ARGS(inode
, ordered
)
482 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_start
,
484 TP_PROTO(const struct inode
*inode
,
485 const struct btrfs_ordered_extent
*ordered
),
487 TP_ARGS(inode
, ordered
)
490 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_put
,
492 TP_PROTO(const struct inode
*inode
,
493 const struct btrfs_ordered_extent
*ordered
),
495 TP_ARGS(inode
, ordered
)
498 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage
,
500 TP_PROTO(const struct page
*page
, const struct inode
*inode
,
501 const struct writeback_control
*wbc
),
503 TP_ARGS(page
, inode
, wbc
),
506 ctf_integer(ino_t
, ino
, inode
->i_ino
)
507 ctf_integer(pgoff_t
, index
, page
->index
)
508 ctf_integer(long, nr_to_write
, wbc
->nr_to_write
)
509 ctf_integer(long, pages_skipped
, wbc
->pages_skipped
)
510 ctf_integer(loff_t
, range_start
, wbc
->range_start
)
511 ctf_integer(loff_t
, range_end
, wbc
->range_end
)
512 ctf_integer(char, for_kupdate
, wbc
->for_kupdate
)
513 ctf_integer(char, for_reclaim
, wbc
->for_reclaim
)
514 ctf_integer(char, range_cyclic
, wbc
->range_cyclic
)
515 ctf_integer(pgoff_t
, writeback_index
,
516 inode
->i_mapping
->writeback_index
)
517 ctf_integer(u64
, root_objectid
,
518 BTRFS_I(inode
)->root
->root_key
.objectid
)
522 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage
,
526 btrfs__extent_writepage
,
528 TP_PROTO(const struct page
*page
, const struct inode
*inode
,
529 const struct writeback_control
*wbc
),
531 TP_ARGS(page
, inode
, wbc
)
534 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook
,
536 TP_PROTO(const struct page
*page
, u64 start
, u64 end
, int uptodate
),
538 TP_ARGS(page
, start
, end
, uptodate
),
541 ctf_integer(ino_t
, ino
, page
->mapping
->host
->i_ino
)
542 ctf_integer(pgoff_t
, index
, page
->index
)
543 ctf_integer(u64
, start
, start
)
544 ctf_integer(u64
, end
, end
)
545 ctf_integer(int, uptodate
, uptodate
)
546 ctf_integer(u64
, root_objectid
,
547 BTRFS_I(page
->mapping
->host
)->root
->root_key
.objectid
)
551 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file
,
553 TP_PROTO(const struct file
*file
, int datasync
),
555 TP_ARGS(file
, datasync
),
558 ctf_integer(ino_t
, ino
, file
->f_path
.dentry
->d_inode
->i_ino
)
559 ctf_integer(ino_t
, parent
, file
->f_path
.dentry
->d_parent
->d_inode
->i_ino
)
560 ctf_integer(int, datasync
, datasync
)
561 ctf_integer(u64
, root_objectid
,
562 BTRFS_I(file
->f_path
.dentry
->d_inode
)->root
->root_key
.objectid
)
566 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_add
,
568 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
570 TP_ARGS(inode
, ordered
)
573 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_remove
,
575 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
577 TP_ARGS(inode
, ordered
)
580 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_start
,
582 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
584 TP_ARGS(inode
, ordered
)
587 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent
, btrfs_ordered_extent_put
,
589 TP_PROTO(struct inode
*inode
, struct btrfs_ordered_extent
*ordered
),
591 TP_ARGS(inode
, ordered
)
594 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage
,
596 TP_PROTO(struct page
*page
, struct inode
*inode
,
597 struct writeback_control
*wbc
),
599 TP_ARGS(page
, inode
, wbc
),
602 ctf_integer(ino_t
, ino
, inode
->i_ino
)
603 ctf_integer(pgoff_t
, index
, page
->index
)
604 ctf_integer(long, nr_to_write
, wbc
->nr_to_write
)
605 ctf_integer(long, pages_skipped
, wbc
->pages_skipped
)
606 ctf_integer(loff_t
, range_start
, wbc
->range_start
)
607 ctf_integer(loff_t
, range_end
, wbc
->range_end
)
608 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
609 ctf_integer(char, nonblocking
, wbc
->nonblocking
)
611 ctf_integer(char, for_kupdate
, wbc
->for_kupdate
)
612 ctf_integer(char, for_reclaim
, wbc
->for_reclaim
)
613 ctf_integer(char, range_cyclic
, wbc
->range_cyclic
)
614 ctf_integer(pgoff_t
, writeback_index
,
615 inode
->i_mapping
->writeback_index
)
616 ctf_integer(u64
, root_objectid
,
617 BTRFS_I(inode
)->root
->root_key
.objectid
)
621 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage
,
625 btrfs__extent_writepage
,
627 TP_PROTO(struct page
*page
, struct inode
*inode
,
628 struct writeback_control
*wbc
),
630 TP_ARGS(page
, inode
, wbc
)
633 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook
,
635 TP_PROTO(struct page
*page
, u64 start
, u64 end
, int uptodate
),
637 TP_ARGS(page
, start
, end
, uptodate
),
640 ctf_integer(ino_t
, ino
, page
->mapping
->host
->i_ino
)
641 ctf_integer(pgoff_t
, index
, page
->index
)
642 ctf_integer(u64
, start
, start
)
643 ctf_integer(u64
, end
, end
)
644 ctf_integer(int, uptodate
, uptodate
)
645 ctf_integer(u64
, root_objectid
,
646 BTRFS_I(page
->mapping
->host
)->root
->root_key
.objectid
)
650 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file
,
652 TP_PROTO(struct file
*file
, int datasync
),
654 TP_ARGS(file
, datasync
),
657 ctf_integer(ino_t
, ino
, file
->f_path
.dentry
->d_inode
->i_ino
)
658 ctf_integer(ino_t
, parent
, file
->f_path
.dentry
->d_parent
->d_inode
->i_ino
)
659 ctf_integer(int, datasync
, datasync
)
660 ctf_integer(u64
, root_objectid
,
661 BTRFS_I(file
->f_path
.dentry
->d_inode
)->root
->root_key
.objectid
)
666 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
667 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,114,92,0,0))
668 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs
,
670 TP_PROTO(const struct btrfs_fs_info
*fs_info
, int wait
),
672 TP_ARGS(fs_info
, wait
),
675 ctf_integer(int, wait
, wait
)
678 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
679 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs
,
681 TP_PROTO(struct btrfs_fs_info
*fs_info
, int wait
),
683 TP_ARGS(fs_info
, wait
),
686 ctf_integer(int, wait
, wait
)
690 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs
,
697 ctf_integer(int, wait
, wait
)
702 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
703 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
704 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group
,
706 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
707 const struct btrfs_block_group_cache
*block_group
, int create
),
709 TP_ARGS(fs_info
, block_group
, create
),
712 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
713 ctf_integer(u64
, offset
, block_group
->key
.objectid
)
714 ctf_integer(u64
, size
, block_group
->key
.offset
)
715 ctf_integer(u64
, flags
, block_group
->flags
)
716 ctf_integer(u64
, bytes_used
, btrfs_block_group_used(&block_group
->item
))
717 ctf_integer(u64
, bytes_super
, block_group
->bytes_super
)
718 ctf_integer(int, create
, create
)
722 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group
,
724 TP_PROTO(struct btrfs_fs_info
*fs_info
,
725 struct btrfs_block_group_cache
*block_group
, int create
),
727 TP_ARGS(fs_info
, block_group
, create
),
730 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
731 ctf_integer(u64
, offset
, block_group
->key
.objectid
)
732 ctf_integer(u64
, size
, block_group
->key
.offset
)
733 ctf_integer(u64
, flags
, block_group
->flags
)
734 ctf_integer(u64
, bytes_used
, btrfs_block_group_used(&block_group
->item
))
735 ctf_integer(u64
, bytes_super
, block_group
->bytes_super
)
736 ctf_integer(int, create
, create
)
741 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
742 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref
,
744 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
745 const struct btrfs_delayed_ref_node
*ref
,
746 const struct btrfs_delayed_tree_ref
*full_ref
,
749 TP_ARGS(fs_info
, ref
, full_ref
, action
),
752 ctf_integer(u64
, bytenr
, ref
->bytenr
)
753 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
754 ctf_integer(int, action
, action
)
755 ctf_integer(u64
, parent
, full_ref
->parent
)
756 ctf_integer(u64
, ref_root
, full_ref
->root
)
757 ctf_integer(int, level
, full_ref
->level
)
758 ctf_integer(int, type
, ref
->type
)
759 ctf_integer(u64
, seq
, ref
->seq
)
762 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
763 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref
,
765 TP_PROTO(struct btrfs_fs_info
*fs_info
,
766 struct btrfs_delayed_ref_node
*ref
,
767 struct btrfs_delayed_tree_ref
*full_ref
,
770 TP_ARGS(fs_info
, ref
, full_ref
, action
),
773 ctf_integer(u64
, bytenr
, ref
->bytenr
)
774 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
775 ctf_integer(int, action
, action
)
776 ctf_integer(u64
, parent
, full_ref
->parent
)
777 ctf_integer(u64
, ref_root
, full_ref
->root
)
778 ctf_integer(int, level
, full_ref
->level
)
779 ctf_integer(int, type
, ref
->type
)
780 ctf_integer(u64
, seq
, ref
->seq
)
784 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref
,
786 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
787 struct btrfs_delayed_tree_ref
*full_ref
,
790 TP_ARGS(ref
, full_ref
, action
),
793 ctf_integer(u64
, bytenr
, ref
->bytenr
)
794 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
795 ctf_integer(int, action
, action
)
796 ctf_integer(u64
, parent
, full_ref
->parent
)
797 ctf_integer(u64
, ref_root
, full_ref
->root
)
798 ctf_integer(int, level
, full_ref
->level
)
799 ctf_integer(int, type
, ref
->type
)
800 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
801 ctf_integer(u64
, seq
, ref
->seq
)
807 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref
,
809 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
810 struct btrfs_delayed_data_ref
*full_ref
,
813 TP_ARGS(ref
, full_ref
, action
),
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(u64
, owner
, full_ref
->objectid
)
822 ctf_integer(u64
, offset
, full_ref
->offset
)
823 ctf_integer(int, type
, ref
->type
)
824 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
825 ctf_integer(u64
, seq
, ref
->seq
)
830 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
831 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
833 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
834 const struct btrfs_delayed_ref_head
*head_ref
,
837 TP_ARGS(fs_info
, head_ref
, action
),
840 ctf_integer(u64
, bytenr
, head_ref
->bytenr
)
841 ctf_integer(u64
, num_bytes
, head_ref
->num_bytes
)
842 ctf_integer(int, action
, action
)
843 ctf_integer(int, is_data
, head_ref
->is_data
)
847 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
849 add_delayed_ref_head
,
851 btrfs_add_delayed_ref_head
,
853 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
854 const struct btrfs_delayed_ref_head
*head_ref
,
857 TP_ARGS(fs_info
, head_ref
, action
)
860 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
862 run_delayed_ref_head
,
864 btrfs_run_delayed_ref_head
,
866 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
867 const struct btrfs_delayed_ref_head
*head_ref
,
870 TP_ARGS(fs_info
, head_ref
, action
)
873 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
874 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,114,92,0,0))
875 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
877 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
878 const struct btrfs_delayed_ref_node
*ref
,
879 const struct btrfs_delayed_ref_head
*head_ref
,
882 TP_ARGS(fs_info
, ref
, head_ref
, action
),
885 ctf_integer(u64
, bytenr
, ref
->bytenr
)
886 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
887 ctf_integer(int, action
, action
)
888 ctf_integer(int, is_data
, head_ref
->is_data
)
892 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
894 add_delayed_ref_head
,
896 btrfs_add_delayed_ref_head
,
898 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
899 const struct btrfs_delayed_ref_node
*ref
,
900 const struct btrfs_delayed_ref_head
*head_ref
,
903 TP_ARGS(fs_info
, ref
, head_ref
, action
)
906 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
908 run_delayed_ref_head
,
910 btrfs_run_delayed_ref_head
,
912 TP_PROTO(const struct btrfs_fs_info
*fs_info
,
913 const struct btrfs_delayed_ref_node
*ref
,
914 const struct btrfs_delayed_ref_head
*head_ref
,
917 TP_ARGS(fs_info
, ref
, head_ref
, action
)
920 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
921 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
923 TP_PROTO(struct btrfs_fs_info
*fs_info
,
924 struct btrfs_delayed_ref_node
*ref
,
925 struct btrfs_delayed_ref_head
*head_ref
,
928 TP_ARGS(fs_info
, ref
, head_ref
, action
),
931 ctf_integer(u64
, bytenr
, ref
->bytenr
)
932 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
933 ctf_integer(int, action
, action
)
934 ctf_integer(int, is_data
, head_ref
->is_data
)
938 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
940 add_delayed_ref_head
,
942 btrfs_add_delayed_ref_head
,
944 TP_PROTO(struct btrfs_fs_info
*fs_info
,
945 struct btrfs_delayed_ref_node
*ref
,
946 struct btrfs_delayed_ref_head
*head_ref
,
949 TP_ARGS(fs_info
, ref
, head_ref
, action
)
952 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
954 run_delayed_ref_head
,
956 btrfs_run_delayed_ref_head
,
958 TP_PROTO(struct btrfs_fs_info
*fs_info
,
959 struct btrfs_delayed_ref_node
*ref
,
960 struct btrfs_delayed_ref_head
*head_ref
,
963 TP_ARGS(fs_info
, ref
, head_ref
, action
)
966 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,114,92,0,0, 4,5,0,0,0,0))
967 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
969 TP_PROTO(const struct btrfs_delayed_ref_node
*ref
,
970 const struct btrfs_delayed_ref_head
*head_ref
,
973 TP_ARGS(ref
, head_ref
, action
),
976 ctf_integer(u64
, bytenr
, ref
->bytenr
)
977 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
978 ctf_integer(int, action
, action
)
979 ctf_integer(int, is_data
, head_ref
->is_data
)
983 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
985 add_delayed_ref_head
,
987 btrfs_add_delayed_ref_head
,
989 TP_PROTO(const struct btrfs_delayed_ref_node
*ref
,
990 const struct btrfs_delayed_ref_head
*head_ref
,
993 TP_ARGS(ref
, head_ref
, action
)
996 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
998 run_delayed_ref_head
,
1000 btrfs_run_delayed_ref_head
,
1002 TP_PROTO(const struct btrfs_delayed_ref_node
*ref
,
1003 const struct btrfs_delayed_ref_head
*head_ref
,
1006 TP_ARGS(ref
, head_ref
, action
)
1009 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
1010 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head
,
1012 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
1013 struct btrfs_delayed_ref_head
*head_ref
,
1016 TP_ARGS(ref
, head_ref
, action
),
1019 ctf_integer(u64
, bytenr
, ref
->bytenr
)
1020 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
1021 ctf_integer(int, action
, action
)
1022 ctf_integer(int, is_data
, head_ref
->is_data
)
1026 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
1028 add_delayed_ref_head
,
1030 btrfs_add_delayed_ref_head
,
1032 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
1033 struct btrfs_delayed_ref_head
*head_ref
,
1036 TP_ARGS(ref
, head_ref
, action
)
1039 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head
,
1041 run_delayed_ref_head
,
1043 btrfs_run_delayed_ref_head
,
1045 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
1046 struct btrfs_delayed_ref_head
*head_ref
,
1049 TP_ARGS(ref
, head_ref
, action
)
1053 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head
,
1055 TP_PROTO(struct btrfs_delayed_ref_node
*ref
,
1056 struct btrfs_delayed_ref_head
*head_ref
,
1059 TP_ARGS(ref
, head_ref
, action
),
1062 ctf_integer(u64
, bytenr
, ref
->bytenr
)
1063 ctf_integer(u64
, num_bytes
, ref
->num_bytes
)
1064 ctf_integer(int, action
, action
)
1065 ctf_integer(int, is_data
, head_ref
->is_data
)
1070 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1072 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk
,
1074 TP_PROTO(const struct btrfs_fs_info
*fs_info
, const struct map_lookup
*map
,
1075 u64 offset
, u64 size
),
1077 TP_ARGS(fs_info
, map
, offset
, size
),
1080 ctf_integer(int, num_stripes
, map
->num_stripes
)
1081 ctf_integer(u64
, type
, map
->type
)
1082 ctf_integer(int, sub_stripes
, map
->sub_stripes
)
1083 ctf_integer(u64
, offset
, offset
)
1084 ctf_integer(u64
, size
, size
)
1085 ctf_integer(u64
, root_objectid
, fs_info
->chunk_root
->root_key
.objectid
)
1089 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_alloc
,
1091 TP_PROTO(const struct btrfs_fs_info
*info
, const struct map_lookup
*map
,
1092 u64 offset
, u64 size
),
1094 TP_ARGS(info
, map
, offset
, size
)
1097 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_free
,
1099 TP_PROTO(const struct btrfs_fs_info
*info
, const struct map_lookup
*map
,
1100 u64 offset
, u64 size
),
1102 TP_ARGS(info
, map
, offset
, size
)
1105 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1107 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk
,
1109 TP_PROTO(struct btrfs_fs_info
*fs_info
, struct map_lookup
*map
,
1110 u64 offset
, u64 size
),
1112 TP_ARGS(fs_info
, map
, offset
, size
),
1115 ctf_integer(int, num_stripes
, map
->num_stripes
)
1116 ctf_integer(u64
, type
, map
->type
)
1117 ctf_integer(int, sub_stripes
, map
->sub_stripes
)
1118 ctf_integer(u64
, offset
, offset
)
1119 ctf_integer(u64
, size
, size
)
1120 ctf_integer(u64
, root_objectid
, fs_info
->chunk_root
->root_key
.objectid
)
1124 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_alloc
,
1126 TP_PROTO(struct btrfs_fs_info
*info
, struct map_lookup
*map
,
1127 u64 offset
, u64 size
),
1129 TP_ARGS(info
, map
, offset
, size
)
1132 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_free
,
1134 TP_PROTO(struct btrfs_fs_info
*info
, struct map_lookup
*map
,
1135 u64 offset
, u64 size
),
1137 TP_ARGS(info
, map
, offset
, size
)
1140 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1142 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk
,
1144 TP_PROTO(const struct btrfs_root
*root
, const struct map_lookup
*map
,
1145 u64 offset
, u64 size
),
1147 TP_ARGS(root
, map
, offset
, size
),
1150 ctf_integer(int, num_stripes
, map
->num_stripes
)
1151 ctf_integer(u64
, type
, map
->type
)
1152 ctf_integer(int, sub_stripes
, map
->sub_stripes
)
1153 ctf_integer(u64
, offset
, offset
)
1154 ctf_integer(u64
, size
, size
)
1155 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1159 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_alloc
,
1161 TP_PROTO(const struct btrfs_root
*root
, const struct map_lookup
*map
,
1162 u64 offset
, u64 size
),
1164 TP_ARGS(root
, map
, offset
, size
)
1167 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_free
,
1169 TP_PROTO(const struct btrfs_root
*root
, const struct map_lookup
*map
,
1170 u64 offset
, u64 size
),
1172 TP_ARGS(root
, map
, offset
, size
)
1175 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1177 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk
,
1179 TP_PROTO(struct btrfs_root
*root
, struct map_lookup
*map
,
1180 u64 offset
, u64 size
),
1182 TP_ARGS(root
, map
, offset
, size
),
1185 ctf_integer(int, num_stripes
, map
->num_stripes
)
1186 ctf_integer(u64
, type
, map
->type
)
1187 ctf_integer(int, sub_stripes
, map
->sub_stripes
)
1188 ctf_integer(u64
, offset
, offset
)
1189 ctf_integer(u64
, size
, size
)
1190 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1194 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_alloc
,
1196 TP_PROTO(struct btrfs_root
*root
, struct map_lookup
*map
,
1197 u64 offset
, u64 size
),
1199 TP_ARGS(root
, map
, offset
, size
)
1202 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk
, btrfs_chunk_free
,
1204 TP_PROTO(struct btrfs_root
*root
, struct map_lookup
*map
,
1205 u64 offset
, u64 size
),
1207 TP_ARGS(root
, map
, offset
, size
)
1210 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1212 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1213 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1214 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block
,
1216 TP_PROTO(const struct btrfs_root
*root
, const struct extent_buffer
*buf
,
1217 const struct extent_buffer
*cow
),
1219 TP_ARGS(root
, buf
, cow
),
1222 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1223 ctf_integer(u64
, buf_start
, buf
->start
)
1224 ctf_integer(int, refs
, atomic_read(&buf
->refs
))
1225 ctf_integer(u64
, cow_start
, cow
->start
)
1226 ctf_integer(int, buf_level
, btrfs_header_level(buf
))
1227 ctf_integer(int, cow_level
, btrfs_header_level(cow
))
1231 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block
,
1233 TP_PROTO(struct btrfs_root
*root
, struct extent_buffer
*buf
,
1234 struct extent_buffer
*cow
),
1236 TP_ARGS(root
, buf
, cow
),
1239 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1240 ctf_integer(u64
, buf_start
, buf
->start
)
1241 ctf_integer(int, refs
, atomic_read(&buf
->refs
))
1242 ctf_integer(u64
, cow_start
, cow
->start
)
1243 ctf_integer(int, buf_level
, btrfs_header_level(buf
))
1244 ctf_integer(int, cow_level
, btrfs_header_level(cow
))
1249 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1250 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1251 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation
,
1253 TP_PROTO(const struct btrfs_fs_info
*fs_info
, char *type
, u64 val
,
1254 u64 bytes
, int reserve
),
1256 TP_ARGS(fs_info
, type
, val
, bytes
, reserve
),
1259 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
1260 ctf_string(type
, type
)
1261 ctf_integer(u64
, val
, val
)
1262 ctf_integer(u64
, bytes
, bytes
)
1263 ctf_integer(int, reserve
, reserve
)
1266 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1267 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation
,
1269 TP_PROTO(struct btrfs_fs_info
*fs_info
, char *type
, u64 val
,
1270 u64 bytes
, int reserve
),
1272 TP_ARGS(fs_info
, type
, val
, bytes
, reserve
),
1275 ctf_array(u8
, fsid
, fs_info
->fsid
, BTRFS_UUID_SIZE
)
1276 ctf_string(type
, type
)
1277 ctf_integer(u64
, val
, val
)
1278 ctf_integer(u64
, bytes
, bytes
)
1279 ctf_integer(int, reserve
, reserve
)
1284 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1286 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent
,
1288 TP_PROTO(const struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1290 TP_ARGS(info
, start
, len
),
1293 ctf_integer(u64
, start
, start
)
1294 ctf_integer(u64
, len
, len
)
1298 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_alloc
,
1300 TP_PROTO(const struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1302 TP_ARGS(info
, start
, len
)
1305 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_free
,
1307 TP_PROTO(const struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1309 TP_ARGS(info
, start
, len
)
1312 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1314 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent
,
1316 TP_PROTO(struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1318 TP_ARGS(info
, start
, len
),
1321 ctf_integer(u64
, start
, start
)
1322 ctf_integer(u64
, len
, len
)
1326 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_alloc
,
1328 TP_PROTO(struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1330 TP_ARGS(info
, start
, len
)
1333 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_free
,
1335 TP_PROTO(struct btrfs_fs_info
*info
, u64 start
, u64 len
),
1337 TP_ARGS(info
, start
, len
)
1340 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1342 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent
,
1344 TP_PROTO(const struct btrfs_root
*root
, u64 start
, u64 len
),
1346 TP_ARGS(root
, start
, len
),
1349 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1350 ctf_integer(u64
, start
, start
)
1351 ctf_integer(u64
, len
, len
)
1355 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_alloc
,
1357 TP_PROTO(const struct btrfs_root
*root
, u64 start
, u64 len
),
1359 TP_ARGS(root
, start
, len
)
1362 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_free
,
1364 TP_PROTO(const struct btrfs_root
*root
, u64 start
, u64 len
),
1366 TP_ARGS(root
, start
, len
)
1369 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1371 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent
,
1373 TP_PROTO(struct btrfs_root
*root
, u64 start
, u64 len
),
1375 TP_ARGS(root
, start
, len
),
1378 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1379 ctf_integer(u64
, start
, start
)
1380 ctf_integer(u64
, len
, len
)
1384 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_alloc
,
1386 TP_PROTO(struct btrfs_root
*root
, u64 start
, u64 len
),
1388 TP_ARGS(root
, start
, len
)
1391 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent
, btrfs_reserved_extent_free
,
1393 TP_PROTO(struct btrfs_root
*root
, u64 start
, u64 len
),
1395 TP_ARGS(root
, start
, len
)
1398 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1400 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1402 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent
,
1404 btrfs_find_free_extent
,
1406 TP_PROTO(const struct btrfs_fs_info
*info
, u64 num_bytes
, u64 empty_size
,
1409 TP_ARGS(info
, num_bytes
, empty_size
, data
),
1412 ctf_integer(u64
, num_bytes
, num_bytes
)
1413 ctf_integer(u64
, empty_size
, empty_size
)
1414 ctf_integer(u64
, data
, data
)
1418 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent
,
1420 TP_PROTO(const struct btrfs_fs_info
*info
,
1421 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1424 TP_ARGS(info
, block_group
, start
, len
),
1427 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1428 ctf_integer(u64
, flags
, block_group
->flags
)
1429 ctf_integer(u64
, start
, start
)
1430 ctf_integer(u64
, len
, len
)
1434 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent
,
1436 TP_PROTO(const struct btrfs_fs_info
*info
,
1437 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1440 TP_ARGS(info
, block_group
, start
, len
)
1443 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent_cluster
,
1445 TP_PROTO(const struct btrfs_fs_info
*info
,
1446 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1449 TP_ARGS(info
, block_group
, start
, len
)
1452 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1454 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent
,
1456 btrfs_find_free_extent
,
1458 TP_PROTO(struct btrfs_fs_info
*info
, u64 num_bytes
, u64 empty_size
,
1461 TP_ARGS(info
, num_bytes
, empty_size
, data
),
1464 ctf_integer(u64
, num_bytes
, num_bytes
)
1465 ctf_integer(u64
, empty_size
, empty_size
)
1466 ctf_integer(u64
, data
, data
)
1470 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent
,
1472 TP_PROTO(struct btrfs_fs_info
*info
,
1473 struct btrfs_block_group_cache
*block_group
, u64 start
,
1476 TP_ARGS(info
, block_group
, start
, len
),
1479 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1480 ctf_integer(u64
, flags
, block_group
->flags
)
1481 ctf_integer(u64
, start
, start
)
1482 ctf_integer(u64
, len
, len
)
1486 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent
,
1488 TP_PROTO(struct btrfs_fs_info
*info
,
1489 struct btrfs_block_group_cache
*block_group
, u64 start
,
1492 TP_ARGS(info
, block_group
, start
, len
)
1495 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent_cluster
,
1497 TP_PROTO(struct btrfs_fs_info
*info
,
1498 struct btrfs_block_group_cache
*block_group
, u64 start
,
1501 TP_ARGS(info
, block_group
, start
, len
)
1503 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1505 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent
,
1507 btrfs_find_free_extent
,
1509 TP_PROTO(const struct btrfs_root
*root
, u64 num_bytes
, u64 empty_size
,
1512 TP_ARGS(root
, num_bytes
, empty_size
, data
),
1515 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1516 ctf_integer(u64
, num_bytes
, num_bytes
)
1517 ctf_integer(u64
, empty_size
, empty_size
)
1518 ctf_integer(u64
, data
, data
)
1522 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent
,
1524 TP_PROTO(const struct btrfs_root
*root
,
1525 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1528 TP_ARGS(root
, block_group
, start
, len
),
1531 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1532 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1533 ctf_integer(u64
, flags
, block_group
->flags
)
1534 ctf_integer(u64
, start
, start
)
1535 ctf_integer(u64
, len
, len
)
1539 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent
,
1541 TP_PROTO(const struct btrfs_root
*root
,
1542 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1545 TP_ARGS(root
, block_group
, start
, len
)
1548 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent_cluster
,
1550 TP_PROTO(const struct btrfs_root
*root
,
1551 const struct btrfs_block_group_cache
*block_group
, u64 start
,
1554 TP_ARGS(root
, block_group
, start
, len
)
1557 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1559 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent
,
1561 btrfs_find_free_extent
,
1563 TP_PROTO(struct btrfs_root
*root
, u64 num_bytes
, u64 empty_size
,
1566 TP_ARGS(root
, num_bytes
, empty_size
, data
),
1569 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1570 ctf_integer(u64
, num_bytes
, num_bytes
)
1571 ctf_integer(u64
, empty_size
, empty_size
)
1572 ctf_integer(u64
, data
, data
)
1576 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent
,
1578 TP_PROTO(struct btrfs_root
*root
,
1579 struct btrfs_block_group_cache
*block_group
, u64 start
,
1582 TP_ARGS(root
, block_group
, start
, len
),
1585 ctf_integer(u64
, root_objectid
, root
->root_key
.objectid
)
1586 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1587 ctf_integer(u64
, flags
, block_group
->flags
)
1588 ctf_integer(u64
, start
, start
)
1589 ctf_integer(u64
, len
, len
)
1593 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent
,
1595 TP_PROTO(struct btrfs_root
*root
,
1596 struct btrfs_block_group_cache
*block_group
, u64 start
,
1599 TP_ARGS(root
, block_group
, start
, len
)
1602 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent
, btrfs_reserve_extent_cluster
,
1604 TP_PROTO(struct btrfs_root
*root
,
1605 struct btrfs_block_group_cache
*block_group
, u64 start
,
1608 TP_ARGS(root
, block_group
, start
, len
)
1611 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1613 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1614 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1615 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster
,
1617 TP_PROTO(const struct btrfs_block_group_cache
*block_group
, u64 start
,
1618 u64 bytes
, u64 empty_size
, u64 min_bytes
),
1620 TP_ARGS(block_group
, start
, bytes
, empty_size
, min_bytes
),
1623 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1624 ctf_integer(u64
, flags
, block_group
->flags
)
1625 ctf_integer(u64
, start
, start
)
1626 ctf_integer(u64
, bytes
, bytes
)
1627 ctf_integer(u64
, empty_size
, empty_size
)
1628 ctf_integer(u64
, min_bytes
, min_bytes
)
1632 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup
,
1634 TP_PROTO(const struct btrfs_block_group_cache
*block_group
),
1636 TP_ARGS(block_group
),
1639 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1643 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster
,
1645 TP_PROTO(const struct btrfs_block_group_cache
*block_group
,
1646 const struct btrfs_free_cluster
*cluster
, u64 size
, int bitmap
),
1648 TP_ARGS(block_group
, cluster
, size
, bitmap
),
1651 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1652 ctf_integer(u64
, flags
, block_group
->flags
)
1653 ctf_integer(u64
, start
, cluster
->window_start
)
1654 ctf_integer(u64
, max_size
, cluster
->max_size
)
1655 ctf_integer(u64
, size
, size
)
1656 ctf_integer(int, bitmap
, bitmap
)
1659 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1660 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster
,
1662 TP_PROTO(struct btrfs_block_group_cache
*block_group
, u64 start
,
1663 u64 bytes
, u64 empty_size
, u64 min_bytes
),
1665 TP_ARGS(block_group
, start
, bytes
, empty_size
, min_bytes
),
1668 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1669 ctf_integer(u64
, flags
, block_group
->flags
)
1670 ctf_integer(u64
, start
, start
)
1671 ctf_integer(u64
, bytes
, bytes
)
1672 ctf_integer(u64
, empty_size
, empty_size
)
1673 ctf_integer(u64
, min_bytes
, min_bytes
)
1677 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup
,
1679 TP_PROTO(struct btrfs_block_group_cache
*block_group
),
1681 TP_ARGS(block_group
),
1684 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1688 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster
,
1690 TP_PROTO(struct btrfs_block_group_cache
*block_group
,
1691 struct btrfs_free_cluster
*cluster
, u64 size
, int bitmap
),
1693 TP_ARGS(block_group
, cluster
, size
, bitmap
),
1696 ctf_integer(u64
, bg_objectid
, block_group
->key
.objectid
)
1697 ctf_integer(u64
, flags
, block_group
->flags
)
1698 ctf_integer(u64
, start
, cluster
->window_start
)
1699 ctf_integer(u64
, max_size
, cluster
->max_size
)
1700 ctf_integer(u64
, size
, size
)
1701 ctf_integer(int, bitmap
, bitmap
)
1706 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1707 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1708 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state
,
1710 btrfs_alloc_extent_state
,
1712 TP_PROTO(const struct extent_state
*state
, gfp_t mask
, unsigned long IP
),
1714 TP_ARGS(state
, mask
, IP
),
1717 ctf_integer_hex(const struct extent_state
*, state
, state
)
1718 ctf_integer(gfp_t
, mask
, mask
)
1719 ctf_integer(unsigned long, ip
, IP
)
1723 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state
,
1725 btrfs_free_extent_state
,
1727 TP_PROTO(const struct extent_state
*state
, unsigned long IP
),
1732 ctf_integer_hex(const struct extent_state
*, state
, state
)
1733 ctf_integer(unsigned long, ip
, IP
)
1736 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
1737 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state
,
1739 btrfs_alloc_extent_state
,
1741 TP_PROTO(struct extent_state
*state
, gfp_t mask
, unsigned long IP
),
1743 TP_ARGS(state
, mask
, IP
),
1746 ctf_integer_hex(struct extent_state
*, state
, state
)
1747 ctf_integer(gfp_t
, mask
, mask
)
1748 ctf_integer(unsigned long, ip
, IP
)
1752 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state
,
1754 btrfs_free_extent_state
,
1756 TP_PROTO(struct extent_state
*state
, unsigned long IP
),
1761 ctf_integer_hex(struct extent_state
*, state
, state
)
1762 ctf_integer(unsigned long, ip
, IP
)
1767 #endif /* LTTNG_TRACE_BTRFS_H */
1769 /* This part must be outside protection */
1770 #include <probes/define_trace.h>