11abe9b8aSliubo #undef TRACE_SYSTEM 21abe9b8aSliubo #define TRACE_SYSTEM btrfs 31abe9b8aSliubo 41abe9b8aSliubo #if !defined(_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ) 51abe9b8aSliubo #define _TRACE_BTRFS_H 61abe9b8aSliubo 71abe9b8aSliubo #include <linux/writeback.h> 81abe9b8aSliubo #include <linux/tracepoint.h> 9420adbe9SVlastimil Babka #include <trace/events/mmflags.h> 101abe9b8aSliubo 111abe9b8aSliubo struct btrfs_root; 121abe9b8aSliubo struct btrfs_fs_info; 131abe9b8aSliubo struct btrfs_inode; 141abe9b8aSliubo struct extent_map; 151abe9b8aSliubo struct btrfs_ordered_extent; 161abe9b8aSliubo struct btrfs_delayed_ref_node; 171abe9b8aSliubo struct btrfs_delayed_tree_ref; 181abe9b8aSliubo struct btrfs_delayed_data_ref; 191abe9b8aSliubo struct btrfs_delayed_ref_head; 203f7de037SJosef Bacik struct btrfs_block_group_cache; 213f7de037SJosef Bacik struct btrfs_free_cluster; 221abe9b8aSliubo struct map_lookup; 231abe9b8aSliubo struct extent_buffer; 2452483bc2SQu Wenruo struct btrfs_work; 25c3a46891SQu Wenruo struct __btrfs_workqueue; 260f5dcf8dSMark Fasheh struct btrfs_qgroup_extent_record; 271abe9b8aSliubo 281abe9b8aSliubo #define show_ref_type(type) \ 291abe9b8aSliubo __print_symbolic(type, \ 301abe9b8aSliubo { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \ 311abe9b8aSliubo { BTRFS_EXTENT_DATA_REF_KEY, "EXTENT_DATA_REF" }, \ 321abe9b8aSliubo { BTRFS_EXTENT_REF_V0_KEY, "EXTENT_REF_V0" }, \ 331abe9b8aSliubo { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \ 341abe9b8aSliubo { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" }) 351abe9b8aSliubo 361abe9b8aSliubo #define __show_root_type(obj) \ 377f34b746Sliubo __print_symbolic_u64(obj, \ 381abe9b8aSliubo { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \ 391abe9b8aSliubo { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \ 401abe9b8aSliubo { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \ 411abe9b8aSliubo { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \ 421abe9b8aSliubo { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \ 431abe9b8aSliubo { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \ 441abe9b8aSliubo { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \ 451abe9b8aSliubo { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \ 46e112e2b4SLiu Bo { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \ 471abe9b8aSliubo { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \ 48208acb8cSOmar Sandoval { BTRFS_UUID_TREE_OBJECTID, "UUID_TREE" }, \ 49208acb8cSOmar Sandoval { BTRFS_FREE_SPACE_TREE_OBJECTID, "FREE_SPACE_TREE" }, \ 501abe9b8aSliubo { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" }) 511abe9b8aSliubo 521abe9b8aSliubo #define show_root_type(obj) \ 531abe9b8aSliubo obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \ 54fb57dc81SLiu Bo (obj >= BTRFS_ROOT_TREE_OBJECTID && \ 55e112e2b4SLiu Bo obj <= BTRFS_QUOTA_TREE_OBJECTID)) ? __show_root_type(obj) : "-" 561abe9b8aSliubo 573f7de037SJosef Bacik #define BTRFS_GROUP_FLAGS \ 583f7de037SJosef Bacik { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \ 593f7de037SJosef Bacik { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \ 603f7de037SJosef Bacik { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \ 613f7de037SJosef Bacik { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \ 623f7de037SJosef Bacik { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \ 633f7de037SJosef Bacik { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \ 64e112e2b4SLiu Bo { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \ 65e112e2b4SLiu Bo { BTRFS_BLOCK_GROUP_RAID5, "RAID5"}, \ 66e112e2b4SLiu Bo { BTRFS_BLOCK_GROUP_RAID6, "RAID6"} 673f7de037SJosef Bacik 688c2a3ca2SJosef Bacik #define BTRFS_UUID_SIZE 16 69bc074524SJeff Mahoney #define TP_STRUCT__entry_fsid __array(u8, fsid, BTRFS_UUID_SIZE) 70bc074524SJeff Mahoney 71bc074524SJeff Mahoney #define TP_fast_assign_fsid(fs_info) \ 72bc074524SJeff Mahoney memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE) 73bc074524SJeff Mahoney 74bc074524SJeff Mahoney #define TP_STRUCT__entry_btrfs(args...) \ 75bc074524SJeff Mahoney TP_STRUCT__entry( \ 76bc074524SJeff Mahoney TP_STRUCT__entry_fsid \ 77bc074524SJeff Mahoney args) 78bc074524SJeff Mahoney #define TP_fast_assign_btrfs(fs_info, args...) \ 79bc074524SJeff Mahoney TP_fast_assign( \ 80bc074524SJeff Mahoney TP_fast_assign_fsid(fs_info); \ 81bc074524SJeff Mahoney args) 82bc074524SJeff Mahoney #define TP_printk_btrfs(fmt, args...) \ 83bc074524SJeff Mahoney TP_printk("%pU: " fmt, __entry->fsid, args) 848c2a3ca2SJosef Bacik 851abe9b8aSliubo TRACE_EVENT(btrfs_transaction_commit, 861abe9b8aSliubo 871abe9b8aSliubo TP_PROTO(struct btrfs_root *root), 881abe9b8aSliubo 891abe9b8aSliubo TP_ARGS(root), 901abe9b8aSliubo 91bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 921abe9b8aSliubo __field( u64, generation ) 931abe9b8aSliubo __field( u64, root_objectid ) 941abe9b8aSliubo ), 951abe9b8aSliubo 96bc074524SJeff Mahoney TP_fast_assign_btrfs(root->fs_info, 971abe9b8aSliubo __entry->generation = root->fs_info->generation; 981abe9b8aSliubo __entry->root_objectid = root->root_key.objectid; 991abe9b8aSliubo ), 1001abe9b8aSliubo 101bc074524SJeff Mahoney TP_printk_btrfs("root = %llu(%s), gen = %llu", 1021abe9b8aSliubo show_root_type(__entry->root_objectid), 1031abe9b8aSliubo (unsigned long long)__entry->generation) 1041abe9b8aSliubo ); 1051abe9b8aSliubo 1061abe9b8aSliubo DECLARE_EVENT_CLASS(btrfs__inode, 1071abe9b8aSliubo 1081abe9b8aSliubo TP_PROTO(struct inode *inode), 1091abe9b8aSliubo 1101abe9b8aSliubo TP_ARGS(inode), 1111abe9b8aSliubo 112bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 1131abe9b8aSliubo __field( ino_t, ino ) 1141abe9b8aSliubo __field( blkcnt_t, blocks ) 1151abe9b8aSliubo __field( u64, disk_i_size ) 1161abe9b8aSliubo __field( u64, generation ) 1171abe9b8aSliubo __field( u64, last_trans ) 1181abe9b8aSliubo __field( u64, logged_trans ) 1191abe9b8aSliubo __field( u64, root_objectid ) 1201abe9b8aSliubo ), 1211abe9b8aSliubo 122bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), 1231abe9b8aSliubo __entry->ino = inode->i_ino; 1241abe9b8aSliubo __entry->blocks = inode->i_blocks; 1251abe9b8aSliubo __entry->disk_i_size = BTRFS_I(inode)->disk_i_size; 1261abe9b8aSliubo __entry->generation = BTRFS_I(inode)->generation; 1271abe9b8aSliubo __entry->last_trans = BTRFS_I(inode)->last_trans; 1281abe9b8aSliubo __entry->logged_trans = BTRFS_I(inode)->logged_trans; 1291abe9b8aSliubo __entry->root_objectid = 1301abe9b8aSliubo BTRFS_I(inode)->root->root_key.objectid; 1311abe9b8aSliubo ), 1321abe9b8aSliubo 133562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) gen=%llu ino=%lu blocks=%llu " 134562a7a07SDavid Sterba "disk_i_size=%llu last_trans=%llu logged_trans=%llu", 1351abe9b8aSliubo show_root_type(__entry->root_objectid), 1361abe9b8aSliubo (unsigned long long)__entry->generation, 1371abe9b8aSliubo (unsigned long)__entry->ino, 1381abe9b8aSliubo (unsigned long long)__entry->blocks, 1391abe9b8aSliubo (unsigned long long)__entry->disk_i_size, 1401abe9b8aSliubo (unsigned long long)__entry->last_trans, 1411abe9b8aSliubo (unsigned long long)__entry->logged_trans) 1421abe9b8aSliubo ); 1431abe9b8aSliubo 1441abe9b8aSliubo DEFINE_EVENT(btrfs__inode, btrfs_inode_new, 1451abe9b8aSliubo 1461abe9b8aSliubo TP_PROTO(struct inode *inode), 1471abe9b8aSliubo 1481abe9b8aSliubo TP_ARGS(inode) 1491abe9b8aSliubo ); 1501abe9b8aSliubo 1511abe9b8aSliubo DEFINE_EVENT(btrfs__inode, btrfs_inode_request, 1521abe9b8aSliubo 1531abe9b8aSliubo TP_PROTO(struct inode *inode), 1541abe9b8aSliubo 1551abe9b8aSliubo TP_ARGS(inode) 1561abe9b8aSliubo ); 1571abe9b8aSliubo 1581abe9b8aSliubo DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, 1591abe9b8aSliubo 1601abe9b8aSliubo TP_PROTO(struct inode *inode), 1611abe9b8aSliubo 1621abe9b8aSliubo TP_ARGS(inode) 1631abe9b8aSliubo ); 1641abe9b8aSliubo 1651abe9b8aSliubo #define __show_map_type(type) \ 1667f34b746Sliubo __print_symbolic_u64(type, \ 1671abe9b8aSliubo { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \ 1681abe9b8aSliubo { EXTENT_MAP_HOLE, "HOLE" }, \ 1691abe9b8aSliubo { EXTENT_MAP_INLINE, "INLINE" }, \ 1701abe9b8aSliubo { EXTENT_MAP_DELALLOC, "DELALLOC" }) 1711abe9b8aSliubo 1721abe9b8aSliubo #define show_map_type(type) \ 1731abe9b8aSliubo type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" : __show_map_type(type) 1741abe9b8aSliubo 1751abe9b8aSliubo #define show_map_flags(flag) \ 1761abe9b8aSliubo __print_flags(flag, "|", \ 177254a2d14SLiu Bo { (1 << EXTENT_FLAG_PINNED), "PINNED" },\ 178254a2d14SLiu Bo { (1 << EXTENT_FLAG_COMPRESSED), "COMPRESSED" },\ 179254a2d14SLiu Bo { (1 << EXTENT_FLAG_VACANCY), "VACANCY" },\ 180254a2d14SLiu Bo { (1 << EXTENT_FLAG_PREALLOC), "PREALLOC" },\ 181254a2d14SLiu Bo { (1 << EXTENT_FLAG_LOGGING), "LOGGING" },\ 182254a2d14SLiu Bo { (1 << EXTENT_FLAG_FILLING), "FILLING" },\ 183254a2d14SLiu Bo { (1 << EXTENT_FLAG_FS_MAPPING), "FS_MAPPING" }) 1841abe9b8aSliubo 1854cd8587cSSteven Rostedt TRACE_EVENT_CONDITION(btrfs_get_extent, 1861abe9b8aSliubo 18792a1bf76SLiu Bo TP_PROTO(struct btrfs_root *root, struct inode *inode, 18892a1bf76SLiu Bo struct extent_map *map), 1891abe9b8aSliubo 19092a1bf76SLiu Bo TP_ARGS(root, inode, map), 1911abe9b8aSliubo 1924cd8587cSSteven Rostedt TP_CONDITION(map), 1934cd8587cSSteven Rostedt 194bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 1951abe9b8aSliubo __field( u64, root_objectid ) 19692a1bf76SLiu Bo __field( u64, ino ) 1971abe9b8aSliubo __field( u64, start ) 1981abe9b8aSliubo __field( u64, len ) 1991abe9b8aSliubo __field( u64, orig_start ) 2001abe9b8aSliubo __field( u64, block_start ) 2011abe9b8aSliubo __field( u64, block_len ) 2021abe9b8aSliubo __field( unsigned long, flags ) 2031abe9b8aSliubo __field( int, refs ) 2041abe9b8aSliubo __field( unsigned int, compress_type ) 2051abe9b8aSliubo ), 2061abe9b8aSliubo 207bc074524SJeff Mahoney TP_fast_assign_btrfs(root->fs_info, 2081abe9b8aSliubo __entry->root_objectid = root->root_key.objectid; 20992a1bf76SLiu Bo __entry->ino = btrfs_ino(inode); 2101abe9b8aSliubo __entry->start = map->start; 2111abe9b8aSliubo __entry->len = map->len; 2121abe9b8aSliubo __entry->orig_start = map->orig_start; 2131abe9b8aSliubo __entry->block_start = map->block_start; 2141abe9b8aSliubo __entry->block_len = map->block_len; 2151abe9b8aSliubo __entry->flags = map->flags; 2161abe9b8aSliubo __entry->refs = atomic_read(&map->refs); 2171abe9b8aSliubo __entry->compress_type = map->compress_type; 2181abe9b8aSliubo ), 2191abe9b8aSliubo 220562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) ino=%llu start=%llu len=%llu " 221562a7a07SDavid Sterba "orig_start=%llu block_start=%llu(%s) " 222562a7a07SDavid Sterba "block_len=%llu flags=%s refs=%u " 2231abe9b8aSliubo "compress_type=%u", 2241abe9b8aSliubo show_root_type(__entry->root_objectid), 22592a1bf76SLiu Bo (unsigned long long)__entry->ino, 2261abe9b8aSliubo (unsigned long long)__entry->start, 2271abe9b8aSliubo (unsigned long long)__entry->len, 2281abe9b8aSliubo (unsigned long long)__entry->orig_start, 2291abe9b8aSliubo show_map_type(__entry->block_start), 2301abe9b8aSliubo (unsigned long long)__entry->block_len, 2311abe9b8aSliubo show_map_flags(__entry->flags), 2321abe9b8aSliubo __entry->refs, __entry->compress_type) 2331abe9b8aSliubo ); 2341abe9b8aSliubo 2351abe9b8aSliubo #define show_ordered_flags(flags) \ 2369d04a8ceSLiu Bo __print_flags(flags, "|", \ 2379d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_IO_DONE), "IO_DONE" }, \ 2389d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_COMPLETE), "COMPLETE" }, \ 2399d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_NOCOW), "NOCOW" }, \ 2409d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_COMPRESSED), "COMPRESSED" }, \ 2419d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_PREALLOC), "PREALLOC" }, \ 2429d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_DIRECT), "DIRECT" }, \ 2439d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_IOERR), "IOERR" }, \ 2449d04a8ceSLiu Bo { (1 << BTRFS_ORDERED_UPDATED_ISIZE), "UPDATED_ISIZE" }, \ 245792ddef0SLiu Bo { (1 << BTRFS_ORDERED_LOGGED_CSUM), "LOGGED_CSUM" }, \ 246792ddef0SLiu Bo { (1 << BTRFS_ORDERED_TRUNCATED), "TRUNCATED" }) 247e112e2b4SLiu Bo 2481abe9b8aSliubo 2491abe9b8aSliubo DECLARE_EVENT_CLASS(btrfs__ordered_extent, 2501abe9b8aSliubo 2511abe9b8aSliubo TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), 2521abe9b8aSliubo 2531abe9b8aSliubo TP_ARGS(inode, ordered), 2541abe9b8aSliubo 255bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 2561abe9b8aSliubo __field( ino_t, ino ) 2571abe9b8aSliubo __field( u64, file_offset ) 2581abe9b8aSliubo __field( u64, start ) 2591abe9b8aSliubo __field( u64, len ) 2601abe9b8aSliubo __field( u64, disk_len ) 2611abe9b8aSliubo __field( u64, bytes_left ) 2621abe9b8aSliubo __field( unsigned long, flags ) 2631abe9b8aSliubo __field( int, compress_type ) 2641abe9b8aSliubo __field( int, refs ) 2651abe9b8aSliubo __field( u64, root_objectid ) 26678566548SLiu Bo __field( u64, truncated_len ) 2671abe9b8aSliubo ), 2681abe9b8aSliubo 269bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), 2701abe9b8aSliubo __entry->ino = inode->i_ino; 2711abe9b8aSliubo __entry->file_offset = ordered->file_offset; 2721abe9b8aSliubo __entry->start = ordered->start; 2731abe9b8aSliubo __entry->len = ordered->len; 2741abe9b8aSliubo __entry->disk_len = ordered->disk_len; 2751abe9b8aSliubo __entry->bytes_left = ordered->bytes_left; 2761abe9b8aSliubo __entry->flags = ordered->flags; 2771abe9b8aSliubo __entry->compress_type = ordered->compress_type; 2781abe9b8aSliubo __entry->refs = atomic_read(&ordered->refs); 2791abe9b8aSliubo __entry->root_objectid = 2801abe9b8aSliubo BTRFS_I(inode)->root->root_key.objectid; 28178566548SLiu Bo __entry->truncated_len = ordered->truncated_len; 2821abe9b8aSliubo ), 2831abe9b8aSliubo 284562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) ino=%llu file_offset=%llu " 285562a7a07SDavid Sterba "start=%llu len=%llu disk_len=%llu " 286562a7a07SDavid Sterba "truncated_len=%llu " 287562a7a07SDavid Sterba "bytes_left=%llu flags=%s compress_type=%d " 2881abe9b8aSliubo "refs=%d", 2891abe9b8aSliubo show_root_type(__entry->root_objectid), 2901abe9b8aSliubo (unsigned long long)__entry->ino, 2911abe9b8aSliubo (unsigned long long)__entry->file_offset, 2921abe9b8aSliubo (unsigned long long)__entry->start, 2931abe9b8aSliubo (unsigned long long)__entry->len, 2941abe9b8aSliubo (unsigned long long)__entry->disk_len, 29578566548SLiu Bo (unsigned long long)__entry->truncated_len, 2961abe9b8aSliubo (unsigned long long)__entry->bytes_left, 2971abe9b8aSliubo show_ordered_flags(__entry->flags), 2981abe9b8aSliubo __entry->compress_type, __entry->refs) 2991abe9b8aSliubo ); 3001abe9b8aSliubo 3011abe9b8aSliubo DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add, 3021abe9b8aSliubo 3031abe9b8aSliubo TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), 3041abe9b8aSliubo 3051abe9b8aSliubo TP_ARGS(inode, ordered) 3061abe9b8aSliubo ); 3071abe9b8aSliubo 3081abe9b8aSliubo DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove, 3091abe9b8aSliubo 3101abe9b8aSliubo TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), 3111abe9b8aSliubo 3121abe9b8aSliubo TP_ARGS(inode, ordered) 3131abe9b8aSliubo ); 3141abe9b8aSliubo 3151abe9b8aSliubo DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start, 3161abe9b8aSliubo 3171abe9b8aSliubo TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), 3181abe9b8aSliubo 3191abe9b8aSliubo TP_ARGS(inode, ordered) 3201abe9b8aSliubo ); 3211abe9b8aSliubo 3221abe9b8aSliubo DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put, 3231abe9b8aSliubo 3241abe9b8aSliubo TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), 3251abe9b8aSliubo 3261abe9b8aSliubo TP_ARGS(inode, ordered) 3271abe9b8aSliubo ); 3281abe9b8aSliubo 3291abe9b8aSliubo DECLARE_EVENT_CLASS(btrfs__writepage, 3301abe9b8aSliubo 3311abe9b8aSliubo TP_PROTO(struct page *page, struct inode *inode, 3321abe9b8aSliubo struct writeback_control *wbc), 3331abe9b8aSliubo 3341abe9b8aSliubo TP_ARGS(page, inode, wbc), 3351abe9b8aSliubo 336bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 3371abe9b8aSliubo __field( ino_t, ino ) 3381abe9b8aSliubo __field( pgoff_t, index ) 3391abe9b8aSliubo __field( long, nr_to_write ) 3401abe9b8aSliubo __field( long, pages_skipped ) 3411abe9b8aSliubo __field( loff_t, range_start ) 3421abe9b8aSliubo __field( loff_t, range_end ) 3431abe9b8aSliubo __field( char, for_kupdate ) 3441abe9b8aSliubo __field( char, for_reclaim ) 3451abe9b8aSliubo __field( char, range_cyclic ) 3461abe9b8aSliubo __field( pgoff_t, writeback_index ) 3471abe9b8aSliubo __field( u64, root_objectid ) 3481abe9b8aSliubo ), 3491abe9b8aSliubo 350bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), 3511abe9b8aSliubo __entry->ino = inode->i_ino; 3521abe9b8aSliubo __entry->index = page->index; 3531abe9b8aSliubo __entry->nr_to_write = wbc->nr_to_write; 3541abe9b8aSliubo __entry->pages_skipped = wbc->pages_skipped; 3551abe9b8aSliubo __entry->range_start = wbc->range_start; 3561abe9b8aSliubo __entry->range_end = wbc->range_end; 3571abe9b8aSliubo __entry->for_kupdate = wbc->for_kupdate; 3581abe9b8aSliubo __entry->for_reclaim = wbc->for_reclaim; 3591abe9b8aSliubo __entry->range_cyclic = wbc->range_cyclic; 3601abe9b8aSliubo __entry->writeback_index = inode->i_mapping->writeback_index; 3611abe9b8aSliubo __entry->root_objectid = 3621abe9b8aSliubo BTRFS_I(inode)->root->root_key.objectid; 3631abe9b8aSliubo ), 3641abe9b8aSliubo 365562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) ino=%lu page_index=%lu " 366562a7a07SDavid Sterba "nr_to_write=%ld pages_skipped=%ld range_start=%llu " 367562a7a07SDavid Sterba "range_end=%llu for_kupdate=%d " 368562a7a07SDavid Sterba "for_reclaim=%d range_cyclic=%d writeback_index=%lu", 3691abe9b8aSliubo show_root_type(__entry->root_objectid), 3701abe9b8aSliubo (unsigned long)__entry->ino, __entry->index, 3711abe9b8aSliubo __entry->nr_to_write, __entry->pages_skipped, 3721abe9b8aSliubo __entry->range_start, __entry->range_end, 373846d5a09SWu Fengguang __entry->for_kupdate, 3741abe9b8aSliubo __entry->for_reclaim, __entry->range_cyclic, 3751abe9b8aSliubo (unsigned long)__entry->writeback_index) 3761abe9b8aSliubo ); 3771abe9b8aSliubo 3781abe9b8aSliubo DEFINE_EVENT(btrfs__writepage, __extent_writepage, 3791abe9b8aSliubo 3801abe9b8aSliubo TP_PROTO(struct page *page, struct inode *inode, 3811abe9b8aSliubo struct writeback_control *wbc), 3821abe9b8aSliubo 3831abe9b8aSliubo TP_ARGS(page, inode, wbc) 3841abe9b8aSliubo ); 3851abe9b8aSliubo 3861abe9b8aSliubo TRACE_EVENT(btrfs_writepage_end_io_hook, 3871abe9b8aSliubo 3881abe9b8aSliubo TP_PROTO(struct page *page, u64 start, u64 end, int uptodate), 3891abe9b8aSliubo 3901abe9b8aSliubo TP_ARGS(page, start, end, uptodate), 3911abe9b8aSliubo 392bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 3931abe9b8aSliubo __field( ino_t, ino ) 3941abe9b8aSliubo __field( pgoff_t, index ) 3951abe9b8aSliubo __field( u64, start ) 3961abe9b8aSliubo __field( u64, end ) 3971abe9b8aSliubo __field( int, uptodate ) 3981abe9b8aSliubo __field( u64, root_objectid ) 3991abe9b8aSliubo ), 4001abe9b8aSliubo 401bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_sb(page->mapping->host->i_sb), 4021abe9b8aSliubo __entry->ino = page->mapping->host->i_ino; 4031abe9b8aSliubo __entry->index = page->index; 4041abe9b8aSliubo __entry->start = start; 4051abe9b8aSliubo __entry->end = end; 4061abe9b8aSliubo __entry->uptodate = uptodate; 4071abe9b8aSliubo __entry->root_objectid = 4081abe9b8aSliubo BTRFS_I(page->mapping->host)->root->root_key.objectid; 4091abe9b8aSliubo ), 4101abe9b8aSliubo 411562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) ino=%lu page_index=%lu start=%llu " 412562a7a07SDavid Sterba "end=%llu uptodate=%d", 4131abe9b8aSliubo show_root_type(__entry->root_objectid), 4141abe9b8aSliubo (unsigned long)__entry->ino, (unsigned long)__entry->index, 4151abe9b8aSliubo (unsigned long long)__entry->start, 4161abe9b8aSliubo (unsigned long long)__entry->end, __entry->uptodate) 4171abe9b8aSliubo ); 4181abe9b8aSliubo 4191abe9b8aSliubo TRACE_EVENT(btrfs_sync_file, 4201abe9b8aSliubo 4211abe9b8aSliubo TP_PROTO(struct file *file, int datasync), 4221abe9b8aSliubo 4231abe9b8aSliubo TP_ARGS(file, datasync), 4241abe9b8aSliubo 425bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 4261abe9b8aSliubo __field( ino_t, ino ) 4271abe9b8aSliubo __field( ino_t, parent ) 4281abe9b8aSliubo __field( int, datasync ) 4291abe9b8aSliubo __field( u64, root_objectid ) 4301abe9b8aSliubo ), 4311abe9b8aSliubo 4321abe9b8aSliubo TP_fast_assign( 4331abe9b8aSliubo struct dentry *dentry = file->f_path.dentry; 4342b0143b5SDavid Howells struct inode *inode = d_inode(dentry); 4351abe9b8aSliubo 436bc074524SJeff Mahoney TP_fast_assign_fsid(btrfs_sb(file->f_path.dentry->d_sb)); 4371abe9b8aSliubo __entry->ino = inode->i_ino; 4382b0143b5SDavid Howells __entry->parent = d_inode(dentry->d_parent)->i_ino; 4391abe9b8aSliubo __entry->datasync = datasync; 4401abe9b8aSliubo __entry->root_objectid = 4411abe9b8aSliubo BTRFS_I(inode)->root->root_key.objectid; 4421abe9b8aSliubo ), 4431abe9b8aSliubo 444562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) ino=%ld parent=%ld datasync=%d", 4451abe9b8aSliubo show_root_type(__entry->root_objectid), 4461abe9b8aSliubo (unsigned long)__entry->ino, (unsigned long)__entry->parent, 4471abe9b8aSliubo __entry->datasync) 4481abe9b8aSliubo ); 4491abe9b8aSliubo 4501abe9b8aSliubo TRACE_EVENT(btrfs_sync_fs, 4511abe9b8aSliubo 452bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, int wait), 4531abe9b8aSliubo 454bc074524SJeff Mahoney TP_ARGS(fs_info, wait), 4551abe9b8aSliubo 456bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 4571abe9b8aSliubo __field( int, wait ) 4581abe9b8aSliubo ), 4591abe9b8aSliubo 460bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 4611abe9b8aSliubo __entry->wait = wait; 4621abe9b8aSliubo ), 4631abe9b8aSliubo 464bc074524SJeff Mahoney TP_printk_btrfs("wait = %d", __entry->wait) 4651abe9b8aSliubo ); 4661abe9b8aSliubo 467c83f8effSJosef Bacik TRACE_EVENT(btrfs_add_block_group, 468c83f8effSJosef Bacik 469c83f8effSJosef Bacik TP_PROTO(struct btrfs_fs_info *fs_info, 470c83f8effSJosef Bacik struct btrfs_block_group_cache *block_group, int create), 471c83f8effSJosef Bacik 472c83f8effSJosef Bacik TP_ARGS(fs_info, block_group, create), 473c83f8effSJosef Bacik 474c83f8effSJosef Bacik TP_STRUCT__entry( 475c83f8effSJosef Bacik __array( u8, fsid, BTRFS_UUID_SIZE ) 476c83f8effSJosef Bacik __field( u64, offset ) 477c83f8effSJosef Bacik __field( u64, size ) 478c83f8effSJosef Bacik __field( u64, flags ) 479c83f8effSJosef Bacik __field( u64, bytes_used ) 480c83f8effSJosef Bacik __field( u64, bytes_super ) 481c83f8effSJosef Bacik __field( int, create ) 482c83f8effSJosef Bacik ), 483c83f8effSJosef Bacik 484c83f8effSJosef Bacik TP_fast_assign( 485c83f8effSJosef Bacik memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); 486c83f8effSJosef Bacik __entry->offset = block_group->key.objectid; 487c83f8effSJosef Bacik __entry->size = block_group->key.offset; 488c83f8effSJosef Bacik __entry->flags = block_group->flags; 489c83f8effSJosef Bacik __entry->bytes_used = 490c83f8effSJosef Bacik btrfs_block_group_used(&block_group->item); 491c83f8effSJosef Bacik __entry->bytes_super = block_group->bytes_super; 492c83f8effSJosef Bacik __entry->create = create; 493c83f8effSJosef Bacik ), 494c83f8effSJosef Bacik 495562a7a07SDavid Sterba TP_printk("%pU: block_group offset=%llu size=%llu " 496562a7a07SDavid Sterba "flags=%llu(%s) bytes_used=%llu bytes_super=%llu " 497c83f8effSJosef Bacik "create=%d", __entry->fsid, 498c83f8effSJosef Bacik (unsigned long long)__entry->offset, 499c83f8effSJosef Bacik (unsigned long long)__entry->size, 500c83f8effSJosef Bacik (unsigned long long)__entry->flags, 501c83f8effSJosef Bacik __print_flags((unsigned long)__entry->flags, "|", 502c83f8effSJosef Bacik BTRFS_GROUP_FLAGS), 503c83f8effSJosef Bacik (unsigned long long)__entry->bytes_used, 504c83f8effSJosef Bacik (unsigned long long)__entry->bytes_super, __entry->create) 505c83f8effSJosef Bacik ); 506c83f8effSJosef Bacik 5071abe9b8aSliubo #define show_ref_action(action) \ 5081abe9b8aSliubo __print_symbolic(action, \ 5091abe9b8aSliubo { BTRFS_ADD_DELAYED_REF, "ADD_DELAYED_REF" }, \ 5101abe9b8aSliubo { BTRFS_DROP_DELAYED_REF, "DROP_DELAYED_REF" }, \ 5111abe9b8aSliubo { BTRFS_ADD_DELAYED_EXTENT, "ADD_DELAYED_EXTENT" }, \ 5121abe9b8aSliubo { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" }) 5131abe9b8aSliubo 5141abe9b8aSliubo 515599c75ecSLiu Bo DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, 5161abe9b8aSliubo 517bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 518bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 5191abe9b8aSliubo struct btrfs_delayed_tree_ref *full_ref, 5201abe9b8aSliubo int action), 5211abe9b8aSliubo 522bc074524SJeff Mahoney TP_ARGS(fs_info, ref, full_ref, action), 5231abe9b8aSliubo 524bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 5251abe9b8aSliubo __field( u64, bytenr ) 5261abe9b8aSliubo __field( u64, num_bytes ) 5271abe9b8aSliubo __field( int, action ) 5281abe9b8aSliubo __field( u64, parent ) 5291abe9b8aSliubo __field( u64, ref_root ) 5301abe9b8aSliubo __field( int, level ) 5311abe9b8aSliubo __field( int, type ) 532dea7d76eSLiu Bo __field( u64, seq ) 5331abe9b8aSliubo ), 5341abe9b8aSliubo 535bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 5361abe9b8aSliubo __entry->bytenr = ref->bytenr; 5371abe9b8aSliubo __entry->num_bytes = ref->num_bytes; 5381abe9b8aSliubo __entry->action = action; 5391abe9b8aSliubo __entry->parent = full_ref->parent; 5401abe9b8aSliubo __entry->ref_root = full_ref->root; 5411abe9b8aSliubo __entry->level = full_ref->level; 5421abe9b8aSliubo __entry->type = ref->type; 543dea7d76eSLiu Bo __entry->seq = ref->seq; 5441abe9b8aSliubo ), 5451abe9b8aSliubo 546562a7a07SDavid Sterba TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s " 547562a7a07SDavid Sterba "parent=%llu(%s) ref_root=%llu(%s) level=%d " 548562a7a07SDavid Sterba "type=%s seq=%llu", 5491abe9b8aSliubo (unsigned long long)__entry->bytenr, 5501abe9b8aSliubo (unsigned long long)__entry->num_bytes, 5511abe9b8aSliubo show_ref_action(__entry->action), 5521abe9b8aSliubo show_root_type(__entry->parent), 5531abe9b8aSliubo show_root_type(__entry->ref_root), 554dea7d76eSLiu Bo __entry->level, show_ref_type(__entry->type), 555dea7d76eSLiu Bo (unsigned long long)__entry->seq) 5561abe9b8aSliubo ); 5571abe9b8aSliubo 558599c75ecSLiu Bo DEFINE_EVENT(btrfs_delayed_tree_ref, add_delayed_tree_ref, 559599c75ecSLiu Bo 560bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 561bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 562599c75ecSLiu Bo struct btrfs_delayed_tree_ref *full_ref, 563599c75ecSLiu Bo int action), 564599c75ecSLiu Bo 565bc074524SJeff Mahoney TP_ARGS(fs_info, ref, full_ref, action) 566599c75ecSLiu Bo ); 567599c75ecSLiu Bo 568599c75ecSLiu Bo DEFINE_EVENT(btrfs_delayed_tree_ref, run_delayed_tree_ref, 569599c75ecSLiu Bo 570bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 571bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 572599c75ecSLiu Bo struct btrfs_delayed_tree_ref *full_ref, 573599c75ecSLiu Bo int action), 574599c75ecSLiu Bo 575bc074524SJeff Mahoney TP_ARGS(fs_info, ref, full_ref, action) 576599c75ecSLiu Bo ); 577599c75ecSLiu Bo 578599c75ecSLiu Bo DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, 5791abe9b8aSliubo 580bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 581bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 5821abe9b8aSliubo struct btrfs_delayed_data_ref *full_ref, 5831abe9b8aSliubo int action), 5841abe9b8aSliubo 585bc074524SJeff Mahoney TP_ARGS(fs_info, ref, full_ref, action), 5861abe9b8aSliubo 587bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 5881abe9b8aSliubo __field( u64, bytenr ) 5891abe9b8aSliubo __field( u64, num_bytes ) 5901abe9b8aSliubo __field( int, action ) 5911abe9b8aSliubo __field( u64, parent ) 5921abe9b8aSliubo __field( u64, ref_root ) 5931abe9b8aSliubo __field( u64, owner ) 5941abe9b8aSliubo __field( u64, offset ) 5951abe9b8aSliubo __field( int, type ) 596dea7d76eSLiu Bo __field( u64, seq ) 5971abe9b8aSliubo ), 5981abe9b8aSliubo 599bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 6001abe9b8aSliubo __entry->bytenr = ref->bytenr; 6011abe9b8aSliubo __entry->num_bytes = ref->num_bytes; 6021abe9b8aSliubo __entry->action = action; 6031abe9b8aSliubo __entry->parent = full_ref->parent; 6041abe9b8aSliubo __entry->ref_root = full_ref->root; 6051abe9b8aSliubo __entry->owner = full_ref->objectid; 6061abe9b8aSliubo __entry->offset = full_ref->offset; 6071abe9b8aSliubo __entry->type = ref->type; 608dea7d76eSLiu Bo __entry->seq = ref->seq; 6091abe9b8aSliubo ), 6101abe9b8aSliubo 611562a7a07SDavid Sterba TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s " 612562a7a07SDavid Sterba "parent=%llu(%s) ref_root=%llu(%s) owner=%llu " 613562a7a07SDavid Sterba "offset=%llu type=%s seq=%llu", 6141abe9b8aSliubo (unsigned long long)__entry->bytenr, 6151abe9b8aSliubo (unsigned long long)__entry->num_bytes, 6161abe9b8aSliubo show_ref_action(__entry->action), 6171abe9b8aSliubo show_root_type(__entry->parent), 6181abe9b8aSliubo show_root_type(__entry->ref_root), 6191abe9b8aSliubo (unsigned long long)__entry->owner, 6201abe9b8aSliubo (unsigned long long)__entry->offset, 621dea7d76eSLiu Bo show_ref_type(__entry->type), 622dea7d76eSLiu Bo (unsigned long long)__entry->seq) 6231abe9b8aSliubo ); 6241abe9b8aSliubo 625599c75ecSLiu Bo DEFINE_EVENT(btrfs_delayed_data_ref, add_delayed_data_ref, 626599c75ecSLiu Bo 627bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 628bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 629599c75ecSLiu Bo struct btrfs_delayed_data_ref *full_ref, 630599c75ecSLiu Bo int action), 631599c75ecSLiu Bo 632bc074524SJeff Mahoney TP_ARGS(fs_info, ref, full_ref, action) 633599c75ecSLiu Bo ); 634599c75ecSLiu Bo 635599c75ecSLiu Bo DEFINE_EVENT(btrfs_delayed_data_ref, run_delayed_data_ref, 636599c75ecSLiu Bo 637bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 638bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 639599c75ecSLiu Bo struct btrfs_delayed_data_ref *full_ref, 640599c75ecSLiu Bo int action), 641599c75ecSLiu Bo 642bc074524SJeff Mahoney TP_ARGS(fs_info, ref, full_ref, action) 643599c75ecSLiu Bo ); 644599c75ecSLiu Bo 645599c75ecSLiu Bo DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, 6461abe9b8aSliubo 647bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 648bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 6491abe9b8aSliubo struct btrfs_delayed_ref_head *head_ref, 6501abe9b8aSliubo int action), 6511abe9b8aSliubo 652bc074524SJeff Mahoney TP_ARGS(fs_info, ref, head_ref, action), 6531abe9b8aSliubo 654bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 6551abe9b8aSliubo __field( u64, bytenr ) 6561abe9b8aSliubo __field( u64, num_bytes ) 6571abe9b8aSliubo __field( int, action ) 6581abe9b8aSliubo __field( int, is_data ) 6591abe9b8aSliubo ), 6601abe9b8aSliubo 661bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 6621abe9b8aSliubo __entry->bytenr = ref->bytenr; 6631abe9b8aSliubo __entry->num_bytes = ref->num_bytes; 6641abe9b8aSliubo __entry->action = action; 6651abe9b8aSliubo __entry->is_data = head_ref->is_data; 6661abe9b8aSliubo ), 6671abe9b8aSliubo 668562a7a07SDavid Sterba TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s is_data=%d", 6691abe9b8aSliubo (unsigned long long)__entry->bytenr, 6701abe9b8aSliubo (unsigned long long)__entry->num_bytes, 6711abe9b8aSliubo show_ref_action(__entry->action), 6721abe9b8aSliubo __entry->is_data) 6731abe9b8aSliubo ); 6741abe9b8aSliubo 675599c75ecSLiu Bo DEFINE_EVENT(btrfs_delayed_ref_head, add_delayed_ref_head, 676599c75ecSLiu Bo 677bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 678bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 679599c75ecSLiu Bo struct btrfs_delayed_ref_head *head_ref, 680599c75ecSLiu Bo int action), 681599c75ecSLiu Bo 682bc074524SJeff Mahoney TP_ARGS(fs_info, ref, head_ref, action) 683599c75ecSLiu Bo ); 684599c75ecSLiu Bo 685599c75ecSLiu Bo DEFINE_EVENT(btrfs_delayed_ref_head, run_delayed_ref_head, 686599c75ecSLiu Bo 687bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 688bc074524SJeff Mahoney struct btrfs_delayed_ref_node *ref, 689599c75ecSLiu Bo struct btrfs_delayed_ref_head *head_ref, 690599c75ecSLiu Bo int action), 691599c75ecSLiu Bo 692bc074524SJeff Mahoney TP_ARGS(fs_info, ref, head_ref, action) 693599c75ecSLiu Bo ); 694599c75ecSLiu Bo 6951abe9b8aSliubo #define show_chunk_type(type) \ 6961abe9b8aSliubo __print_flags(type, "|", \ 6971abe9b8aSliubo { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \ 6981abe9b8aSliubo { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \ 6991abe9b8aSliubo { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \ 7001abe9b8aSliubo { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \ 7011abe9b8aSliubo { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \ 7021abe9b8aSliubo { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \ 703e112e2b4SLiu Bo { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \ 704e112e2b4SLiu Bo { BTRFS_BLOCK_GROUP_RAID5, "RAID5" }, \ 705e112e2b4SLiu Bo { BTRFS_BLOCK_GROUP_RAID6, "RAID6" }) 7061abe9b8aSliubo 7071abe9b8aSliubo DECLARE_EVENT_CLASS(btrfs__chunk, 7081abe9b8aSliubo 7096bccf3abSJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, 7101abe9b8aSliubo u64 offset, u64 size), 7111abe9b8aSliubo 7126bccf3abSJeff Mahoney TP_ARGS(fs_info, map, offset, size), 7131abe9b8aSliubo 714bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 7151abe9b8aSliubo __field( int, num_stripes ) 7161abe9b8aSliubo __field( u64, type ) 7171abe9b8aSliubo __field( int, sub_stripes ) 7181abe9b8aSliubo __field( u64, offset ) 7191abe9b8aSliubo __field( u64, size ) 7201abe9b8aSliubo __field( u64, root_objectid ) 7211abe9b8aSliubo ), 7221abe9b8aSliubo 7236bccf3abSJeff Mahoney TP_fast_assign_btrfs(fs_info, 7241abe9b8aSliubo __entry->num_stripes = map->num_stripes; 7251abe9b8aSliubo __entry->type = map->type; 7261abe9b8aSliubo __entry->sub_stripes = map->sub_stripes; 7271abe9b8aSliubo __entry->offset = offset; 7281abe9b8aSliubo __entry->size = size; 7296bccf3abSJeff Mahoney __entry->root_objectid = fs_info->chunk_root->root_key.objectid; 7301abe9b8aSliubo ), 7311abe9b8aSliubo 732562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) offset=%llu size=%llu " 733562a7a07SDavid Sterba "num_stripes=%d sub_stripes=%d type=%s", 7341abe9b8aSliubo show_root_type(__entry->root_objectid), 7351abe9b8aSliubo (unsigned long long)__entry->offset, 7361abe9b8aSliubo (unsigned long long)__entry->size, 7371abe9b8aSliubo __entry->num_stripes, __entry->sub_stripes, 7381abe9b8aSliubo show_chunk_type(__entry->type)) 7391abe9b8aSliubo ); 7401abe9b8aSliubo 7411abe9b8aSliubo DEFINE_EVENT(btrfs__chunk, btrfs_chunk_alloc, 7421abe9b8aSliubo 7436bccf3abSJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, 7441abe9b8aSliubo u64 offset, u64 size), 7451abe9b8aSliubo 7466bccf3abSJeff Mahoney TP_ARGS(fs_info, map, offset, size) 7471abe9b8aSliubo ); 7481abe9b8aSliubo 7491abe9b8aSliubo DEFINE_EVENT(btrfs__chunk, btrfs_chunk_free, 7501abe9b8aSliubo 7516bccf3abSJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, 7521abe9b8aSliubo u64 offset, u64 size), 7531abe9b8aSliubo 7546bccf3abSJeff Mahoney TP_ARGS(fs_info, map, offset, size) 7551abe9b8aSliubo ); 7561abe9b8aSliubo 7571abe9b8aSliubo TRACE_EVENT(btrfs_cow_block, 7581abe9b8aSliubo 7591abe9b8aSliubo TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf, 7601abe9b8aSliubo struct extent_buffer *cow), 7611abe9b8aSliubo 7621abe9b8aSliubo TP_ARGS(root, buf, cow), 7631abe9b8aSliubo 764bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 7651abe9b8aSliubo __field( u64, root_objectid ) 7661abe9b8aSliubo __field( u64, buf_start ) 7671abe9b8aSliubo __field( int, refs ) 7681abe9b8aSliubo __field( u64, cow_start ) 7691abe9b8aSliubo __field( int, buf_level ) 7701abe9b8aSliubo __field( int, cow_level ) 7711abe9b8aSliubo ), 7721abe9b8aSliubo 773bc074524SJeff Mahoney TP_fast_assign_btrfs(root->fs_info, 7741abe9b8aSliubo __entry->root_objectid = root->root_key.objectid; 7751abe9b8aSliubo __entry->buf_start = buf->start; 7761abe9b8aSliubo __entry->refs = atomic_read(&buf->refs); 7771abe9b8aSliubo __entry->cow_start = cow->start; 7781abe9b8aSliubo __entry->buf_level = btrfs_header_level(buf); 7791abe9b8aSliubo __entry->cow_level = btrfs_header_level(cow); 7801abe9b8aSliubo ), 7811abe9b8aSliubo 782562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) refs=%d orig_buf=%llu " 783562a7a07SDavid Sterba "(orig_level=%d) cow_buf=%llu (cow_level=%d)", 7841abe9b8aSliubo show_root_type(__entry->root_objectid), 7851abe9b8aSliubo __entry->refs, 7861abe9b8aSliubo (unsigned long long)__entry->buf_start, 7871abe9b8aSliubo __entry->buf_level, 7881abe9b8aSliubo (unsigned long long)__entry->cow_start, 7891abe9b8aSliubo __entry->cow_level) 7901abe9b8aSliubo ); 7911abe9b8aSliubo 7928c2a3ca2SJosef Bacik TRACE_EVENT(btrfs_space_reservation, 7938c2a3ca2SJosef Bacik 7948c2a3ca2SJosef Bacik TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val, 7958c2a3ca2SJosef Bacik u64 bytes, int reserve), 7968c2a3ca2SJosef Bacik 7978c2a3ca2SJosef Bacik TP_ARGS(fs_info, type, val, bytes, reserve), 7988c2a3ca2SJosef Bacik 799bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 8008c2a3ca2SJosef Bacik __string( type, type ) 8018c2a3ca2SJosef Bacik __field( u64, val ) 8028c2a3ca2SJosef Bacik __field( u64, bytes ) 8038c2a3ca2SJosef Bacik __field( int, reserve ) 8048c2a3ca2SJosef Bacik ), 8058c2a3ca2SJosef Bacik 806bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 8078c2a3ca2SJosef Bacik __assign_str(type, type); 8088c2a3ca2SJosef Bacik __entry->val = val; 8098c2a3ca2SJosef Bacik __entry->bytes = bytes; 8108c2a3ca2SJosef Bacik __entry->reserve = reserve; 8118c2a3ca2SJosef Bacik ), 8128c2a3ca2SJosef Bacik 813bc074524SJeff Mahoney TP_printk_btrfs("%s: %Lu %s %Lu", __get_str(type), __entry->val, 814bc074524SJeff Mahoney __entry->reserve ? "reserve" : "release", 8158c2a3ca2SJosef Bacik __entry->bytes) 8168c2a3ca2SJosef Bacik ); 8178c2a3ca2SJosef Bacik 818f376df2bSJosef Bacik #define show_flush_action(action) \ 819f376df2bSJosef Bacik __print_symbolic(action, \ 820f376df2bSJosef Bacik { BTRFS_RESERVE_NO_FLUSH, "BTRFS_RESERVE_NO_FLUSH"}, \ 821f376df2bSJosef Bacik { BTRFS_RESERVE_FLUSH_LIMIT, "BTRFS_RESERVE_FLUSH_LIMIT"}, \ 822f376df2bSJosef Bacik { BTRFS_RESERVE_FLUSH_ALL, "BTRFS_RESERVE_FLUSH_ALL"}) 823f376df2bSJosef Bacik 824f376df2bSJosef Bacik TRACE_EVENT(btrfs_trigger_flush, 825f376df2bSJosef Bacik 826f376df2bSJosef Bacik TP_PROTO(struct btrfs_fs_info *fs_info, u64 flags, u64 bytes, 827f376df2bSJosef Bacik int flush, char *reason), 828f376df2bSJosef Bacik 829f376df2bSJosef Bacik TP_ARGS(fs_info, flags, bytes, flush, reason), 830f376df2bSJosef Bacik 831f376df2bSJosef Bacik TP_STRUCT__entry( 832f376df2bSJosef Bacik __array( u8, fsid, BTRFS_UUID_SIZE ) 833f376df2bSJosef Bacik __field( u64, flags ) 834f376df2bSJosef Bacik __field( u64, bytes ) 835f376df2bSJosef Bacik __field( int, flush ) 836f376df2bSJosef Bacik __string( reason, reason ) 837f376df2bSJosef Bacik ), 838f376df2bSJosef Bacik 839f376df2bSJosef Bacik TP_fast_assign( 840f376df2bSJosef Bacik memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); 841f376df2bSJosef Bacik __entry->flags = flags; 842f376df2bSJosef Bacik __entry->bytes = bytes; 843f376df2bSJosef Bacik __entry->flush = flush; 844f376df2bSJosef Bacik __assign_str(reason, reason) 845f376df2bSJosef Bacik ), 846f376df2bSJosef Bacik 847562a7a07SDavid Sterba TP_printk("%pU: %s: flush=%d(%s) flags=%llu(%s) bytes=%llu", 848f376df2bSJosef Bacik __entry->fsid, __get_str(reason), __entry->flush, 849f376df2bSJosef Bacik show_flush_action(__entry->flush), 850f376df2bSJosef Bacik (unsigned long long)__entry->flags, 851f376df2bSJosef Bacik __print_flags((unsigned long)__entry->flags, "|", 852f376df2bSJosef Bacik BTRFS_GROUP_FLAGS), 853f376df2bSJosef Bacik (unsigned long long)__entry->bytes) 854f376df2bSJosef Bacik ); 855f376df2bSJosef Bacik 856f376df2bSJosef Bacik #define show_flush_state(state) \ 857f376df2bSJosef Bacik __print_symbolic(state, \ 858f376df2bSJosef Bacik { FLUSH_DELAYED_ITEMS_NR, "FLUSH_DELAYED_ITEMS_NR"}, \ 859f376df2bSJosef Bacik { FLUSH_DELAYED_ITEMS, "FLUSH_DELAYED_ITEMS"}, \ 860f376df2bSJosef Bacik { FLUSH_DELALLOC, "FLUSH_DELALLOC"}, \ 861f376df2bSJosef Bacik { FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT"}, \ 862f376df2bSJosef Bacik { ALLOC_CHUNK, "ALLOC_CHUNK"}, \ 863f376df2bSJosef Bacik { COMMIT_TRANS, "COMMIT_TRANS"}) 864f376df2bSJosef Bacik 865f376df2bSJosef Bacik TRACE_EVENT(btrfs_flush_space, 866f376df2bSJosef Bacik 867f376df2bSJosef Bacik TP_PROTO(struct btrfs_fs_info *fs_info, u64 flags, u64 num_bytes, 868f376df2bSJosef Bacik u64 orig_bytes, int state, int ret), 869f376df2bSJosef Bacik 870f376df2bSJosef Bacik TP_ARGS(fs_info, flags, num_bytes, orig_bytes, state, ret), 871f376df2bSJosef Bacik 872f376df2bSJosef Bacik TP_STRUCT__entry( 873f376df2bSJosef Bacik __array( u8, fsid, BTRFS_UUID_SIZE ) 874f376df2bSJosef Bacik __field( u64, flags ) 875f376df2bSJosef Bacik __field( u64, num_bytes ) 876f376df2bSJosef Bacik __field( u64, orig_bytes ) 877f376df2bSJosef Bacik __field( int, state ) 878f376df2bSJosef Bacik __field( int, ret ) 879f376df2bSJosef Bacik ), 880f376df2bSJosef Bacik 881f376df2bSJosef Bacik TP_fast_assign( 882f376df2bSJosef Bacik memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); 883f376df2bSJosef Bacik __entry->flags = flags; 884f376df2bSJosef Bacik __entry->num_bytes = num_bytes; 885f376df2bSJosef Bacik __entry->orig_bytes = orig_bytes; 886f376df2bSJosef Bacik __entry->state = state; 887f376df2bSJosef Bacik __entry->ret = ret; 888f376df2bSJosef Bacik ), 889f376df2bSJosef Bacik 890562a7a07SDavid Sterba TP_printk("%pU: state=%d(%s) flags=%llu(%s) num_bytes=%llu " 891562a7a07SDavid Sterba "orig_bytes=%llu ret=%d", __entry->fsid, __entry->state, 892f376df2bSJosef Bacik show_flush_state(__entry->state), 893f376df2bSJosef Bacik (unsigned long long)__entry->flags, 894f376df2bSJosef Bacik __print_flags((unsigned long)__entry->flags, "|", 895f376df2bSJosef Bacik BTRFS_GROUP_FLAGS), 896f376df2bSJosef Bacik (unsigned long long)__entry->num_bytes, 897f376df2bSJosef Bacik (unsigned long long)__entry->orig_bytes, __entry->ret) 898f376df2bSJosef Bacik ); 899f376df2bSJosef Bacik 9001abe9b8aSliubo DECLARE_EVENT_CLASS(btrfs__reserved_extent, 9011abe9b8aSliubo 90271ff6437SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), 9031abe9b8aSliubo 90471ff6437SJeff Mahoney TP_ARGS(fs_info, start, len), 9051abe9b8aSliubo 906bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 9071abe9b8aSliubo __field( u64, start ) 9081abe9b8aSliubo __field( u64, len ) 9091abe9b8aSliubo ), 9101abe9b8aSliubo 91171ff6437SJeff Mahoney TP_fast_assign_btrfs(fs_info, 9121abe9b8aSliubo __entry->start = start; 9131abe9b8aSliubo __entry->len = len; 9141abe9b8aSliubo ), 9151abe9b8aSliubo 916562a7a07SDavid Sterba TP_printk_btrfs("root=%llu(%s) start=%llu len=%llu", 91771ff6437SJeff Mahoney show_root_type(BTRFS_EXTENT_TREE_OBJECTID), 9181abe9b8aSliubo (unsigned long long)__entry->start, 9191abe9b8aSliubo (unsigned long long)__entry->len) 9201abe9b8aSliubo ); 9211abe9b8aSliubo 9221abe9b8aSliubo DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_alloc, 9231abe9b8aSliubo 92471ff6437SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), 9251abe9b8aSliubo 92671ff6437SJeff Mahoney TP_ARGS(fs_info, start, len) 9271abe9b8aSliubo ); 9281abe9b8aSliubo 9291abe9b8aSliubo DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free, 9301abe9b8aSliubo 93171ff6437SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), 9321abe9b8aSliubo 93371ff6437SJeff Mahoney TP_ARGS(fs_info, start, len) 9341abe9b8aSliubo ); 9351abe9b8aSliubo 9363f7de037SJosef Bacik TRACE_EVENT(find_free_extent, 9373f7de037SJosef Bacik 93871ff6437SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, 9393f7de037SJosef Bacik u64 data), 9403f7de037SJosef Bacik 94171ff6437SJeff Mahoney TP_ARGS(fs_info, num_bytes, empty_size, data), 9423f7de037SJosef Bacik 943bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 9443f7de037SJosef Bacik __field( u64, num_bytes ) 9453f7de037SJosef Bacik __field( u64, empty_size ) 9463f7de037SJosef Bacik __field( u64, data ) 9473f7de037SJosef Bacik ), 9483f7de037SJosef Bacik 94971ff6437SJeff Mahoney TP_fast_assign_btrfs(fs_info, 9503f7de037SJosef Bacik __entry->num_bytes = num_bytes; 9513f7de037SJosef Bacik __entry->empty_size = empty_size; 9523f7de037SJosef Bacik __entry->data = data; 9533f7de037SJosef Bacik ), 9543f7de037SJosef Bacik 955562a7a07SDavid Sterba TP_printk_btrfs("root=%Lu(%s) len=%Lu empty_size=%Lu flags=%Lu(%s)", 95671ff6437SJeff Mahoney show_root_type(BTRFS_EXTENT_TREE_OBJECTID), 9573f7de037SJosef Bacik __entry->num_bytes, __entry->empty_size, __entry->data, 9583f7de037SJosef Bacik __print_flags((unsigned long)__entry->data, "|", 9593f7de037SJosef Bacik BTRFS_GROUP_FLAGS)) 9603f7de037SJosef Bacik ); 9613f7de037SJosef Bacik 9623f7de037SJosef Bacik DECLARE_EVENT_CLASS(btrfs__reserve_extent, 9633f7de037SJosef Bacik 96471ff6437SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 9653f7de037SJosef Bacik struct btrfs_block_group_cache *block_group, u64 start, 9663f7de037SJosef Bacik u64 len), 9673f7de037SJosef Bacik 96871ff6437SJeff Mahoney TP_ARGS(fs_info, block_group, start, len), 9693f7de037SJosef Bacik 970bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 9713f7de037SJosef Bacik __field( u64, bg_objectid ) 9723f7de037SJosef Bacik __field( u64, flags ) 9733f7de037SJosef Bacik __field( u64, start ) 9743f7de037SJosef Bacik __field( u64, len ) 9753f7de037SJosef Bacik ), 9763f7de037SJosef Bacik 97771ff6437SJeff Mahoney TP_fast_assign_btrfs(fs_info, 9783f7de037SJosef Bacik __entry->bg_objectid = block_group->key.objectid; 9793f7de037SJosef Bacik __entry->flags = block_group->flags; 9803f7de037SJosef Bacik __entry->start = start; 9813f7de037SJosef Bacik __entry->len = len; 9823f7de037SJosef Bacik ), 9833f7de037SJosef Bacik 984562a7a07SDavid Sterba TP_printk_btrfs("root=%Lu(%s) block_group=%Lu flags=%Lu(%s) " 985562a7a07SDavid Sterba "start=%Lu len=%Lu", 98671ff6437SJeff Mahoney show_root_type(BTRFS_EXTENT_TREE_OBJECTID), 98771ff6437SJeff Mahoney __entry->bg_objectid, 9883f7de037SJosef Bacik __entry->flags, __print_flags((unsigned long)__entry->flags, 9893f7de037SJosef Bacik "|", BTRFS_GROUP_FLAGS), 9903f7de037SJosef Bacik __entry->start, __entry->len) 9913f7de037SJosef Bacik ); 9923f7de037SJosef Bacik 9933f7de037SJosef Bacik DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent, 9943f7de037SJosef Bacik 99571ff6437SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 9963f7de037SJosef Bacik struct btrfs_block_group_cache *block_group, u64 start, 9973f7de037SJosef Bacik u64 len), 9983f7de037SJosef Bacik 99971ff6437SJeff Mahoney TP_ARGS(fs_info, block_group, start, len) 10003f7de037SJosef Bacik ); 10013f7de037SJosef Bacik 10023f7de037SJosef Bacik DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster, 10033f7de037SJosef Bacik 100471ff6437SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 10053f7de037SJosef Bacik struct btrfs_block_group_cache *block_group, u64 start, 10063f7de037SJosef Bacik u64 len), 10073f7de037SJosef Bacik 100871ff6437SJeff Mahoney TP_ARGS(fs_info, block_group, start, len) 10093f7de037SJosef Bacik ); 10103f7de037SJosef Bacik 10113f7de037SJosef Bacik TRACE_EVENT(btrfs_find_cluster, 10123f7de037SJosef Bacik 10133f7de037SJosef Bacik TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start, 10143f7de037SJosef Bacik u64 bytes, u64 empty_size, u64 min_bytes), 10153f7de037SJosef Bacik 10163f7de037SJosef Bacik TP_ARGS(block_group, start, bytes, empty_size, min_bytes), 10173f7de037SJosef Bacik 1018bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 10193f7de037SJosef Bacik __field( u64, bg_objectid ) 10203f7de037SJosef Bacik __field( u64, flags ) 10213f7de037SJosef Bacik __field( u64, start ) 10223f7de037SJosef Bacik __field( u64, bytes ) 10233f7de037SJosef Bacik __field( u64, empty_size ) 10243f7de037SJosef Bacik __field( u64, min_bytes ) 10253f7de037SJosef Bacik ), 10263f7de037SJosef Bacik 1027bc074524SJeff Mahoney TP_fast_assign_btrfs(block_group->fs_info, 10283f7de037SJosef Bacik __entry->bg_objectid = block_group->key.objectid; 10293f7de037SJosef Bacik __entry->flags = block_group->flags; 10303f7de037SJosef Bacik __entry->start = start; 10313f7de037SJosef Bacik __entry->bytes = bytes; 10323f7de037SJosef Bacik __entry->empty_size = empty_size; 10333f7de037SJosef Bacik __entry->min_bytes = min_bytes; 10343f7de037SJosef Bacik ), 10353f7de037SJosef Bacik 1036562a7a07SDavid Sterba TP_printk_btrfs("block_group=%Lu flags=%Lu(%s) start=%Lu len=%Lu " 1037562a7a07SDavid Sterba "empty_size=%Lu min_bytes=%Lu", __entry->bg_objectid, 10383f7de037SJosef Bacik __entry->flags, 10393f7de037SJosef Bacik __print_flags((unsigned long)__entry->flags, "|", 10403f7de037SJosef Bacik BTRFS_GROUP_FLAGS), __entry->start, 10413f7de037SJosef Bacik __entry->bytes, __entry->empty_size, __entry->min_bytes) 10423f7de037SJosef Bacik ); 10433f7de037SJosef Bacik 10443f7de037SJosef Bacik TRACE_EVENT(btrfs_failed_cluster_setup, 10453f7de037SJosef Bacik 10463f7de037SJosef Bacik TP_PROTO(struct btrfs_block_group_cache *block_group), 10473f7de037SJosef Bacik 10483f7de037SJosef Bacik TP_ARGS(block_group), 10493f7de037SJosef Bacik 1050bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 10513f7de037SJosef Bacik __field( u64, bg_objectid ) 10523f7de037SJosef Bacik ), 10533f7de037SJosef Bacik 1054bc074524SJeff Mahoney TP_fast_assign_btrfs(block_group->fs_info, 10553f7de037SJosef Bacik __entry->bg_objectid = block_group->key.objectid; 10563f7de037SJosef Bacik ), 10573f7de037SJosef Bacik 1058bc074524SJeff Mahoney TP_printk_btrfs("block_group=%Lu", __entry->bg_objectid) 10593f7de037SJosef Bacik ); 10603f7de037SJosef Bacik 10613f7de037SJosef Bacik TRACE_EVENT(btrfs_setup_cluster, 10623f7de037SJosef Bacik 10633f7de037SJosef Bacik TP_PROTO(struct btrfs_block_group_cache *block_group, 10643f7de037SJosef Bacik struct btrfs_free_cluster *cluster, u64 size, int bitmap), 10653f7de037SJosef Bacik 10663f7de037SJosef Bacik TP_ARGS(block_group, cluster, size, bitmap), 10673f7de037SJosef Bacik 1068bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 10693f7de037SJosef Bacik __field( u64, bg_objectid ) 10703f7de037SJosef Bacik __field( u64, flags ) 10713f7de037SJosef Bacik __field( u64, start ) 10723f7de037SJosef Bacik __field( u64, max_size ) 10733f7de037SJosef Bacik __field( u64, size ) 10743f7de037SJosef Bacik __field( int, bitmap ) 10753f7de037SJosef Bacik ), 10763f7de037SJosef Bacik 1077bc074524SJeff Mahoney TP_fast_assign_btrfs(block_group->fs_info, 10783f7de037SJosef Bacik __entry->bg_objectid = block_group->key.objectid; 10793f7de037SJosef Bacik __entry->flags = block_group->flags; 10803f7de037SJosef Bacik __entry->start = cluster->window_start; 10813f7de037SJosef Bacik __entry->max_size = cluster->max_size; 10823f7de037SJosef Bacik __entry->size = size; 10833f7de037SJosef Bacik __entry->bitmap = bitmap; 10843f7de037SJosef Bacik ), 10853f7de037SJosef Bacik 1086562a7a07SDavid Sterba TP_printk_btrfs("block_group=%Lu flags=%Lu(%s) window_start=%Lu " 1087562a7a07SDavid Sterba "size=%Lu max_size=%Lu bitmap=%d", 10883f7de037SJosef Bacik __entry->bg_objectid, 10893f7de037SJosef Bacik __entry->flags, 10903f7de037SJosef Bacik __print_flags((unsigned long)__entry->flags, "|", 10913f7de037SJosef Bacik BTRFS_GROUP_FLAGS), __entry->start, 10923f7de037SJosef Bacik __entry->size, __entry->max_size, __entry->bitmap) 10933f7de037SJosef Bacik ); 10943f7de037SJosef Bacik 1095143bede5SJeff Mahoney struct extent_state; 1096143bede5SJeff Mahoney TRACE_EVENT(alloc_extent_state, 1097143bede5SJeff Mahoney 1098143bede5SJeff Mahoney TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP), 1099143bede5SJeff Mahoney 1100143bede5SJeff Mahoney TP_ARGS(state, mask, IP), 1101143bede5SJeff Mahoney 1102143bede5SJeff Mahoney TP_STRUCT__entry( 1103143bede5SJeff Mahoney __field(struct extent_state *, state) 1104143bede5SJeff Mahoney __field(gfp_t, mask) 1105143bede5SJeff Mahoney __field(unsigned long, ip) 1106143bede5SJeff Mahoney ), 1107143bede5SJeff Mahoney 1108143bede5SJeff Mahoney TP_fast_assign( 1109143bede5SJeff Mahoney __entry->state = state, 1110143bede5SJeff Mahoney __entry->mask = mask, 1111143bede5SJeff Mahoney __entry->ip = IP 1112143bede5SJeff Mahoney ), 1113143bede5SJeff Mahoney 1114562a7a07SDavid Sterba TP_printk("state=%p mask=%s caller=%pS", __entry->state, 1115143bede5SJeff Mahoney show_gfp_flags(__entry->mask), (void *)__entry->ip) 1116143bede5SJeff Mahoney ); 1117143bede5SJeff Mahoney 1118143bede5SJeff Mahoney TRACE_EVENT(free_extent_state, 1119143bede5SJeff Mahoney 1120143bede5SJeff Mahoney TP_PROTO(struct extent_state *state, unsigned long IP), 1121143bede5SJeff Mahoney 1122143bede5SJeff Mahoney TP_ARGS(state, IP), 1123143bede5SJeff Mahoney 1124143bede5SJeff Mahoney TP_STRUCT__entry( 1125143bede5SJeff Mahoney __field(struct extent_state *, state) 1126143bede5SJeff Mahoney __field(unsigned long, ip) 1127143bede5SJeff Mahoney ), 1128143bede5SJeff Mahoney 1129143bede5SJeff Mahoney TP_fast_assign( 1130143bede5SJeff Mahoney __entry->state = state, 1131143bede5SJeff Mahoney __entry->ip = IP 1132143bede5SJeff Mahoney ), 1133143bede5SJeff Mahoney 1134562a7a07SDavid Sterba TP_printk("state=%p caller=%pS", __entry->state, 1135143bede5SJeff Mahoney (void *)__entry->ip) 1136143bede5SJeff Mahoney ); 1137143bede5SJeff Mahoney 113852483bc2SQu Wenruo DECLARE_EVENT_CLASS(btrfs__work, 113952483bc2SQu Wenruo 114052483bc2SQu Wenruo TP_PROTO(struct btrfs_work *work), 114152483bc2SQu Wenruo 114252483bc2SQu Wenruo TP_ARGS(work), 114352483bc2SQu Wenruo 1144bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 114552483bc2SQu Wenruo __field( void *, work ) 114652483bc2SQu Wenruo __field( void *, wq ) 114752483bc2SQu Wenruo __field( void *, func ) 114852483bc2SQu Wenruo __field( void *, ordered_func ) 114952483bc2SQu Wenruo __field( void *, ordered_free ) 1150b38a6258SLiu Bo __field( void *, normal_work ) 115152483bc2SQu Wenruo ), 115252483bc2SQu Wenruo 1153bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_work_owner(work), 115452483bc2SQu Wenruo __entry->work = work; 115552483bc2SQu Wenruo __entry->wq = work->wq; 115652483bc2SQu Wenruo __entry->func = work->func; 115752483bc2SQu Wenruo __entry->ordered_func = work->ordered_func; 115852483bc2SQu Wenruo __entry->ordered_free = work->ordered_free; 1159b38a6258SLiu Bo __entry->normal_work = &work->normal_work; 116052483bc2SQu Wenruo ), 116152483bc2SQu Wenruo 1162562a7a07SDavid Sterba TP_printk_btrfs("work=%p (normal_work=%p) wq=%p func=%pf ordered_func=%p " 1163b38a6258SLiu Bo "ordered_free=%p", 1164b38a6258SLiu Bo __entry->work, __entry->normal_work, __entry->wq, 1165b38a6258SLiu Bo __entry->func, __entry->ordered_func, __entry->ordered_free) 116652483bc2SQu Wenruo ); 116752483bc2SQu Wenruo 1168ac0c7cf8SDavid Sterba /* 1169ac0c7cf8SDavid Sterba * For situiations when the work is freed, we pass fs_info and a tag that that 1170ac0c7cf8SDavid Sterba * matches address of the work structure so it can be paired with the 1171ac0c7cf8SDavid Sterba * scheduling event. 1172ac0c7cf8SDavid Sterba */ 117352483bc2SQu Wenruo DECLARE_EVENT_CLASS(btrfs__work__done, 117452483bc2SQu Wenruo 1175ac0c7cf8SDavid Sterba TP_PROTO(struct btrfs_fs_info *fs_info, void *wtag), 117652483bc2SQu Wenruo 1177ac0c7cf8SDavid Sterba TP_ARGS(fs_info, wtag), 117852483bc2SQu Wenruo 1179bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 1180ac0c7cf8SDavid Sterba __field( void *, wtag ) 118152483bc2SQu Wenruo ), 118252483bc2SQu Wenruo 1183ac0c7cf8SDavid Sterba TP_fast_assign_btrfs(fs_info, 1184ac0c7cf8SDavid Sterba __entry->wtag = wtag; 118552483bc2SQu Wenruo ), 118652483bc2SQu Wenruo 1187ac0c7cf8SDavid Sterba TP_printk_btrfs("work->%p", __entry->wtag) 118852483bc2SQu Wenruo ); 118952483bc2SQu Wenruo 119052483bc2SQu Wenruo DEFINE_EVENT(btrfs__work, btrfs_work_queued, 119152483bc2SQu Wenruo 119252483bc2SQu Wenruo TP_PROTO(struct btrfs_work *work), 119352483bc2SQu Wenruo 119452483bc2SQu Wenruo TP_ARGS(work) 119552483bc2SQu Wenruo ); 119652483bc2SQu Wenruo 119752483bc2SQu Wenruo DEFINE_EVENT(btrfs__work, btrfs_work_sched, 119852483bc2SQu Wenruo 119952483bc2SQu Wenruo TP_PROTO(struct btrfs_work *work), 120052483bc2SQu Wenruo 120152483bc2SQu Wenruo TP_ARGS(work) 120252483bc2SQu Wenruo ); 120352483bc2SQu Wenruo 120452483bc2SQu Wenruo DEFINE_EVENT(btrfs__work__done, btrfs_all_work_done, 120552483bc2SQu Wenruo 1206ac0c7cf8SDavid Sterba TP_PROTO(struct btrfs_fs_info *fs_info, void *wtag), 120752483bc2SQu Wenruo 1208ac0c7cf8SDavid Sterba TP_ARGS(fs_info, wtag) 120952483bc2SQu Wenruo ); 121052483bc2SQu Wenruo 121152483bc2SQu Wenruo DEFINE_EVENT(btrfs__work, btrfs_ordered_sched, 121252483bc2SQu Wenruo 121352483bc2SQu Wenruo TP_PROTO(struct btrfs_work *work), 121452483bc2SQu Wenruo 121552483bc2SQu Wenruo TP_ARGS(work) 121652483bc2SQu Wenruo ); 121752483bc2SQu Wenruo 1218c3a46891SQu Wenruo DECLARE_EVENT_CLASS(btrfs__workqueue, 1219c3a46891SQu Wenruo 1220c3a46891SQu Wenruo TP_PROTO(struct __btrfs_workqueue *wq, const char *name, int high), 1221c3a46891SQu Wenruo 1222c3a46891SQu Wenruo TP_ARGS(wq, name, high), 1223c3a46891SQu Wenruo 1224bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 1225c3a46891SQu Wenruo __field( void *, wq ) 1226c3a46891SQu Wenruo __string( name, name ) 1227c3a46891SQu Wenruo __field( int , high ) 1228c3a46891SQu Wenruo ), 1229c3a46891SQu Wenruo 1230bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_workqueue_owner(wq), 1231c3a46891SQu Wenruo __entry->wq = wq; 1232c3a46891SQu Wenruo __assign_str(name, name); 1233c3a46891SQu Wenruo __entry->high = high; 1234c3a46891SQu Wenruo ), 1235c3a46891SQu Wenruo 1236562a7a07SDavid Sterba TP_printk_btrfs("name=%s%s wq=%p", __get_str(name), 1237c3a46891SQu Wenruo __print_flags(__entry->high, "", 1238c3a46891SQu Wenruo {(WQ_HIGHPRI), "-high"}), 1239c3a46891SQu Wenruo __entry->wq) 1240c3a46891SQu Wenruo ); 1241c3a46891SQu Wenruo 1242c3a46891SQu Wenruo DEFINE_EVENT(btrfs__workqueue, btrfs_workqueue_alloc, 1243c3a46891SQu Wenruo 1244c3a46891SQu Wenruo TP_PROTO(struct __btrfs_workqueue *wq, const char *name, int high), 1245c3a46891SQu Wenruo 1246c3a46891SQu Wenruo TP_ARGS(wq, name, high) 1247c3a46891SQu Wenruo ); 1248c3a46891SQu Wenruo 1249c3a46891SQu Wenruo DECLARE_EVENT_CLASS(btrfs__workqueue_done, 1250c3a46891SQu Wenruo 1251c3a46891SQu Wenruo TP_PROTO(struct __btrfs_workqueue *wq), 1252c3a46891SQu Wenruo 1253c3a46891SQu Wenruo TP_ARGS(wq), 1254c3a46891SQu Wenruo 1255bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 1256c3a46891SQu Wenruo __field( void *, wq ) 1257c3a46891SQu Wenruo ), 1258c3a46891SQu Wenruo 1259bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_workqueue_owner(wq), 1260c3a46891SQu Wenruo __entry->wq = wq; 1261c3a46891SQu Wenruo ), 1262c3a46891SQu Wenruo 1263bc074524SJeff Mahoney TP_printk_btrfs("wq=%p", __entry->wq) 1264c3a46891SQu Wenruo ); 1265c3a46891SQu Wenruo 1266c3a46891SQu Wenruo DEFINE_EVENT(btrfs__workqueue_done, btrfs_workqueue_destroy, 1267c3a46891SQu Wenruo 1268c3a46891SQu Wenruo TP_PROTO(struct __btrfs_workqueue *wq), 1269c3a46891SQu Wenruo 1270c3a46891SQu Wenruo TP_ARGS(wq) 1271c3a46891SQu Wenruo ); 127252483bc2SQu Wenruo 127381fb6f77SQu Wenruo DECLARE_EVENT_CLASS(btrfs__qgroup_data_map, 127481fb6f77SQu Wenruo 127581fb6f77SQu Wenruo TP_PROTO(struct inode *inode, u64 free_reserved), 127681fb6f77SQu Wenruo 127781fb6f77SQu Wenruo TP_ARGS(inode, free_reserved), 127881fb6f77SQu Wenruo 1279bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 128081fb6f77SQu Wenruo __field( u64, rootid ) 128181fb6f77SQu Wenruo __field( unsigned long, ino ) 128281fb6f77SQu Wenruo __field( u64, free_reserved ) 128381fb6f77SQu Wenruo ), 128481fb6f77SQu Wenruo 1285bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), 128681fb6f77SQu Wenruo __entry->rootid = BTRFS_I(inode)->root->objectid; 128781fb6f77SQu Wenruo __entry->ino = inode->i_ino; 128881fb6f77SQu Wenruo __entry->free_reserved = free_reserved; 128981fb6f77SQu Wenruo ), 129081fb6f77SQu Wenruo 1291562a7a07SDavid Sterba TP_printk_btrfs("rootid=%llu ino=%lu free_reserved=%llu", 129281fb6f77SQu Wenruo __entry->rootid, __entry->ino, __entry->free_reserved) 129381fb6f77SQu Wenruo ); 129481fb6f77SQu Wenruo 129581fb6f77SQu Wenruo DEFINE_EVENT(btrfs__qgroup_data_map, btrfs_qgroup_init_data_rsv_map, 129681fb6f77SQu Wenruo 129781fb6f77SQu Wenruo TP_PROTO(struct inode *inode, u64 free_reserved), 129881fb6f77SQu Wenruo 129981fb6f77SQu Wenruo TP_ARGS(inode, free_reserved) 130081fb6f77SQu Wenruo ); 130181fb6f77SQu Wenruo 130281fb6f77SQu Wenruo DEFINE_EVENT(btrfs__qgroup_data_map, btrfs_qgroup_free_data_rsv_map, 130381fb6f77SQu Wenruo 130481fb6f77SQu Wenruo TP_PROTO(struct inode *inode, u64 free_reserved), 130581fb6f77SQu Wenruo 130681fb6f77SQu Wenruo TP_ARGS(inode, free_reserved) 130781fb6f77SQu Wenruo ); 130881fb6f77SQu Wenruo 130981fb6f77SQu Wenruo #define BTRFS_QGROUP_OPERATIONS \ 131081fb6f77SQu Wenruo { QGROUP_RESERVE, "reserve" }, \ 131181fb6f77SQu Wenruo { QGROUP_RELEASE, "release" }, \ 131281fb6f77SQu Wenruo { QGROUP_FREE, "free" } 131381fb6f77SQu Wenruo 131481fb6f77SQu Wenruo DECLARE_EVENT_CLASS(btrfs__qgroup_rsv_data, 131581fb6f77SQu Wenruo 131681fb6f77SQu Wenruo TP_PROTO(struct inode *inode, u64 start, u64 len, u64 reserved, int op), 131781fb6f77SQu Wenruo 131881fb6f77SQu Wenruo TP_ARGS(inode, start, len, reserved, op), 131981fb6f77SQu Wenruo 1320bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 132181fb6f77SQu Wenruo __field( u64, rootid ) 132281fb6f77SQu Wenruo __field( unsigned long, ino ) 132381fb6f77SQu Wenruo __field( u64, start ) 132481fb6f77SQu Wenruo __field( u64, len ) 132581fb6f77SQu Wenruo __field( u64, reserved ) 132681fb6f77SQu Wenruo __field( int, op ) 132781fb6f77SQu Wenruo ), 132881fb6f77SQu Wenruo 1329bc074524SJeff Mahoney TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), 133081fb6f77SQu Wenruo __entry->rootid = BTRFS_I(inode)->root->objectid; 133181fb6f77SQu Wenruo __entry->ino = inode->i_ino; 133281fb6f77SQu Wenruo __entry->start = start; 133381fb6f77SQu Wenruo __entry->len = len; 133481fb6f77SQu Wenruo __entry->reserved = reserved; 133581fb6f77SQu Wenruo __entry->op = op; 133681fb6f77SQu Wenruo ), 133781fb6f77SQu Wenruo 1338562a7a07SDavid Sterba TP_printk_btrfs("root=%llu ino=%lu start=%llu len=%llu reserved=%llu op=%s", 133981fb6f77SQu Wenruo __entry->rootid, __entry->ino, __entry->start, __entry->len, 134081fb6f77SQu Wenruo __entry->reserved, 134181fb6f77SQu Wenruo __print_flags((unsigned long)__entry->op, "", 134281fb6f77SQu Wenruo BTRFS_QGROUP_OPERATIONS) 134381fb6f77SQu Wenruo ) 134481fb6f77SQu Wenruo ); 134581fb6f77SQu Wenruo 134681fb6f77SQu Wenruo DEFINE_EVENT(btrfs__qgroup_rsv_data, btrfs_qgroup_reserve_data, 134781fb6f77SQu Wenruo 134881fb6f77SQu Wenruo TP_PROTO(struct inode *inode, u64 start, u64 len, u64 reserved, int op), 134981fb6f77SQu Wenruo 135081fb6f77SQu Wenruo TP_ARGS(inode, start, len, reserved, op) 135181fb6f77SQu Wenruo ); 135281fb6f77SQu Wenruo 135381fb6f77SQu Wenruo DEFINE_EVENT(btrfs__qgroup_rsv_data, btrfs_qgroup_release_data, 135481fb6f77SQu Wenruo 135581fb6f77SQu Wenruo TP_PROTO(struct inode *inode, u64 start, u64 len, u64 reserved, int op), 135681fb6f77SQu Wenruo 135781fb6f77SQu Wenruo TP_ARGS(inode, start, len, reserved, op) 135881fb6f77SQu Wenruo ); 135981fb6f77SQu Wenruo 136081fb6f77SQu Wenruo DECLARE_EVENT_CLASS(btrfs__qgroup_delayed_ref, 136181fb6f77SQu Wenruo 1362bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 ref_root, u64 reserved), 136381fb6f77SQu Wenruo 1364bc074524SJeff Mahoney TP_ARGS(fs_info, ref_root, reserved), 136581fb6f77SQu Wenruo 1366bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 136781fb6f77SQu Wenruo __field( u64, ref_root ) 136881fb6f77SQu Wenruo __field( u64, reserved ) 136981fb6f77SQu Wenruo ), 137081fb6f77SQu Wenruo 1371bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 137281fb6f77SQu Wenruo __entry->ref_root = ref_root; 137381fb6f77SQu Wenruo __entry->reserved = reserved; 137481fb6f77SQu Wenruo ), 137581fb6f77SQu Wenruo 1376562a7a07SDavid Sterba TP_printk_btrfs("root=%llu reserved=%llu op=free", 137781fb6f77SQu Wenruo __entry->ref_root, __entry->reserved) 137881fb6f77SQu Wenruo ); 137981fb6f77SQu Wenruo 138081fb6f77SQu Wenruo DEFINE_EVENT(btrfs__qgroup_delayed_ref, btrfs_qgroup_free_delayed_ref, 138181fb6f77SQu Wenruo 1382bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 ref_root, u64 reserved), 138381fb6f77SQu Wenruo 1384bc074524SJeff Mahoney TP_ARGS(fs_info, ref_root, reserved) 138581fb6f77SQu Wenruo ); 13860f5dcf8dSMark Fasheh 13870f5dcf8dSMark Fasheh DECLARE_EVENT_CLASS(btrfs_qgroup_extent, 1388bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 1389bc074524SJeff Mahoney struct btrfs_qgroup_extent_record *rec), 13900f5dcf8dSMark Fasheh 1391bc074524SJeff Mahoney TP_ARGS(fs_info, rec), 13920f5dcf8dSMark Fasheh 1393bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 13940f5dcf8dSMark Fasheh __field( u64, bytenr ) 13950f5dcf8dSMark Fasheh __field( u64, num_bytes ) 13960f5dcf8dSMark Fasheh ), 13970f5dcf8dSMark Fasheh 1398bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 13990f5dcf8dSMark Fasheh __entry->bytenr = rec->bytenr, 14000f5dcf8dSMark Fasheh __entry->num_bytes = rec->num_bytes; 14010f5dcf8dSMark Fasheh ), 14020f5dcf8dSMark Fasheh 1403562a7a07SDavid Sterba TP_printk_btrfs("bytenr=%llu num_bytes=%llu", 14040f5dcf8dSMark Fasheh (unsigned long long)__entry->bytenr, 14050f5dcf8dSMark Fasheh (unsigned long long)__entry->num_bytes) 14060f5dcf8dSMark Fasheh ); 14070f5dcf8dSMark Fasheh 14080f5dcf8dSMark Fasheh DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_account_extents, 14090f5dcf8dSMark Fasheh 1410bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 1411bc074524SJeff Mahoney struct btrfs_qgroup_extent_record *rec), 14120f5dcf8dSMark Fasheh 1413bc074524SJeff Mahoney TP_ARGS(fs_info, rec) 14140f5dcf8dSMark Fasheh ); 14150f5dcf8dSMark Fasheh 141650b3e040SQu Wenruo DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_trace_extent, 14170f5dcf8dSMark Fasheh 1418bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, 1419bc074524SJeff Mahoney struct btrfs_qgroup_extent_record *rec), 14200f5dcf8dSMark Fasheh 1421bc074524SJeff Mahoney TP_ARGS(fs_info, rec) 14220f5dcf8dSMark Fasheh ); 14230f5dcf8dSMark Fasheh 14240f5dcf8dSMark Fasheh TRACE_EVENT(btrfs_qgroup_account_extent, 14250f5dcf8dSMark Fasheh 1426bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 bytenr, 1427bc074524SJeff Mahoney u64 num_bytes, u64 nr_old_roots, u64 nr_new_roots), 14280f5dcf8dSMark Fasheh 1429bc074524SJeff Mahoney TP_ARGS(fs_info, bytenr, num_bytes, nr_old_roots, nr_new_roots), 14300f5dcf8dSMark Fasheh 1431bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 14320f5dcf8dSMark Fasheh __field( u64, bytenr ) 14330f5dcf8dSMark Fasheh __field( u64, num_bytes ) 14340f5dcf8dSMark Fasheh __field( u64, nr_old_roots ) 14350f5dcf8dSMark Fasheh __field( u64, nr_new_roots ) 14360f5dcf8dSMark Fasheh ), 14370f5dcf8dSMark Fasheh 1438bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 14390f5dcf8dSMark Fasheh __entry->bytenr = bytenr; 14400f5dcf8dSMark Fasheh __entry->num_bytes = num_bytes; 14410f5dcf8dSMark Fasheh __entry->nr_old_roots = nr_old_roots; 14420f5dcf8dSMark Fasheh __entry->nr_new_roots = nr_new_roots; 14430f5dcf8dSMark Fasheh ), 14440f5dcf8dSMark Fasheh 1445562a7a07SDavid Sterba TP_printk_btrfs("bytenr=%llu num_bytes=%llu nr_old_roots=%llu " 14460f5dcf8dSMark Fasheh "nr_new_roots=%llu", 14470f5dcf8dSMark Fasheh __entry->bytenr, 14480f5dcf8dSMark Fasheh __entry->num_bytes, 14490f5dcf8dSMark Fasheh __entry->nr_old_roots, 14500f5dcf8dSMark Fasheh __entry->nr_new_roots) 14510f5dcf8dSMark Fasheh ); 14520f5dcf8dSMark Fasheh 14530f5dcf8dSMark Fasheh TRACE_EVENT(qgroup_update_counters, 14540f5dcf8dSMark Fasheh 1455bc074524SJeff Mahoney TP_PROTO(struct btrfs_fs_info *fs_info, u64 qgid, 1456bc074524SJeff Mahoney u64 cur_old_count, u64 cur_new_count), 14570f5dcf8dSMark Fasheh 1458bc074524SJeff Mahoney TP_ARGS(fs_info, qgid, cur_old_count, cur_new_count), 14590f5dcf8dSMark Fasheh 1460bc074524SJeff Mahoney TP_STRUCT__entry_btrfs( 14610f5dcf8dSMark Fasheh __field( u64, qgid ) 14620f5dcf8dSMark Fasheh __field( u64, cur_old_count ) 14630f5dcf8dSMark Fasheh __field( u64, cur_new_count ) 14640f5dcf8dSMark Fasheh ), 14650f5dcf8dSMark Fasheh 1466bc074524SJeff Mahoney TP_fast_assign_btrfs(fs_info, 14670f5dcf8dSMark Fasheh __entry->qgid = qgid; 14680f5dcf8dSMark Fasheh __entry->cur_old_count = cur_old_count; 14690f5dcf8dSMark Fasheh __entry->cur_new_count = cur_new_count; 14700f5dcf8dSMark Fasheh ), 14710f5dcf8dSMark Fasheh 1472562a7a07SDavid Sterba TP_printk_btrfs("qgid=%llu cur_old_count=%llu cur_new_count=%llu", 14730f5dcf8dSMark Fasheh __entry->qgid, 14740f5dcf8dSMark Fasheh __entry->cur_old_count, 14750f5dcf8dSMark Fasheh __entry->cur_new_count) 14760f5dcf8dSMark Fasheh ); 14770f5dcf8dSMark Fasheh 14781abe9b8aSliubo #endif /* _TRACE_BTRFS_H */ 14791abe9b8aSliubo 14801abe9b8aSliubo /* This part must be outside protection */ 14811abe9b8aSliubo #include <trace/define_trace.h> 1482