1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM btrfs
5 #if !defined(_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/writeback.h>
9 #include <linux/tracepoint.h>
10 #include <trace/events/mmflags.h>
16 struct btrfs_file_extent_item;
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 struct btrfs_block_group;
23 struct btrfs_free_cluster;
27 struct __btrfs_workqueue;
28 struct btrfs_qgroup_extent_record;
30 struct extent_io_tree;
32 struct btrfs_space_info;
34 #define show_ref_type(type) \
35 __print_symbolic(type, \
36 { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \
37 { BTRFS_EXTENT_DATA_REF_KEY, "EXTENT_DATA_REF" }, \
38 { BTRFS_EXTENT_REF_V0_KEY, "EXTENT_REF_V0" }, \
39 { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \
40 { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" })
42 #define __show_root_type(obj) \
43 __print_symbolic_u64(obj, \
44 { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \
45 { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \
46 { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \
47 { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \
48 { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \
49 { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \
50 { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \
51 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \
52 { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \
53 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \
54 { BTRFS_UUID_TREE_OBJECTID, "UUID_TREE" }, \
55 { BTRFS_FREE_SPACE_TREE_OBJECTID, "FREE_SPACE_TREE" }, \
56 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" })
58 #define show_root_type(obj) \
59 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \
60 (obj >= BTRFS_ROOT_TREE_OBJECTID && \
61 obj <= BTRFS_QUOTA_TREE_OBJECTID)) ? __show_root_type(obj) : "-"
63 #define FLUSH_ACTIONS \
64 EM( BTRFS_RESERVE_NO_FLUSH, "BTRFS_RESERVE_NO_FLUSH") \
65 EM( BTRFS_RESERVE_FLUSH_LIMIT, "BTRFS_RESERVE_FLUSH_LIMIT") \
66 EM( BTRFS_RESERVE_FLUSH_ALL, "BTRFS_RESERVE_FLUSH_ALL") \
67 EMe(BTRFS_RESERVE_FLUSH_ALL_STEAL, "BTRFS_RESERVE_FLUSH_ALL_STEAL")
70 EM( BTRFS_FILE_EXTENT_INLINE, "INLINE") \
71 EM( BTRFS_FILE_EXTENT_REG, "REG") \
72 EMe(BTRFS_FILE_EXTENT_PREALLOC, "PREALLOC")
74 #define QGROUP_RSV_TYPES \
75 EM( BTRFS_QGROUP_RSV_DATA, "DATA") \
76 EM( BTRFS_QGROUP_RSV_META_PERTRANS, "META_PERTRANS") \
77 EMe(BTRFS_QGROUP_RSV_META_PREALLOC, "META_PREALLOC")
79 #define IO_TREE_OWNER \
80 EM( IO_TREE_FS_PINNED_EXTENTS, "PINNED_EXTENTS") \
81 EM( IO_TREE_FS_EXCLUDED_EXTENTS, "EXCLUDED_EXTENTS") \
82 EM( IO_TREE_BTREE_INODE_IO, "BTREE_INODE_IO") \
83 EM( IO_TREE_INODE_IO, "INODE_IO") \
84 EM( IO_TREE_INODE_IO_FAILURE, "INODE_IO_FAILURE") \
85 EM( IO_TREE_RELOC_BLOCKS, "RELOC_BLOCKS") \
86 EM( IO_TREE_TRANS_DIRTY_PAGES, "TRANS_DIRTY_PAGES") \
87 EM( IO_TREE_ROOT_DIRTY_LOG_PAGES, "ROOT_DIRTY_LOG_PAGES") \
88 EM( IO_TREE_INODE_FILE_EXTENT, "INODE_FILE_EXTENT") \
89 EM( IO_TREE_LOG_CSUM_RANGE, "LOG_CSUM_RANGE") \
90 EMe(IO_TREE_SELFTEST, "SELFTEST")
92 #define FLUSH_STATES \
93 EM( FLUSH_DELAYED_ITEMS_NR, "FLUSH_DELAYED_ITEMS_NR") \
94 EM( FLUSH_DELAYED_ITEMS, "FLUSH_DELAYED_ITEMS") \
95 EM( FLUSH_DELALLOC, "FLUSH_DELALLOC") \
96 EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \
97 EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \
98 EM( FLUSH_DELAYED_REFS, "FLUSH_ELAYED_REFS") \
99 EM( ALLOC_CHUNK, "ALLOC_CHUNK") \
100 EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \
101 EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \
102 EMe(COMMIT_TRANS, "COMMIT_TRANS")
105 * First define the enums in the above macros to be exported to userspace via
106 * TRACE_DEFINE_ENUM().
111 #define EM(a, b) TRACE_DEFINE_ENUM(a);
112 #define EMe(a, b) TRACE_DEFINE_ENUM(a);
121 * Now redefine the EM and EMe macros to map the enums to the strings that will
122 * be printed in the output
127 #define EM(a, b) {a, b},
128 #define EMe(a, b) {a, b}
131 #define BTRFS_GROUP_FLAGS \
132 { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \
133 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
134 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
135 { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \
136 { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \
137 { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \
138 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \
139 { BTRFS_BLOCK_GROUP_RAID5, "RAID5"}, \
140 { BTRFS_BLOCK_GROUP_RAID6, "RAID6"}
142 #define EXTENT_FLAGS \
143 { EXTENT_DIRTY, "DIRTY"}, \
144 { EXTENT_UPTODATE, "UPTODATE"}, \
145 { EXTENT_LOCKED, "LOCKED"}, \
146 { EXTENT_NEW, "NEW"}, \
147 { EXTENT_DELALLOC, "DELALLOC"}, \
148 { EXTENT_DEFRAG, "DEFRAG"}, \
149 { EXTENT_BOUNDARY, "BOUNDARY"}, \
150 { EXTENT_NODATASUM, "NODATASUM"}, \
151 { EXTENT_CLEAR_META_RESV, "CLEAR_META_RESV"}, \
152 { EXTENT_NEED_WAIT, "NEED_WAIT"}, \
153 { EXTENT_DAMAGED, "DAMAGED"}, \
154 { EXTENT_NORESERVE, "NORESERVE"}, \
155 { EXTENT_QGROUP_RESERVED, "QGROUP_RESERVED"}, \
156 { EXTENT_CLEAR_DATA_RESV, "CLEAR_DATA_RESV"}, \
157 { EXTENT_DELALLOC_NEW, "DELALLOC_NEW"}
159 #define BTRFS_FSID_SIZE 16
160 #define TP_STRUCT__entry_fsid __array(u8, fsid, BTRFS_FSID_SIZE)
162 #define TP_fast_assign_fsid(fs_info) \
165 memcpy(__entry->fsid, fs_info->fs_devices->fsid, \
168 memset(__entry->fsid, 0, BTRFS_FSID_SIZE); \
171 #define TP_STRUCT__entry_btrfs(args...) \
173 TP_STRUCT__entry_fsid \
175 #define TP_fast_assign_btrfs(fs_info, args...) \
177 TP_fast_assign_fsid(fs_info); \
179 #define TP_printk_btrfs(fmt, args...) \
180 TP_printk("%pU: " fmt, __entry->fsid, args)
182 TRACE_EVENT(btrfs_transaction_commit,
184 TP_PROTO(const struct btrfs_root *root),
188 TP_STRUCT__entry_btrfs(
189 __field( u64, generation )
190 __field( u64, root_objectid )
193 TP_fast_assign_btrfs(root->fs_info,
194 __entry->generation = root->fs_info->generation;
195 __entry->root_objectid = root->root_key.objectid;
198 TP_printk_btrfs("root=%llu(%s) gen=%llu",
199 show_root_type(__entry->root_objectid),
203 DECLARE_EVENT_CLASS(btrfs__inode,
205 TP_PROTO(const struct inode *inode),
209 TP_STRUCT__entry_btrfs(
211 __field( u64, blocks )
212 __field( u64, disk_i_size )
213 __field( u64, generation )
214 __field( u64, last_trans )
215 __field( u64, logged_trans )
216 __field( u64, root_objectid )
219 TP_fast_assign_btrfs(btrfs_sb(inode->i_sb),
220 __entry->ino = btrfs_ino(BTRFS_I(inode));
221 __entry->blocks = inode->i_blocks;
222 __entry->disk_i_size = BTRFS_I(inode)->disk_i_size;
223 __entry->generation = BTRFS_I(inode)->generation;
224 __entry->last_trans = BTRFS_I(inode)->last_trans;
225 __entry->logged_trans = BTRFS_I(inode)->logged_trans;
226 __entry->root_objectid =
227 BTRFS_I(inode)->root->root_key.objectid;
230 TP_printk_btrfs("root=%llu(%s) gen=%llu ino=%llu blocks=%llu "
231 "disk_i_size=%llu last_trans=%llu logged_trans=%llu",
232 show_root_type(__entry->root_objectid),
236 __entry->disk_i_size,
238 __entry->logged_trans)
241 DEFINE_EVENT(btrfs__inode, btrfs_inode_new,
243 TP_PROTO(const struct inode *inode),
248 DEFINE_EVENT(btrfs__inode, btrfs_inode_request,
250 TP_PROTO(const struct inode *inode),
255 DEFINE_EVENT(btrfs__inode, btrfs_inode_evict,
257 TP_PROTO(const struct inode *inode),
262 #define __show_map_type(type) \
263 __print_symbolic_u64(type, \
264 { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \
265 { EXTENT_MAP_HOLE, "HOLE" }, \
266 { EXTENT_MAP_INLINE, "INLINE" }, \
267 { EXTENT_MAP_DELALLOC, "DELALLOC" })
269 #define show_map_type(type) \
270 type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" : __show_map_type(type)
272 #define show_map_flags(flag) \
273 __print_flags(flag, "|", \
274 { (1 << EXTENT_FLAG_PINNED), "PINNED" },\
275 { (1 << EXTENT_FLAG_COMPRESSED), "COMPRESSED" },\
276 { (1 << EXTENT_FLAG_PREALLOC), "PREALLOC" },\
277 { (1 << EXTENT_FLAG_LOGGING), "LOGGING" },\
278 { (1 << EXTENT_FLAG_FILLING), "FILLING" },\
279 { (1 << EXTENT_FLAG_FS_MAPPING), "FS_MAPPING" })
281 TRACE_EVENT_CONDITION(btrfs_get_extent,
283 TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode,
284 const struct extent_map *map),
286 TP_ARGS(root, inode, map),
290 TP_STRUCT__entry_btrfs(
291 __field( u64, root_objectid )
293 __field( u64, start )
295 __field( u64, orig_start )
296 __field( u64, block_start )
297 __field( u64, block_len )
298 __field( unsigned long, flags )
300 __field( unsigned int, compress_type )
303 TP_fast_assign_btrfs(root->fs_info,
304 __entry->root_objectid = root->root_key.objectid;
305 __entry->ino = btrfs_ino(inode);
306 __entry->start = map->start;
307 __entry->len = map->len;
308 __entry->orig_start = map->orig_start;
309 __entry->block_start = map->block_start;
310 __entry->block_len = map->block_len;
311 __entry->flags = map->flags;
312 __entry->refs = refcount_read(&map->refs);
313 __entry->compress_type = map->compress_type;
316 TP_printk_btrfs("root=%llu(%s) ino=%llu start=%llu len=%llu "
317 "orig_start=%llu block_start=%llu(%s) "
318 "block_len=%llu flags=%s refs=%u "
320 show_root_type(__entry->root_objectid),
325 show_map_type(__entry->block_start),
327 show_map_flags(__entry->flags),
328 __entry->refs, __entry->compress_type)
331 TRACE_EVENT(btrfs_handle_em_exist,
333 TP_PROTO(const struct btrfs_fs_info *fs_info,
334 const struct extent_map *existing, const struct extent_map *map,
337 TP_ARGS(fs_info, existing, map, start, len),
339 TP_STRUCT__entry_btrfs(
340 __field( u64, e_start )
341 __field( u64, e_len )
342 __field( u64, map_start )
343 __field( u64, map_len )
344 __field( u64, start )
348 TP_fast_assign_btrfs(fs_info,
349 __entry->e_start = existing->start;
350 __entry->e_len = existing->len;
351 __entry->map_start = map->start;
352 __entry->map_len = map->len;
353 __entry->start = start;
357 TP_printk_btrfs("start=%llu len=%llu "
358 "existing(start=%llu len=%llu) "
359 "em(start=%llu len=%llu)",
368 /* file extent item */
369 DECLARE_EVENT_CLASS(btrfs__file_extent_item_regular,
371 TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l,
372 const struct btrfs_file_extent_item *fi, u64 start),
374 TP_ARGS(bi, l, fi, start),
376 TP_STRUCT__entry_btrfs(
377 __field( u64, root_obj )
379 __field( loff_t, isize )
380 __field( u64, disk_isize )
381 __field( u64, num_bytes )
382 __field( u64, ram_bytes )
383 __field( u64, disk_bytenr )
384 __field( u64, disk_num_bytes )
385 __field( u64, extent_offset )
386 __field( u8, extent_type )
387 __field( u8, compression )
388 __field( u64, extent_start )
389 __field( u64, extent_end )
392 TP_fast_assign_btrfs(bi->root->fs_info,
393 __entry->root_obj = bi->root->root_key.objectid;
394 __entry->ino = btrfs_ino(bi);
395 __entry->isize = bi->vfs_inode.i_size;
396 __entry->disk_isize = bi->disk_i_size;
397 __entry->num_bytes = btrfs_file_extent_num_bytes(l, fi);
398 __entry->ram_bytes = btrfs_file_extent_ram_bytes(l, fi);
399 __entry->disk_bytenr = btrfs_file_extent_disk_bytenr(l, fi);
400 __entry->disk_num_bytes = btrfs_file_extent_disk_num_bytes(l, fi);
401 __entry->extent_offset = btrfs_file_extent_offset(l, fi);
402 __entry->extent_type = btrfs_file_extent_type(l, fi);
403 __entry->compression = btrfs_file_extent_compression(l, fi);
404 __entry->extent_start = start;
405 __entry->extent_end = (start + __entry->num_bytes);
409 "root=%llu(%s) inode=%llu size=%llu disk_isize=%llu "
410 "file extent range=[%llu %llu] "
411 "(num_bytes=%llu ram_bytes=%llu disk_bytenr=%llu "
412 "disk_num_bytes=%llu extent_offset=%llu type=%s "
414 show_root_type(__entry->root_obj), __entry->ino,
416 __entry->disk_isize, __entry->extent_start,
417 __entry->extent_end, __entry->num_bytes, __entry->ram_bytes,
418 __entry->disk_bytenr, __entry->disk_num_bytes,
419 __entry->extent_offset, __print_symbolic(__entry->extent_type, FI_TYPES),
420 __entry->compression)
424 btrfs__file_extent_item_inline,
426 TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l,
427 const struct btrfs_file_extent_item *fi, int slot, u64 start),
429 TP_ARGS(bi, l, fi, slot, start),
431 TP_STRUCT__entry_btrfs(
432 __field( u64, root_obj )
434 __field( loff_t, isize )
435 __field( u64, disk_isize )
436 __field( u8, extent_type )
437 __field( u8, compression )
438 __field( u64, extent_start )
439 __field( u64, extent_end )
442 TP_fast_assign_btrfs(
444 __entry->root_obj = bi->root->root_key.objectid;
445 __entry->ino = btrfs_ino(bi);
446 __entry->isize = bi->vfs_inode.i_size;
447 __entry->disk_isize = bi->disk_i_size;
448 __entry->extent_type = btrfs_file_extent_type(l, fi);
449 __entry->compression = btrfs_file_extent_compression(l, fi);
450 __entry->extent_start = start;
451 __entry->extent_end = (start + btrfs_file_extent_ram_bytes(l, fi));
455 "root=%llu(%s) inode=%llu size=%llu disk_isize=%llu "
456 "file extent range=[%llu %llu] "
457 "extent_type=%s compression=%u",
458 show_root_type(__entry->root_obj), __entry->ino, __entry->isize,
459 __entry->disk_isize, __entry->extent_start,
460 __entry->extent_end, __print_symbolic(__entry->extent_type, FI_TYPES),
461 __entry->compression)
465 btrfs__file_extent_item_regular, btrfs_get_extent_show_fi_regular,
467 TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l,
468 const struct btrfs_file_extent_item *fi, u64 start),
470 TP_ARGS(bi, l, fi, start)
474 btrfs__file_extent_item_regular, btrfs_truncate_show_fi_regular,
476 TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l,
477 const struct btrfs_file_extent_item *fi, u64 start),
479 TP_ARGS(bi, l, fi, start)
483 btrfs__file_extent_item_inline, btrfs_get_extent_show_fi_inline,
485 TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l,
486 const struct btrfs_file_extent_item *fi, int slot, u64 start),
488 TP_ARGS(bi, l, fi, slot, start)
492 btrfs__file_extent_item_inline, btrfs_truncate_show_fi_inline,
494 TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l,
495 const struct btrfs_file_extent_item *fi, int slot, u64 start),
497 TP_ARGS(bi, l, fi, slot, start)
500 #define show_ordered_flags(flags) \
501 __print_flags(flags, "|", \
502 { (1 << BTRFS_ORDERED_REGULAR), "REGULAR" }, \
503 { (1 << BTRFS_ORDERED_NOCOW), "NOCOW" }, \
504 { (1 << BTRFS_ORDERED_PREALLOC), "PREALLOC" }, \
505 { (1 << BTRFS_ORDERED_COMPRESSED), "COMPRESSED" }, \
506 { (1 << BTRFS_ORDERED_DIRECT), "DIRECT" }, \
507 { (1 << BTRFS_ORDERED_IO_DONE), "IO_DONE" }, \
508 { (1 << BTRFS_ORDERED_COMPLETE), "COMPLETE" }, \
509 { (1 << BTRFS_ORDERED_IOERR), "IOERR" }, \
510 { (1 << BTRFS_ORDERED_TRUNCATED), "TRUNCATED" })
513 DECLARE_EVENT_CLASS(btrfs__ordered_extent,
515 TP_PROTO(const struct btrfs_inode *inode,
516 const struct btrfs_ordered_extent *ordered),
518 TP_ARGS(inode, ordered),
520 TP_STRUCT__entry_btrfs(
522 __field( u64, file_offset )
523 __field( u64, start )
525 __field( u64, disk_len )
526 __field( u64, bytes_left )
527 __field( unsigned long, flags )
528 __field( int, compress_type )
530 __field( u64, root_objectid )
531 __field( u64, truncated_len )
534 TP_fast_assign_btrfs(inode->root->fs_info,
535 __entry->ino = btrfs_ino(inode);
536 __entry->file_offset = ordered->file_offset;
537 __entry->start = ordered->disk_bytenr;
538 __entry->len = ordered->num_bytes;
539 __entry->disk_len = ordered->disk_num_bytes;
540 __entry->bytes_left = ordered->bytes_left;
541 __entry->flags = ordered->flags;
542 __entry->compress_type = ordered->compress_type;
543 __entry->refs = refcount_read(&ordered->refs);
544 __entry->root_objectid = inode->root->root_key.objectid;
545 __entry->truncated_len = ordered->truncated_len;
548 TP_printk_btrfs("root=%llu(%s) ino=%llu file_offset=%llu "
549 "start=%llu len=%llu disk_len=%llu "
550 "truncated_len=%llu "
551 "bytes_left=%llu flags=%s compress_type=%d "
553 show_root_type(__entry->root_objectid),
555 __entry->file_offset,
559 __entry->truncated_len,
561 show_ordered_flags(__entry->flags),
562 __entry->compress_type, __entry->refs)
565 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add,
567 TP_PROTO(const struct btrfs_inode *inode,
568 const struct btrfs_ordered_extent *ordered),
570 TP_ARGS(inode, ordered)
573 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove,
575 TP_PROTO(const struct btrfs_inode *inode,
576 const struct btrfs_ordered_extent *ordered),
578 TP_ARGS(inode, ordered)
581 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start,
583 TP_PROTO(const struct btrfs_inode *inode,
584 const struct btrfs_ordered_extent *ordered),
586 TP_ARGS(inode, ordered)
589 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put,
591 TP_PROTO(const struct btrfs_inode *inode,
592 const struct btrfs_ordered_extent *ordered),
594 TP_ARGS(inode, ordered)
597 DECLARE_EVENT_CLASS(btrfs__writepage,
599 TP_PROTO(const struct page *page, const struct inode *inode,
600 const struct writeback_control *wbc),
602 TP_ARGS(page, inode, wbc),
604 TP_STRUCT__entry_btrfs(
606 __field( pgoff_t, index )
607 __field( long, nr_to_write )
608 __field( long, pages_skipped )
609 __field( loff_t, range_start )
610 __field( loff_t, range_end )
611 __field( char, for_kupdate )
612 __field( char, for_reclaim )
613 __field( char, range_cyclic )
614 __field( unsigned long, writeback_index )
615 __field( u64, root_objectid )
618 TP_fast_assign_btrfs(btrfs_sb(inode->i_sb),
619 __entry->ino = btrfs_ino(BTRFS_I(inode));
620 __entry->index = page->index;
621 __entry->nr_to_write = wbc->nr_to_write;
622 __entry->pages_skipped = wbc->pages_skipped;
623 __entry->range_start = wbc->range_start;
624 __entry->range_end = wbc->range_end;
625 __entry->for_kupdate = wbc->for_kupdate;
626 __entry->for_reclaim = wbc->for_reclaim;
627 __entry->range_cyclic = wbc->range_cyclic;
628 __entry->writeback_index = inode->i_mapping->writeback_index;
629 __entry->root_objectid =
630 BTRFS_I(inode)->root->root_key.objectid;
633 TP_printk_btrfs("root=%llu(%s) ino=%llu page_index=%lu "
634 "nr_to_write=%ld pages_skipped=%ld range_start=%llu "
635 "range_end=%llu for_kupdate=%d "
636 "for_reclaim=%d range_cyclic=%d writeback_index=%lu",
637 show_root_type(__entry->root_objectid),
638 __entry->ino, __entry->index,
639 __entry->nr_to_write, __entry->pages_skipped,
640 __entry->range_start, __entry->range_end,
641 __entry->for_kupdate,
642 __entry->for_reclaim, __entry->range_cyclic,
643 __entry->writeback_index)
646 DEFINE_EVENT(btrfs__writepage, __extent_writepage,
648 TP_PROTO(const struct page *page, const struct inode *inode,
649 const struct writeback_control *wbc),
651 TP_ARGS(page, inode, wbc)
654 TRACE_EVENT(btrfs_writepage_end_io_hook,
656 TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate),
658 TP_ARGS(page, start, end, uptodate),
660 TP_STRUCT__entry_btrfs(
662 __field( unsigned long, index )
663 __field( u64, start )
665 __field( int, uptodate )
666 __field( u64, root_objectid )
669 TP_fast_assign_btrfs(btrfs_sb(page->mapping->host->i_sb),
670 __entry->ino = btrfs_ino(BTRFS_I(page->mapping->host));
671 __entry->index = page->index;
672 __entry->start = start;
674 __entry->uptodate = uptodate;
675 __entry->root_objectid =
676 BTRFS_I(page->mapping->host)->root->root_key.objectid;
679 TP_printk_btrfs("root=%llu(%s) ino=%llu page_index=%lu start=%llu "
680 "end=%llu uptodate=%d",
681 show_root_type(__entry->root_objectid),
682 __entry->ino, __entry->index,
684 __entry->end, __entry->uptodate)
687 TRACE_EVENT(btrfs_sync_file,
689 TP_PROTO(const struct file *file, int datasync),
691 TP_ARGS(file, datasync),
693 TP_STRUCT__entry_btrfs(
695 __field( u64, parent )
696 __field( int, datasync )
697 __field( u64, root_objectid )
701 const struct dentry *dentry = file->f_path.dentry;
702 const struct inode *inode = d_inode(dentry);
704 TP_fast_assign_fsid(btrfs_sb(file->f_path.dentry->d_sb));
705 __entry->ino = btrfs_ino(BTRFS_I(inode));
706 __entry->parent = btrfs_ino(BTRFS_I(d_inode(dentry->d_parent)));
707 __entry->datasync = datasync;
708 __entry->root_objectid =
709 BTRFS_I(inode)->root->root_key.objectid;
712 TP_printk_btrfs("root=%llu(%s) ino=%llu parent=%llu datasync=%d",
713 show_root_type(__entry->root_objectid),
719 TRACE_EVENT(btrfs_sync_fs,
721 TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
723 TP_ARGS(fs_info, wait),
725 TP_STRUCT__entry_btrfs(
729 TP_fast_assign_btrfs(fs_info,
730 __entry->wait = wait;
733 TP_printk_btrfs("wait=%d", __entry->wait)
736 TRACE_EVENT(btrfs_add_block_group,
738 TP_PROTO(const struct btrfs_fs_info *fs_info,
739 const struct btrfs_block_group *block_group, int create),
741 TP_ARGS(fs_info, block_group, create),
743 TP_STRUCT__entry_btrfs(
744 __field( u64, offset )
746 __field( u64, flags )
747 __field( u64, bytes_used )
748 __field( u64, bytes_super )
749 __field( int, create )
752 TP_fast_assign_btrfs(fs_info,
753 __entry->offset = block_group->start;
754 __entry->size = block_group->length;
755 __entry->flags = block_group->flags;
756 __entry->bytes_used = block_group->used;
757 __entry->bytes_super = block_group->bytes_super;
758 __entry->create = create;
761 TP_printk_btrfs("block_group offset=%llu size=%llu "
762 "flags=%llu(%s) bytes_used=%llu bytes_super=%llu "
767 __print_flags((unsigned long)__entry->flags, "|",
770 __entry->bytes_super, __entry->create)
773 #define show_ref_action(action) \
774 __print_symbolic(action, \
775 { BTRFS_ADD_DELAYED_REF, "ADD_DELAYED_REF" }, \
776 { BTRFS_DROP_DELAYED_REF, "DROP_DELAYED_REF" }, \
777 { BTRFS_ADD_DELAYED_EXTENT, "ADD_DELAYED_EXTENT" }, \
778 { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" })
781 DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref,
783 TP_PROTO(const struct btrfs_fs_info *fs_info,
784 const struct btrfs_delayed_ref_node *ref,
785 const struct btrfs_delayed_tree_ref *full_ref,
788 TP_ARGS(fs_info, ref, full_ref, action),
790 TP_STRUCT__entry_btrfs(
791 __field( u64, bytenr )
792 __field( u64, num_bytes )
793 __field( int, action )
794 __field( u64, parent )
795 __field( u64, ref_root )
796 __field( int, level )
801 TP_fast_assign_btrfs(fs_info,
802 __entry->bytenr = ref->bytenr;
803 __entry->num_bytes = ref->num_bytes;
804 __entry->action = action;
805 __entry->parent = full_ref->parent;
806 __entry->ref_root = full_ref->root;
807 __entry->level = full_ref->level;
808 __entry->type = ref->type;
809 __entry->seq = ref->seq;
812 TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s "
813 "parent=%llu(%s) ref_root=%llu(%s) level=%d "
817 show_ref_action(__entry->action),
818 show_root_type(__entry->parent),
819 show_root_type(__entry->ref_root),
820 __entry->level, show_ref_type(__entry->type),
824 DEFINE_EVENT(btrfs_delayed_tree_ref, add_delayed_tree_ref,
826 TP_PROTO(const struct btrfs_fs_info *fs_info,
827 const struct btrfs_delayed_ref_node *ref,
828 const struct btrfs_delayed_tree_ref *full_ref,
831 TP_ARGS(fs_info, ref, full_ref, action)
834 DEFINE_EVENT(btrfs_delayed_tree_ref, run_delayed_tree_ref,
836 TP_PROTO(const struct btrfs_fs_info *fs_info,
837 const struct btrfs_delayed_ref_node *ref,
838 const struct btrfs_delayed_tree_ref *full_ref,
841 TP_ARGS(fs_info, ref, full_ref, action)
844 DECLARE_EVENT_CLASS(btrfs_delayed_data_ref,
846 TP_PROTO(const struct btrfs_fs_info *fs_info,
847 const struct btrfs_delayed_ref_node *ref,
848 const struct btrfs_delayed_data_ref *full_ref,
851 TP_ARGS(fs_info, ref, full_ref, action),
853 TP_STRUCT__entry_btrfs(
854 __field( u64, bytenr )
855 __field( u64, num_bytes )
856 __field( int, action )
857 __field( u64, parent )
858 __field( u64, ref_root )
859 __field( u64, owner )
860 __field( u64, offset )
865 TP_fast_assign_btrfs(fs_info,
866 __entry->bytenr = ref->bytenr;
867 __entry->num_bytes = ref->num_bytes;
868 __entry->action = action;
869 __entry->parent = full_ref->parent;
870 __entry->ref_root = full_ref->root;
871 __entry->owner = full_ref->objectid;
872 __entry->offset = full_ref->offset;
873 __entry->type = ref->type;
874 __entry->seq = ref->seq;
877 TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s "
878 "parent=%llu(%s) ref_root=%llu(%s) owner=%llu "
879 "offset=%llu type=%s seq=%llu",
882 show_ref_action(__entry->action),
883 show_root_type(__entry->parent),
884 show_root_type(__entry->ref_root),
887 show_ref_type(__entry->type),
891 DEFINE_EVENT(btrfs_delayed_data_ref, add_delayed_data_ref,
893 TP_PROTO(const struct btrfs_fs_info *fs_info,
894 const struct btrfs_delayed_ref_node *ref,
895 const struct btrfs_delayed_data_ref *full_ref,
898 TP_ARGS(fs_info, ref, full_ref, action)
901 DEFINE_EVENT(btrfs_delayed_data_ref, run_delayed_data_ref,
903 TP_PROTO(const struct btrfs_fs_info *fs_info,
904 const struct btrfs_delayed_ref_node *ref,
905 const struct btrfs_delayed_data_ref *full_ref,
908 TP_ARGS(fs_info, ref, full_ref, action)
911 DECLARE_EVENT_CLASS(btrfs_delayed_ref_head,
913 TP_PROTO(const struct btrfs_fs_info *fs_info,
914 const struct btrfs_delayed_ref_head *head_ref,
917 TP_ARGS(fs_info, head_ref, action),
919 TP_STRUCT__entry_btrfs(
920 __field( u64, bytenr )
921 __field( u64, num_bytes )
922 __field( int, action )
923 __field( int, is_data )
926 TP_fast_assign_btrfs(fs_info,
927 __entry->bytenr = head_ref->bytenr;
928 __entry->num_bytes = head_ref->num_bytes;
929 __entry->action = action;
930 __entry->is_data = head_ref->is_data;
933 TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s is_data=%d",
936 show_ref_action(__entry->action),
940 DEFINE_EVENT(btrfs_delayed_ref_head, add_delayed_ref_head,
942 TP_PROTO(const struct btrfs_fs_info *fs_info,
943 const struct btrfs_delayed_ref_head *head_ref,
946 TP_ARGS(fs_info, head_ref, action)
949 DEFINE_EVENT(btrfs_delayed_ref_head, run_delayed_ref_head,
951 TP_PROTO(const struct btrfs_fs_info *fs_info,
952 const struct btrfs_delayed_ref_head *head_ref,
955 TP_ARGS(fs_info, head_ref, action)
958 #define show_chunk_type(type) \
959 __print_flags(type, "|", \
960 { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \
961 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
962 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
963 { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \
964 { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \
965 { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \
966 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \
967 { BTRFS_BLOCK_GROUP_RAID5, "RAID5" }, \
968 { BTRFS_BLOCK_GROUP_RAID6, "RAID6" })
970 DECLARE_EVENT_CLASS(btrfs__chunk,
972 TP_PROTO(const struct btrfs_fs_info *fs_info,
973 const struct map_lookup *map, u64 offset, u64 size),
975 TP_ARGS(fs_info, map, offset, size),
977 TP_STRUCT__entry_btrfs(
978 __field( int, num_stripes )
980 __field( int, sub_stripes )
981 __field( u64, offset )
983 __field( u64, root_objectid )
986 TP_fast_assign_btrfs(fs_info,
987 __entry->num_stripes = map->num_stripes;
988 __entry->type = map->type;
989 __entry->sub_stripes = map->sub_stripes;
990 __entry->offset = offset;
991 __entry->size = size;
992 __entry->root_objectid = fs_info->chunk_root->root_key.objectid;
995 TP_printk_btrfs("root=%llu(%s) offset=%llu size=%llu "
996 "num_stripes=%d sub_stripes=%d type=%s",
997 show_root_type(__entry->root_objectid),
1000 __entry->num_stripes, __entry->sub_stripes,
1001 show_chunk_type(__entry->type))
1004 DEFINE_EVENT(btrfs__chunk, btrfs_chunk_alloc,
1006 TP_PROTO(const struct btrfs_fs_info *fs_info,
1007 const struct map_lookup *map, u64 offset, u64 size),
1009 TP_ARGS(fs_info, map, offset, size)
1012 DEFINE_EVENT(btrfs__chunk, btrfs_chunk_free,
1014 TP_PROTO(const struct btrfs_fs_info *fs_info,
1015 const struct map_lookup *map, u64 offset, u64 size),
1017 TP_ARGS(fs_info, map, offset, size)
1020 TRACE_EVENT(btrfs_cow_block,
1022 TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf,
1023 const struct extent_buffer *cow),
1025 TP_ARGS(root, buf, cow),
1027 TP_STRUCT__entry_btrfs(
1028 __field( u64, root_objectid )
1029 __field( u64, buf_start )
1030 __field( int, refs )
1031 __field( u64, cow_start )
1032 __field( int, buf_level )
1033 __field( int, cow_level )
1036 TP_fast_assign_btrfs(root->fs_info,
1037 __entry->root_objectid = root->root_key.objectid;
1038 __entry->buf_start = buf->start;
1039 __entry->refs = atomic_read(&buf->refs);
1040 __entry->cow_start = cow->start;
1041 __entry->buf_level = btrfs_header_level(buf);
1042 __entry->cow_level = btrfs_header_level(cow);
1045 TP_printk_btrfs("root=%llu(%s) refs=%d orig_buf=%llu "
1046 "(orig_level=%d) cow_buf=%llu (cow_level=%d)",
1047 show_root_type(__entry->root_objectid),
1055 TRACE_EVENT(btrfs_space_reservation,
1057 TP_PROTO(const struct btrfs_fs_info *fs_info, const char *type, u64 val,
1058 u64 bytes, int reserve),
1060 TP_ARGS(fs_info, type, val, bytes, reserve),
1062 TP_STRUCT__entry_btrfs(
1063 __string( type, type )
1065 __field( u64, bytes )
1066 __field( int, reserve )
1069 TP_fast_assign_btrfs(fs_info,
1070 __assign_str(type, type);
1072 __entry->bytes = bytes;
1073 __entry->reserve = reserve;
1076 TP_printk_btrfs("%s: %llu %s %llu", __get_str(type), __entry->val,
1077 __entry->reserve ? "reserve" : "release",
1081 TRACE_EVENT(btrfs_trigger_flush,
1083 TP_PROTO(const struct btrfs_fs_info *fs_info, u64 flags, u64 bytes,
1084 int flush, const char *reason),
1086 TP_ARGS(fs_info, flags, bytes, flush, reason),
1088 TP_STRUCT__entry_btrfs(
1089 __field( u64, flags )
1090 __field( u64, bytes )
1091 __field( int, flush )
1092 __string( reason, reason )
1095 TP_fast_assign_btrfs(fs_info,
1096 __entry->flags = flags;
1097 __entry->bytes = bytes;
1098 __entry->flush = flush;
1099 __assign_str(reason, reason)
1102 TP_printk_btrfs("%s: flush=%d(%s) flags=%llu(%s) bytes=%llu",
1103 __get_str(reason), __entry->flush,
1104 __print_symbolic(__entry->flush, FLUSH_ACTIONS),
1106 __print_flags((unsigned long)__entry->flags, "|",
1112 TRACE_EVENT(btrfs_flush_space,
1114 TP_PROTO(const struct btrfs_fs_info *fs_info, u64 flags, u64 num_bytes,
1115 int state, int ret),
1117 TP_ARGS(fs_info, flags, num_bytes, state, ret),
1119 TP_STRUCT__entry_btrfs(
1120 __field( u64, flags )
1121 __field( u64, num_bytes )
1122 __field( int, state )
1126 TP_fast_assign_btrfs(fs_info,
1127 __entry->flags = flags;
1128 __entry->num_bytes = num_bytes;
1129 __entry->state = state;
1133 TP_printk_btrfs("state=%d(%s) flags=%llu(%s) num_bytes=%llu ret=%d",
1135 __print_symbolic(__entry->state, FLUSH_STATES),
1137 __print_flags((unsigned long)__entry->flags, "|",
1139 __entry->num_bytes, __entry->ret)
1142 DECLARE_EVENT_CLASS(btrfs__reserved_extent,
1144 TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len),
1146 TP_ARGS(fs_info, start, len),
1148 TP_STRUCT__entry_btrfs(
1149 __field( u64, start )
1153 TP_fast_assign_btrfs(fs_info,
1154 __entry->start = start;
1158 TP_printk_btrfs("root=%llu(%s) start=%llu len=%llu",
1159 show_root_type(BTRFS_EXTENT_TREE_OBJECTID),
1164 DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1166 TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len),
1168 TP_ARGS(fs_info, start, len)
1171 DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free,
1173 TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len),
1175 TP_ARGS(fs_info, start, len)
1178 TRACE_EVENT(find_free_extent,
1180 TP_PROTO(const struct btrfs_root *root, u64 num_bytes,
1181 u64 empty_size, u64 data),
1183 TP_ARGS(root, num_bytes, empty_size, data),
1185 TP_STRUCT__entry_btrfs(
1186 __field( u64, root_objectid )
1187 __field( u64, num_bytes )
1188 __field( u64, empty_size )
1189 __field( u64, data )
1192 TP_fast_assign_btrfs(root->fs_info,
1193 __entry->root_objectid = root->root_key.objectid;
1194 __entry->num_bytes = num_bytes;
1195 __entry->empty_size = empty_size;
1196 __entry->data = data;
1199 TP_printk_btrfs("root=%llu(%s) len=%llu empty_size=%llu flags=%llu(%s)",
1200 show_root_type(__entry->root_objectid),
1201 __entry->num_bytes, __entry->empty_size, __entry->data,
1202 __print_flags((unsigned long)__entry->data, "|",
1206 DECLARE_EVENT_CLASS(btrfs__reserve_extent,
1208 TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
1211 TP_ARGS(block_group, start, len),
1213 TP_STRUCT__entry_btrfs(
1214 __field( u64, bg_objectid )
1215 __field( u64, flags )
1216 __field( u64, start )
1220 TP_fast_assign_btrfs(block_group->fs_info,
1221 __entry->bg_objectid = block_group->start;
1222 __entry->flags = block_group->flags;
1223 __entry->start = start;
1227 TP_printk_btrfs("root=%llu(%s) block_group=%llu flags=%llu(%s) "
1228 "start=%llu len=%llu",
1229 show_root_type(BTRFS_EXTENT_TREE_OBJECTID),
1230 __entry->bg_objectid,
1231 __entry->flags, __print_flags((unsigned long)__entry->flags,
1232 "|", BTRFS_GROUP_FLAGS),
1233 __entry->start, __entry->len)
1236 DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent,
1238 TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
1241 TP_ARGS(block_group, start, len)
1244 DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1246 TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
1249 TP_ARGS(block_group, start, len)
1252 TRACE_EVENT(btrfs_find_cluster,
1254 TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
1255 u64 bytes, u64 empty_size, u64 min_bytes),
1257 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1259 TP_STRUCT__entry_btrfs(
1260 __field( u64, bg_objectid )
1261 __field( u64, flags )
1262 __field( u64, start )
1263 __field( u64, bytes )
1264 __field( u64, empty_size )
1265 __field( u64, min_bytes )
1268 TP_fast_assign_btrfs(block_group->fs_info,
1269 __entry->bg_objectid = block_group->start;
1270 __entry->flags = block_group->flags;
1271 __entry->start = start;
1272 __entry->bytes = bytes;
1273 __entry->empty_size = empty_size;
1274 __entry->min_bytes = min_bytes;
1277 TP_printk_btrfs("block_group=%llu flags=%llu(%s) start=%llu len=%llu "
1278 "empty_size=%llu min_bytes=%llu", __entry->bg_objectid,
1280 __print_flags((unsigned long)__entry->flags, "|",
1281 BTRFS_GROUP_FLAGS), __entry->start,
1282 __entry->bytes, __entry->empty_size, __entry->min_bytes)
1285 TRACE_EVENT(btrfs_failed_cluster_setup,
1287 TP_PROTO(const struct btrfs_block_group *block_group),
1289 TP_ARGS(block_group),
1291 TP_STRUCT__entry_btrfs(
1292 __field( u64, bg_objectid )
1295 TP_fast_assign_btrfs(block_group->fs_info,
1296 __entry->bg_objectid = block_group->start;
1299 TP_printk_btrfs("block_group=%llu", __entry->bg_objectid)
1302 TRACE_EVENT(btrfs_setup_cluster,
1304 TP_PROTO(const struct btrfs_block_group *block_group,
1305 const struct btrfs_free_cluster *cluster,
1306 u64 size, int bitmap),
1308 TP_ARGS(block_group, cluster, size, bitmap),
1310 TP_STRUCT__entry_btrfs(
1311 __field( u64, bg_objectid )
1312 __field( u64, flags )
1313 __field( u64, start )
1314 __field( u64, max_size )
1315 __field( u64, size )
1316 __field( int, bitmap )
1319 TP_fast_assign_btrfs(block_group->fs_info,
1320 __entry->bg_objectid = block_group->start;
1321 __entry->flags = block_group->flags;
1322 __entry->start = cluster->window_start;
1323 __entry->max_size = cluster->max_size;
1324 __entry->size = size;
1325 __entry->bitmap = bitmap;
1328 TP_printk_btrfs("block_group=%llu flags=%llu(%s) window_start=%llu "
1329 "size=%llu max_size=%llu bitmap=%d",
1330 __entry->bg_objectid,
1332 __print_flags((unsigned long)__entry->flags, "|",
1333 BTRFS_GROUP_FLAGS), __entry->start,
1334 __entry->size, __entry->max_size, __entry->bitmap)
1337 struct extent_state;
1338 TRACE_EVENT(alloc_extent_state,
1340 TP_PROTO(const struct extent_state *state,
1341 gfp_t mask, unsigned long IP),
1343 TP_ARGS(state, mask, IP),
1346 __field(const struct extent_state *, state)
1347 __field(gfp_t, mask)
1348 __field(const void*, ip)
1352 __entry->state = state,
1353 __entry->mask = mask,
1354 __entry->ip = (const void *)IP
1357 TP_printk("state=%p mask=%s caller=%pS", __entry->state,
1358 show_gfp_flags(__entry->mask), __entry->ip)
1361 TRACE_EVENT(free_extent_state,
1363 TP_PROTO(const struct extent_state *state, unsigned long IP),
1368 __field(const struct extent_state *, state)
1369 __field(const void*, ip)
1373 __entry->state = state,
1374 __entry->ip = (const void *)IP
1377 TP_printk("state=%p caller=%pS", __entry->state, __entry->ip)
1380 DECLARE_EVENT_CLASS(btrfs__work,
1382 TP_PROTO(const struct btrfs_work *work),
1386 TP_STRUCT__entry_btrfs(
1387 __field( const void *, work )
1388 __field( const void *, wq )
1389 __field( const void *, func )
1390 __field( const void *, ordered_func )
1391 __field( const void *, ordered_free )
1392 __field( const void *, normal_work )
1395 TP_fast_assign_btrfs(btrfs_work_owner(work),
1396 __entry->work = work;
1397 __entry->wq = work->wq;
1398 __entry->func = work->func;
1399 __entry->ordered_func = work->ordered_func;
1400 __entry->ordered_free = work->ordered_free;
1401 __entry->normal_work = &work->normal_work;
1404 TP_printk_btrfs("work=%p (normal_work=%p) wq=%p func=%ps ordered_func=%p "
1406 __entry->work, __entry->normal_work, __entry->wq,
1407 __entry->func, __entry->ordered_func, __entry->ordered_free)
1411 * For situations when the work is freed, we pass fs_info and a tag that matches
1412 * the address of the work structure so it can be paired with the scheduling
1413 * event. DO NOT add anything here that dereferences wtag.
1415 DECLARE_EVENT_CLASS(btrfs__work__done,
1417 TP_PROTO(const struct btrfs_fs_info *fs_info, const void *wtag),
1419 TP_ARGS(fs_info, wtag),
1421 TP_STRUCT__entry_btrfs(
1422 __field( const void *, wtag )
1425 TP_fast_assign_btrfs(fs_info,
1426 __entry->wtag = wtag;
1429 TP_printk_btrfs("work->%p", __entry->wtag)
1432 DEFINE_EVENT(btrfs__work, btrfs_work_queued,
1434 TP_PROTO(const struct btrfs_work *work),
1439 DEFINE_EVENT(btrfs__work, btrfs_work_sched,
1441 TP_PROTO(const struct btrfs_work *work),
1446 DEFINE_EVENT(btrfs__work__done, btrfs_all_work_done,
1448 TP_PROTO(const struct btrfs_fs_info *fs_info, const void *wtag),
1450 TP_ARGS(fs_info, wtag)
1453 DEFINE_EVENT(btrfs__work, btrfs_ordered_sched,
1455 TP_PROTO(const struct btrfs_work *work),
1460 DECLARE_EVENT_CLASS(btrfs__workqueue,
1462 TP_PROTO(const struct __btrfs_workqueue *wq,
1463 const char *name, int high),
1465 TP_ARGS(wq, name, high),
1467 TP_STRUCT__entry_btrfs(
1468 __field( const void *, wq )
1469 __string( name, name )
1470 __field( int , high )
1473 TP_fast_assign_btrfs(btrfs_workqueue_owner(wq),
1475 __assign_str(name, name);
1476 __entry->high = high;
1479 TP_printk_btrfs("name=%s%s wq=%p", __get_str(name),
1480 __print_flags(__entry->high, "",
1481 {(WQ_HIGHPRI), "-high"}),
1485 DEFINE_EVENT(btrfs__workqueue, btrfs_workqueue_alloc,
1487 TP_PROTO(const struct __btrfs_workqueue *wq,
1488 const char *name, int high),
1490 TP_ARGS(wq, name, high)
1493 DECLARE_EVENT_CLASS(btrfs__workqueue_done,
1495 TP_PROTO(const struct __btrfs_workqueue *wq),
1499 TP_STRUCT__entry_btrfs(
1500 __field( const void *, wq )
1503 TP_fast_assign_btrfs(btrfs_workqueue_owner(wq),
1507 TP_printk_btrfs("wq=%p", __entry->wq)
1510 DEFINE_EVENT(btrfs__workqueue_done, btrfs_workqueue_destroy,
1512 TP_PROTO(const struct __btrfs_workqueue *wq),
1517 #define BTRFS_QGROUP_OPERATIONS \
1518 { QGROUP_RESERVE, "reserve" }, \
1519 { QGROUP_RELEASE, "release" }, \
1520 { QGROUP_FREE, "free" }
1522 DECLARE_EVENT_CLASS(btrfs__qgroup_rsv_data,
1524 TP_PROTO(const struct inode *inode, u64 start, u64 len,
1525 u64 reserved, int op),
1527 TP_ARGS(inode, start, len, reserved, op),
1529 TP_STRUCT__entry_btrfs(
1530 __field( u64, rootid )
1532 __field( u64, start )
1534 __field( u64, reserved )
1538 TP_fast_assign_btrfs(btrfs_sb(inode->i_sb),
1540 BTRFS_I(inode)->root->root_key.objectid;
1541 __entry->ino = btrfs_ino(BTRFS_I(inode));
1542 __entry->start = start;
1544 __entry->reserved = reserved;
1548 TP_printk_btrfs("root=%llu ino=%llu start=%llu len=%llu reserved=%llu op=%s",
1549 __entry->rootid, __entry->ino, __entry->start, __entry->len,
1551 __print_flags((unsigned long)__entry->op, "",
1552 BTRFS_QGROUP_OPERATIONS)
1556 DEFINE_EVENT(btrfs__qgroup_rsv_data, btrfs_qgroup_reserve_data,
1558 TP_PROTO(const struct inode *inode, u64 start, u64 len,
1559 u64 reserved, int op),
1561 TP_ARGS(inode, start, len, reserved, op)
1564 DEFINE_EVENT(btrfs__qgroup_rsv_data, btrfs_qgroup_release_data,
1566 TP_PROTO(const struct inode *inode, u64 start, u64 len,
1567 u64 reserved, int op),
1569 TP_ARGS(inode, start, len, reserved, op)
1572 DECLARE_EVENT_CLASS(btrfs_qgroup_extent,
1573 TP_PROTO(const struct btrfs_fs_info *fs_info,
1574 const struct btrfs_qgroup_extent_record *rec),
1576 TP_ARGS(fs_info, rec),
1578 TP_STRUCT__entry_btrfs(
1579 __field( u64, bytenr )
1580 __field( u64, num_bytes )
1583 TP_fast_assign_btrfs(fs_info,
1584 __entry->bytenr = rec->bytenr,
1585 __entry->num_bytes = rec->num_bytes;
1588 TP_printk_btrfs("bytenr=%llu num_bytes=%llu",
1589 __entry->bytenr, __entry->num_bytes)
1592 DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_account_extents,
1594 TP_PROTO(const struct btrfs_fs_info *fs_info,
1595 const struct btrfs_qgroup_extent_record *rec),
1597 TP_ARGS(fs_info, rec)
1600 DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_trace_extent,
1602 TP_PROTO(const struct btrfs_fs_info *fs_info,
1603 const struct btrfs_qgroup_extent_record *rec),
1605 TP_ARGS(fs_info, rec)
1608 TRACE_EVENT(qgroup_num_dirty_extents,
1610 TP_PROTO(const struct btrfs_fs_info *fs_info, u64 transid,
1611 u64 num_dirty_extents),
1613 TP_ARGS(fs_info, transid, num_dirty_extents),
1615 TP_STRUCT__entry_btrfs(
1616 __field( u64, transid )
1617 __field( u64, num_dirty_extents )
1620 TP_fast_assign_btrfs(fs_info,
1621 __entry->transid = transid;
1622 __entry->num_dirty_extents = num_dirty_extents;
1625 TP_printk_btrfs("transid=%llu num_dirty_extents=%llu",
1626 __entry->transid, __entry->num_dirty_extents)
1629 TRACE_EVENT(btrfs_qgroup_account_extent,
1631 TP_PROTO(const struct btrfs_fs_info *fs_info, u64 transid, u64 bytenr,
1632 u64 num_bytes, u64 nr_old_roots, u64 nr_new_roots),
1634 TP_ARGS(fs_info, transid, bytenr, num_bytes, nr_old_roots,
1637 TP_STRUCT__entry_btrfs(
1638 __field( u64, transid )
1639 __field( u64, bytenr )
1640 __field( u64, num_bytes )
1641 __field( u64, nr_old_roots )
1642 __field( u64, nr_new_roots )
1645 TP_fast_assign_btrfs(fs_info,
1646 __entry->transid = transid;
1647 __entry->bytenr = bytenr;
1648 __entry->num_bytes = num_bytes;
1649 __entry->nr_old_roots = nr_old_roots;
1650 __entry->nr_new_roots = nr_new_roots;
1654 "transid=%llu bytenr=%llu num_bytes=%llu nr_old_roots=%llu nr_new_roots=%llu",
1658 __entry->nr_old_roots,
1659 __entry->nr_new_roots)
1662 TRACE_EVENT(qgroup_update_counters,
1664 TP_PROTO(const struct btrfs_fs_info *fs_info,
1665 const struct btrfs_qgroup *qgroup,
1666 u64 cur_old_count, u64 cur_new_count),
1668 TP_ARGS(fs_info, qgroup, cur_old_count, cur_new_count),
1670 TP_STRUCT__entry_btrfs(
1671 __field( u64, qgid )
1672 __field( u64, old_rfer )
1673 __field( u64, old_excl )
1674 __field( u64, cur_old_count )
1675 __field( u64, cur_new_count )
1678 TP_fast_assign_btrfs(fs_info,
1679 __entry->qgid = qgroup->qgroupid;
1680 __entry->old_rfer = qgroup->rfer;
1681 __entry->old_excl = qgroup->excl;
1682 __entry->cur_old_count = cur_old_count;
1683 __entry->cur_new_count = cur_new_count;
1686 TP_printk_btrfs("qgid=%llu old_rfer=%llu old_excl=%llu cur_old_count=%llu cur_new_count=%llu",
1687 __entry->qgid, __entry->old_rfer, __entry->old_excl,
1688 __entry->cur_old_count, __entry->cur_new_count)
1691 TRACE_EVENT(qgroup_update_reserve,
1693 TP_PROTO(struct btrfs_fs_info *fs_info, struct btrfs_qgroup *qgroup,
1694 s64 diff, int type),
1696 TP_ARGS(fs_info, qgroup, diff, type),
1698 TP_STRUCT__entry_btrfs(
1699 __field( u64, qgid )
1700 __field( u64, cur_reserved )
1701 __field( s64, diff )
1702 __field( int, type )
1705 TP_fast_assign_btrfs(fs_info,
1706 __entry->qgid = qgroup->qgroupid;
1707 __entry->cur_reserved = qgroup->rsv.values[type];
1708 __entry->diff = diff;
1709 __entry->type = type;
1712 TP_printk_btrfs("qgid=%llu type=%s cur_reserved=%llu diff=%lld",
1713 __entry->qgid, __print_symbolic(__entry->type, QGROUP_RSV_TYPES),
1714 __entry->cur_reserved, __entry->diff)
1717 TRACE_EVENT(qgroup_meta_reserve,
1719 TP_PROTO(struct btrfs_root *root, s64 diff, int type),
1721 TP_ARGS(root, diff, type),
1723 TP_STRUCT__entry_btrfs(
1724 __field( u64, refroot )
1725 __field( s64, diff )
1726 __field( int, type )
1729 TP_fast_assign_btrfs(root->fs_info,
1730 __entry->refroot = root->root_key.objectid;
1731 __entry->diff = diff;
1732 __entry->type = type;
1735 TP_printk_btrfs("refroot=%llu(%s) type=%s diff=%lld",
1736 show_root_type(__entry->refroot),
1737 __print_symbolic(__entry->type, QGROUP_RSV_TYPES), __entry->diff)
1740 TRACE_EVENT(qgroup_meta_convert,
1742 TP_PROTO(struct btrfs_root *root, s64 diff),
1744 TP_ARGS(root, diff),
1746 TP_STRUCT__entry_btrfs(
1747 __field( u64, refroot )
1748 __field( s64, diff )
1751 TP_fast_assign_btrfs(root->fs_info,
1752 __entry->refroot = root->root_key.objectid;
1753 __entry->diff = diff;
1756 TP_printk_btrfs("refroot=%llu(%s) type=%s->%s diff=%lld",
1757 show_root_type(__entry->refroot),
1758 __print_symbolic(BTRFS_QGROUP_RSV_META_PREALLOC, QGROUP_RSV_TYPES),
1759 __print_symbolic(BTRFS_QGROUP_RSV_META_PERTRANS, QGROUP_RSV_TYPES),
1763 TRACE_EVENT(qgroup_meta_free_all_pertrans,
1765 TP_PROTO(struct btrfs_root *root),
1769 TP_STRUCT__entry_btrfs(
1770 __field( u64, refroot )
1771 __field( s64, diff )
1772 __field( int, type )
1775 TP_fast_assign_btrfs(root->fs_info,
1776 __entry->refroot = root->root_key.objectid;
1777 spin_lock(&root->qgroup_meta_rsv_lock);
1778 __entry->diff = -(s64)root->qgroup_meta_rsv_pertrans;
1779 spin_unlock(&root->qgroup_meta_rsv_lock);
1780 __entry->type = BTRFS_QGROUP_RSV_META_PERTRANS;
1783 TP_printk_btrfs("refroot=%llu(%s) type=%s diff=%lld",
1784 show_root_type(__entry->refroot),
1785 __print_symbolic(__entry->type, QGROUP_RSV_TYPES), __entry->diff)
1788 DECLARE_EVENT_CLASS(btrfs__prelim_ref,
1789 TP_PROTO(const struct btrfs_fs_info *fs_info,
1790 const struct prelim_ref *oldref,
1791 const struct prelim_ref *newref, u64 tree_size),
1792 TP_ARGS(fs_info, newref, oldref, tree_size),
1794 TP_STRUCT__entry_btrfs(
1795 __field( u64, root_id )
1796 __field( u64, objectid )
1798 __field( u64, offset )
1799 __field( int, level )
1800 __field( int, old_count )
1801 __field( u64, parent )
1802 __field( u64, bytenr )
1803 __field( int, mod_count )
1804 __field( u64, tree_size )
1807 TP_fast_assign_btrfs(fs_info,
1808 __entry->root_id = oldref->root_id;
1809 __entry->objectid = oldref->key_for_search.objectid;
1810 __entry->type = oldref->key_for_search.type;
1811 __entry->offset = oldref->key_for_search.offset;
1812 __entry->level = oldref->level;
1813 __entry->old_count = oldref->count;
1814 __entry->parent = oldref->parent;
1815 __entry->bytenr = oldref->wanted_disk_byte;
1816 __entry->mod_count = newref ? newref->count : 0;
1817 __entry->tree_size = tree_size;
1820 TP_printk_btrfs("root_id=%llu key=[%llu,%u,%llu] level=%d count=[%d+%d=%d] parent=%llu wanted_disk_byte=%llu nodes=%llu",
1822 __entry->objectid, __entry->type,
1823 __entry->offset, __entry->level,
1824 __entry->old_count, __entry->mod_count,
1825 __entry->old_count + __entry->mod_count,
1831 DEFINE_EVENT(btrfs__prelim_ref, btrfs_prelim_ref_merge,
1832 TP_PROTO(const struct btrfs_fs_info *fs_info,
1833 const struct prelim_ref *oldref,
1834 const struct prelim_ref *newref, u64 tree_size),
1835 TP_ARGS(fs_info, oldref, newref, tree_size)
1838 DEFINE_EVENT(btrfs__prelim_ref, btrfs_prelim_ref_insert,
1839 TP_PROTO(const struct btrfs_fs_info *fs_info,
1840 const struct prelim_ref *oldref,
1841 const struct prelim_ref *newref, u64 tree_size),
1842 TP_ARGS(fs_info, oldref, newref, tree_size)
1845 TRACE_EVENT(btrfs_inode_mod_outstanding_extents,
1846 TP_PROTO(const struct btrfs_root *root, u64 ino, int mod),
1848 TP_ARGS(root, ino, mod),
1850 TP_STRUCT__entry_btrfs(
1851 __field( u64, root_objectid )
1856 TP_fast_assign_btrfs(root->fs_info,
1857 __entry->root_objectid = root->root_key.objectid;
1862 TP_printk_btrfs("root=%llu(%s) ino=%llu mod=%d",
1863 show_root_type(__entry->root_objectid),
1864 __entry->ino, __entry->mod)
1867 DECLARE_EVENT_CLASS(btrfs__block_group,
1868 TP_PROTO(const struct btrfs_block_group *bg_cache),
1872 TP_STRUCT__entry_btrfs(
1873 __field( u64, bytenr )
1875 __field( u64, used )
1876 __field( u64, flags )
1879 TP_fast_assign_btrfs(bg_cache->fs_info,
1880 __entry->bytenr = bg_cache->start,
1881 __entry->len = bg_cache->length,
1882 __entry->used = bg_cache->used;
1883 __entry->flags = bg_cache->flags;
1886 TP_printk_btrfs("bg bytenr=%llu len=%llu used=%llu flags=%llu(%s)",
1887 __entry->bytenr, __entry->len, __entry->used, __entry->flags,
1888 __print_flags(__entry->flags, "|", BTRFS_GROUP_FLAGS))
1891 DEFINE_EVENT(btrfs__block_group, btrfs_remove_block_group,
1892 TP_PROTO(const struct btrfs_block_group *bg_cache),
1897 DEFINE_EVENT(btrfs__block_group, btrfs_add_unused_block_group,
1898 TP_PROTO(const struct btrfs_block_group *bg_cache),
1903 DEFINE_EVENT(btrfs__block_group, btrfs_skip_unused_block_group,
1904 TP_PROTO(const struct btrfs_block_group *bg_cache),
1909 TRACE_EVENT(btrfs_set_extent_bit,
1910 TP_PROTO(const struct extent_io_tree *tree,
1911 u64 start, u64 len, unsigned set_bits),
1913 TP_ARGS(tree, start, len, set_bits),
1915 TP_STRUCT__entry_btrfs(
1916 __field( unsigned, owner )
1918 __field( u64, rootid )
1919 __field( u64, start )
1921 __field( unsigned, set_bits)
1924 TP_fast_assign_btrfs(tree->fs_info,
1925 __entry->owner = tree->owner;
1926 if (tree->private_data) {
1927 const struct inode *inode = tree->private_data;
1929 __entry->ino = btrfs_ino(BTRFS_I(inode));
1931 BTRFS_I(inode)->root->root_key.objectid;
1934 __entry->rootid = 0;
1936 __entry->start = start;
1938 __entry->set_bits = set_bits;
1942 "io_tree=%s ino=%llu root=%llu start=%llu len=%llu set_bits=%s",
1943 __print_symbolic(__entry->owner, IO_TREE_OWNER), __entry->ino,
1944 __entry->rootid, __entry->start, __entry->len,
1945 __print_flags(__entry->set_bits, "|", EXTENT_FLAGS))
1948 TRACE_EVENT(btrfs_clear_extent_bit,
1949 TP_PROTO(const struct extent_io_tree *tree,
1950 u64 start, u64 len, unsigned clear_bits),
1952 TP_ARGS(tree, start, len, clear_bits),
1954 TP_STRUCT__entry_btrfs(
1955 __field( unsigned, owner )
1957 __field( u64, rootid )
1958 __field( u64, start )
1960 __field( unsigned, clear_bits)
1963 TP_fast_assign_btrfs(tree->fs_info,
1964 __entry->owner = tree->owner;
1965 if (tree->private_data) {
1966 const struct inode *inode = tree->private_data;
1968 __entry->ino = btrfs_ino(BTRFS_I(inode));
1970 BTRFS_I(inode)->root->root_key.objectid;
1973 __entry->rootid = 0;
1975 __entry->start = start;
1977 __entry->clear_bits = clear_bits;
1981 "io_tree=%s ino=%llu root=%llu start=%llu len=%llu clear_bits=%s",
1982 __print_symbolic(__entry->owner, IO_TREE_OWNER), __entry->ino,
1983 __entry->rootid, __entry->start, __entry->len,
1984 __print_flags(__entry->clear_bits, "|", EXTENT_FLAGS))
1987 TRACE_EVENT(btrfs_convert_extent_bit,
1988 TP_PROTO(const struct extent_io_tree *tree,
1989 u64 start, u64 len, unsigned set_bits, unsigned clear_bits),
1991 TP_ARGS(tree, start, len, set_bits, clear_bits),
1993 TP_STRUCT__entry_btrfs(
1994 __field( unsigned, owner )
1996 __field( u64, rootid )
1997 __field( u64, start )
1999 __field( unsigned, set_bits)
2000 __field( unsigned, clear_bits)
2003 TP_fast_assign_btrfs(tree->fs_info,
2004 __entry->owner = tree->owner;
2005 if (tree->private_data) {
2006 const struct inode *inode = tree->private_data;
2008 __entry->ino = btrfs_ino(BTRFS_I(inode));
2010 BTRFS_I(inode)->root->root_key.objectid;
2013 __entry->rootid = 0;
2015 __entry->start = start;
2017 __entry->set_bits = set_bits;
2018 __entry->clear_bits = clear_bits;
2022 "io_tree=%s ino=%llu root=%llu start=%llu len=%llu set_bits=%s clear_bits=%s",
2023 __print_symbolic(__entry->owner, IO_TREE_OWNER), __entry->ino,
2024 __entry->rootid, __entry->start, __entry->len,
2025 __print_flags(__entry->set_bits , "|", EXTENT_FLAGS),
2026 __print_flags(__entry->clear_bits, "|", EXTENT_FLAGS))
2029 DECLARE_EVENT_CLASS(btrfs_sleep_tree_lock,
2030 TP_PROTO(const struct extent_buffer *eb, u64 start_ns),
2032 TP_ARGS(eb, start_ns),
2034 TP_STRUCT__entry_btrfs(
2035 __field( u64, block )
2036 __field( u64, generation )
2037 __field( u64, start_ns )
2038 __field( u64, end_ns )
2039 __field( u64, diff_ns )
2040 __field( u64, owner )
2041 __field( int, is_log_tree )
2044 TP_fast_assign_btrfs(eb->fs_info,
2045 __entry->block = eb->start;
2046 __entry->generation = btrfs_header_generation(eb);
2047 __entry->start_ns = start_ns;
2048 __entry->end_ns = ktime_get_ns();
2049 __entry->diff_ns = __entry->end_ns - start_ns;
2050 __entry->owner = btrfs_header_owner(eb);
2051 __entry->is_log_tree = (eb->log_index >= 0);
2055 "block=%llu generation=%llu start_ns=%llu end_ns=%llu diff_ns=%llu owner=%llu is_log_tree=%d",
2056 __entry->block, __entry->generation,
2057 __entry->start_ns, __entry->end_ns, __entry->diff_ns,
2058 __entry->owner, __entry->is_log_tree)
2061 DEFINE_EVENT(btrfs_sleep_tree_lock, btrfs_tree_read_lock,
2062 TP_PROTO(const struct extent_buffer *eb, u64 start_ns),
2064 TP_ARGS(eb, start_ns)
2067 DEFINE_EVENT(btrfs_sleep_tree_lock, btrfs_tree_lock,
2068 TP_PROTO(const struct extent_buffer *eb, u64 start_ns),
2070 TP_ARGS(eb, start_ns)
2073 DECLARE_EVENT_CLASS(btrfs_locking_events,
2074 TP_PROTO(const struct extent_buffer *eb),
2078 TP_STRUCT__entry_btrfs(
2079 __field( u64, block )
2080 __field( u64, generation )
2081 __field( u64, owner )
2082 __field( int, is_log_tree )
2085 TP_fast_assign_btrfs(eb->fs_info,
2086 __entry->block = eb->start;
2087 __entry->generation = btrfs_header_generation(eb);
2088 __entry->owner = btrfs_header_owner(eb);
2089 __entry->is_log_tree = (eb->log_index >= 0);
2092 TP_printk_btrfs("block=%llu generation=%llu owner=%llu is_log_tree=%d",
2093 __entry->block, __entry->generation,
2094 __entry->owner, __entry->is_log_tree)
2097 #define DEFINE_BTRFS_LOCK_EVENT(name) \
2098 DEFINE_EVENT(btrfs_locking_events, name, \
2099 TP_PROTO(const struct extent_buffer *eb), \
2104 DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_unlock);
2105 DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_unlock);
2106 DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_unlock_blocking);
2107 DEFINE_BTRFS_LOCK_EVENT(btrfs_set_lock_blocking_read);
2108 DEFINE_BTRFS_LOCK_EVENT(btrfs_set_lock_blocking_write);
2109 DEFINE_BTRFS_LOCK_EVENT(btrfs_try_tree_read_lock);
2110 DEFINE_BTRFS_LOCK_EVENT(btrfs_try_tree_write_lock);
2111 DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_lock_atomic);
2113 DECLARE_EVENT_CLASS(btrfs__space_info_update,
2115 TP_PROTO(const struct btrfs_fs_info *fs_info,
2116 const struct btrfs_space_info *sinfo, u64 old, s64 diff),
2118 TP_ARGS(fs_info, sinfo, old, diff),
2120 TP_STRUCT__entry_btrfs(
2121 __field( u64, type )
2123 __field( s64, diff )
2126 TP_fast_assign_btrfs(fs_info,
2127 __entry->type = sinfo->flags;
2129 __entry->diff = diff;
2131 TP_printk_btrfs("type=%s old=%llu diff=%lld",
2132 __print_flags(__entry->type, "|", BTRFS_GROUP_FLAGS),
2133 __entry->old, __entry->diff)
2136 DEFINE_EVENT(btrfs__space_info_update, update_bytes_may_use,
2138 TP_PROTO(const struct btrfs_fs_info *fs_info,
2139 const struct btrfs_space_info *sinfo, u64 old, s64 diff),
2141 TP_ARGS(fs_info, sinfo, old, diff)
2144 DEFINE_EVENT(btrfs__space_info_update, update_bytes_pinned,
2146 TP_PROTO(const struct btrfs_fs_info *fs_info,
2147 const struct btrfs_space_info *sinfo, u64 old, s64 diff),
2149 TP_ARGS(fs_info, sinfo, old, diff)
2152 #endif /* _TRACE_BTRFS_H */
2154 /* This part must be outside protection */
2155 #include <trace/define_trace.h>