2 #define TRACE_SYSTEM btrfs
4 #if !defined(_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ)
25 #define show_ref_type(type) \
26 __print_symbolic(type, \
27 { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \
28 { BTRFS_EXTENT_DATA_REF_KEY, "EXTENT_DATA_REF" }, \
29 { BTRFS_EXTENT_REF_V0_KEY, "EXTENT_REF_V0" }, \
30 { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \
31 { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" })
33 #define __show_root_type(obj) \
34 __print_symbolic_u64(obj, \
35 { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \
36 { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \
37 { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \
38 { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \
39 { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \
40 { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \
41 { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \
42 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \
43 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \
44 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" })
46 #define show_root_type(obj) \
47 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \
48 (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-"
50 #define BTRFS_GROUP_FLAGS \
51 { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \
52 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
53 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
54 { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \
55 { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \
56 { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \
57 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}
59 #define BTRFS_UUID_SIZE 16
79 (
unsigned long long)
__entry->generation)
101 __entry->disk_i_size = BTRFS_I(inode)->disk_i_size;
102 __entry->generation = BTRFS_I(inode)->generation;
103 __entry->last_trans = BTRFS_I(inode)->last_trans;
104 __entry->logged_trans = BTRFS_I(inode)->logged_trans;
106 BTRFS_I(inode)->root->root_key.objectid;
109 TP_printk(
"root = %llu(%s), gen = %llu, ino = %lu, blocks = %llu, "
110 "disk_i_size = %llu, last_trans = %llu, logged_trans = %llu",
115 (
unsigned long long)
__entry->disk_i_size,
117 (
unsigned long long)
__entry->logged_trans)
141 #define __show_map_type(type) \
142 __print_symbolic_u64(type, \
143 { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \
144 { EXTENT_MAP_HOLE, "HOLE" }, \
145 { EXTENT_MAP_INLINE, "INLINE" }, \
146 { EXTENT_MAP_DELALLOC, "DELALLOC" })
148 #define show_map_type(type) \
149 type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" : __show_map_type(type)
151 #define show_map_flags(flag) \
152 __print_flags(flag, "|", \
153 { EXTENT_FLAG_PINNED, "PINNED" }, \
154 { EXTENT_FLAG_COMPRESSED, "COMPRESSED" }, \
155 { EXTENT_FLAG_VACANCY, "VACANCY" }, \
156 { EXTENT_FLAG_PREALLOC, "PREALLOC" })
173 __field(
unsigned int, compress_type )
188 TP_printk(
"root = %llu(%s), start = %llu, len = %llu, "
189 "orig_start = %llu, block_start = %llu(%s), "
190 "block_len = %llu, flags = %s, refs = %u, "
191 "compress_type = %u",
193 (
unsigned long long)
__entry->start,
194 (
unsigned long long)
__entry->len,
195 (
unsigned long long)
__entry->orig_start,
197 (
unsigned long long)
__entry->block_len,
202 #define show_ordered_flags(flags) \
203 __print_symbolic(flags, \
204 { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \
205 { BTRFS_ORDERED_COMPLETE, "COMPLETE" }, \
206 { BTRFS_ORDERED_NOCOW, "NOCOW" }, \
207 { BTRFS_ORDERED_COMPRESSED, "COMPRESSED" }, \
208 { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \
209 { BTRFS_ORDERED_DIRECT, "DIRECT" })
241 BTRFS_I(inode)->root->
root_key.objectid;
244 TP_printk(
"root = %llu(%s), ino = %llu, file_offset = %llu, "
245 "start = %llu, len = %llu, disk_len = %llu, "
246 "bytes_left = %llu, flags = %s, compress_type = %d, "
249 (
unsigned long long)
__entry->ino,
250 (
unsigned long long)
__entry->file_offset,
251 (
unsigned long long)
__entry->start,
252 (
unsigned long long)
__entry->len,
253 (
unsigned long long)
__entry->disk_len,
254 (
unsigned long long)
__entry->bytes_left,
259 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add,
266 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove,
273 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start,
280 DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put,
320 BTRFS_I(inode)->root->
root_key.objectid;
323 TP_printk(
"root = %llu(%s), ino = %lu, page_index = %lu, "
324 "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
325 "range_end = %llu, for_kupdate = %d, "
326 "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
333 (
unsigned long)
__entry->writeback_index)
338 TP_PROTO(
struct page *page,
struct inode *inode,
348 TP_ARGS(page, start, end, uptodate),
366 BTRFS_I(page->
mapping->host)->root->root_key.objectid;
369 TP_printk(
"root = %llu(%s), ino = %lu, page_index = %lu, start = %llu, "
370 "end = %llu, uptodate = %d",
373 (
unsigned long long)
__entry->start,
398 BTRFS_I(inode)->root->
root_key.objectid;
401 TP_printk(
"root = %llu(%s), ino = %ld, parent = %ld, datasync = %d",
424 #define show_ref_action(action) \
425 __print_symbolic(action, \
426 { BTRFS_ADD_DELAYED_REF, "ADD_DELAYED_REF" }, \
427 { BTRFS_DROP_DELAYED_REF, "DROP_DELAYED_REF" }, \
428 { BTRFS_ADD_DELAYED_EXTENT, "ADD_DELAYED_EXTENT" }, \
429 { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" })
438 TP_ARGS(ref, full_ref, action),
462 TP_printk(
"bytenr = %llu, num_bytes = %llu, action = %s, "
463 "parent = %llu(%s), ref_root = %llu(%s), level = %d, "
464 "type = %s, seq = %llu",
465 (
unsigned long long)
__entry->bytenr,
466 (
unsigned long long)
__entry->num_bytes,
471 (
unsigned long long)
__entry->seq)
480 TP_ARGS(ref, full_ref, action),
506 TP_printk(
"bytenr = %llu, num_bytes = %llu, action = %s, "
507 "parent = %llu(%s), ref_root = %llu(%s), owner = %llu, "
508 "offset = %llu, type = %s, seq = %llu",
509 (
unsigned long long)
__entry->bytenr,
510 (
unsigned long long)
__entry->num_bytes,
514 (
unsigned long long)
__entry->owner,
515 (
unsigned long long)
__entry->offset,
517 (
unsigned long long)
__entry->seq)
526 TP_ARGS(ref, head_ref, action),
542 TP_printk(
"bytenr = %llu, num_bytes = %llu, action = %s, is_data = %d",
543 (
unsigned long long)
__entry->bytenr,
544 (
unsigned long long)
__entry->num_bytes,
549 #define show_chunk_type(type) \
550 __print_flags(type, "|", \
551 { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \
552 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
553 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
554 { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \
555 { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \
556 { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \
557 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"})
564 TP_ARGS(root, map, offset, size),
584 TP_printk(
"root = %llu(%s), offset = %llu, size = %llu, "
585 "num_stripes = %d, sub_stripes = %d, type = %s",
587 (
unsigned long long)
__entry->offset,
588 (
unsigned long long)
__entry->size,
598 TP_ARGS(root, map, offset, size)
606 TP_ARGS(root, map, offset, size)
630 __entry->buf_level = btrfs_header_level(buf);
631 __entry->cow_level = btrfs_header_level(cow);
634 TP_printk(
"root = %llu(%s), refs = %d, orig_buf = %llu "
635 "(orig_level = %d), cow_buf = %llu (cow_level = %d)",
640 (
unsigned long long)
__entry->cow_start,
649 TP_ARGS(fs_info, type, val, bytes, reserve),
690 TP_printk(
"root = %llu(%s), start = %llu, len = %llu",
692 (
unsigned long long)
__entry->start,
693 (
unsigned long long)
__entry->len)
696 DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
703 DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free,
715 TP_ARGS(root, num_bytes, empty_size, data),
726 __entry->num_bytes = num_bytes;
727 __entry->empty_size = empty_size;
731 TP_printk(
"root = %Lu(%s), len = %Lu, empty_size = %Lu, "
744 TP_ARGS(root, block_group, start, len),
756 __entry->bg_objectid = block_group->
key.objectid;
762 TP_printk(
"root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), "
763 "start = %Lu, len = %Lu",
776 TP_ARGS(root, block_group, start, len)
779 DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
785 TP_ARGS(root, block_group, start, len)
791 u64 bytes,
u64 empty_size,
u64 min_bytes),
793 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
805 __entry->bg_objectid = block_group->
key.objectid;
809 __entry->empty_size = empty_size;
810 __entry->min_bytes = min_bytes;
813 TP_printk(
"block_group = %Lu, flags = %Lu(%s), start = %Lu, len = %Lu,"
814 " empty_size = %Lu, min_bytes = %Lu",
__entry->bg_objectid,
832 __entry->bg_objectid = block_group->
key.objectid;
843 TP_ARGS(block_group, cluster, size, bitmap),
855 __entry->bg_objectid = block_group->
key.objectid;
863 TP_printk(
"block_group = %Lu, flags = %Lu(%s), window_start = %Lu, "
864 "size = %Lu, max_size = %Lu, bitmap = %d",