liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM btrfs |
| 3 | |
| 4 | #if !defined(_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_BTRFS_H |
| 6 | |
| 7 | #include <linux/writeback.h> |
| 8 | #include <linux/tracepoint.h> |
Vlastimil Babka | 420adbe9 | 2016-03-15 14:55:52 -0700 | [diff] [blame] | 9 | #include <trace/events/mmflags.h> |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 10 | |
| 11 | struct btrfs_root; |
| 12 | struct btrfs_fs_info; |
| 13 | struct btrfs_inode; |
| 14 | struct extent_map; |
Liu Bo | 09ed2f1 | 2017-03-10 11:09:48 -0800 | [diff] [blame^] | 15 | struct btrfs_file_extent_item; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 16 | struct btrfs_ordered_extent; |
| 17 | struct btrfs_delayed_ref_node; |
| 18 | struct btrfs_delayed_tree_ref; |
| 19 | struct btrfs_delayed_data_ref; |
| 20 | struct btrfs_delayed_ref_head; |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 21 | struct btrfs_block_group_cache; |
| 22 | struct btrfs_free_cluster; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 23 | struct map_lookup; |
| 24 | struct extent_buffer; |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 25 | struct btrfs_work; |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 26 | struct __btrfs_workqueue; |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 27 | struct btrfs_qgroup_extent_record; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 28 | |
| 29 | #define show_ref_type(type) \ |
| 30 | __print_symbolic(type, \ |
| 31 | { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \ |
| 32 | { BTRFS_EXTENT_DATA_REF_KEY, "EXTENT_DATA_REF" }, \ |
| 33 | { BTRFS_EXTENT_REF_V0_KEY, "EXTENT_REF_V0" }, \ |
| 34 | { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \ |
| 35 | { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" }) |
| 36 | |
| 37 | #define __show_root_type(obj) \ |
liubo | 7f34b74 | 2011-04-19 09:35:31 +0800 | [diff] [blame] | 38 | __print_symbolic_u64(obj, \ |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 39 | { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \ |
| 40 | { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \ |
| 41 | { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \ |
| 42 | { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \ |
| 43 | { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \ |
| 44 | { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \ |
| 45 | { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \ |
| 46 | { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \ |
Liu Bo | e112e2b | 2013-05-26 13:50:28 +0000 | [diff] [blame] | 47 | { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \ |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 48 | { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \ |
Omar Sandoval | 208acb8 | 2015-09-29 20:50:34 -0700 | [diff] [blame] | 49 | { BTRFS_UUID_TREE_OBJECTID, "UUID_TREE" }, \ |
| 50 | { BTRFS_FREE_SPACE_TREE_OBJECTID, "FREE_SPACE_TREE" }, \ |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 51 | { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" }) |
| 52 | |
| 53 | #define show_root_type(obj) \ |
| 54 | obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \ |
Liu Bo | fb57dc8 | 2012-11-30 11:24:22 +0000 | [diff] [blame] | 55 | (obj >= BTRFS_ROOT_TREE_OBJECTID && \ |
Liu Bo | e112e2b | 2013-05-26 13:50:28 +0000 | [diff] [blame] | 56 | obj <= BTRFS_QUOTA_TREE_OBJECTID)) ? __show_root_type(obj) : "-" |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 57 | |
Liu Bo | 09ed2f1 | 2017-03-10 11:09:48 -0800 | [diff] [blame^] | 58 | #define show_fi_type(type) \ |
| 59 | __print_symbolic(type, \ |
| 60 | { BTRFS_FILE_EXTENT_INLINE, "INLINE" }, \ |
| 61 | { BTRFS_FILE_EXTENT_REG, "REG" }, \ |
| 62 | { BTRFS_FILE_EXTENT_PREALLOC, "PREALLOC"}) |
| 63 | |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 64 | #define BTRFS_GROUP_FLAGS \ |
Liu Bo | e112e2b | 2013-05-26 13:50:28 +0000 | [diff] [blame] | 65 | { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \ |
| 66 | { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \ |
| 67 | { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \ |
| 68 | { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \ |
| 69 | { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \ |
| 70 | { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \ |
| 71 | { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \ |
| 72 | { BTRFS_BLOCK_GROUP_RAID5, "RAID5"}, \ |
| 73 | { BTRFS_BLOCK_GROUP_RAID6, "RAID6"} |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 74 | |
Josef Bacik | 8c2a3ca | 2012-01-10 10:31:31 -0500 | [diff] [blame] | 75 | #define BTRFS_UUID_SIZE 16 |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 76 | #define TP_STRUCT__entry_fsid __array(u8, fsid, BTRFS_UUID_SIZE) |
| 77 | |
| 78 | #define TP_fast_assign_fsid(fs_info) \ |
| 79 | memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE) |
| 80 | |
| 81 | #define TP_STRUCT__entry_btrfs(args...) \ |
| 82 | TP_STRUCT__entry( \ |
| 83 | TP_STRUCT__entry_fsid \ |
| 84 | args) |
| 85 | #define TP_fast_assign_btrfs(fs_info, args...) \ |
| 86 | TP_fast_assign( \ |
| 87 | TP_fast_assign_fsid(fs_info); \ |
| 88 | args) |
| 89 | #define TP_printk_btrfs(fmt, args...) \ |
| 90 | TP_printk("%pU: " fmt, __entry->fsid, args) |
Josef Bacik | 8c2a3ca | 2012-01-10 10:31:31 -0500 | [diff] [blame] | 91 | |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 92 | TRACE_EVENT(btrfs_transaction_commit, |
| 93 | |
| 94 | TP_PROTO(struct btrfs_root *root), |
| 95 | |
| 96 | TP_ARGS(root), |
| 97 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 98 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 99 | __field( u64, generation ) |
| 100 | __field( u64, root_objectid ) |
| 101 | ), |
| 102 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 103 | TP_fast_assign_btrfs(root->fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 104 | __entry->generation = root->fs_info->generation; |
| 105 | __entry->root_objectid = root->root_key.objectid; |
| 106 | ), |
| 107 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 108 | TP_printk_btrfs("root = %llu(%s), gen = %llu", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 109 | show_root_type(__entry->root_objectid), |
| 110 | (unsigned long long)__entry->generation) |
| 111 | ); |
| 112 | |
| 113 | DECLARE_EVENT_CLASS(btrfs__inode, |
| 114 | |
| 115 | TP_PROTO(struct inode *inode), |
| 116 | |
| 117 | TP_ARGS(inode), |
| 118 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 119 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 120 | __field( ino_t, ino ) |
| 121 | __field( blkcnt_t, blocks ) |
| 122 | __field( u64, disk_i_size ) |
| 123 | __field( u64, generation ) |
| 124 | __field( u64, last_trans ) |
| 125 | __field( u64, logged_trans ) |
| 126 | __field( u64, root_objectid ) |
| 127 | ), |
| 128 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 129 | TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 130 | __entry->ino = inode->i_ino; |
| 131 | __entry->blocks = inode->i_blocks; |
| 132 | __entry->disk_i_size = BTRFS_I(inode)->disk_i_size; |
| 133 | __entry->generation = BTRFS_I(inode)->generation; |
| 134 | __entry->last_trans = BTRFS_I(inode)->last_trans; |
| 135 | __entry->logged_trans = BTRFS_I(inode)->logged_trans; |
| 136 | __entry->root_objectid = |
| 137 | BTRFS_I(inode)->root->root_key.objectid; |
| 138 | ), |
| 139 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 140 | TP_printk_btrfs("root=%llu(%s) gen=%llu ino=%lu blocks=%llu " |
| 141 | "disk_i_size=%llu last_trans=%llu logged_trans=%llu", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 142 | show_root_type(__entry->root_objectid), |
| 143 | (unsigned long long)__entry->generation, |
| 144 | (unsigned long)__entry->ino, |
| 145 | (unsigned long long)__entry->blocks, |
| 146 | (unsigned long long)__entry->disk_i_size, |
| 147 | (unsigned long long)__entry->last_trans, |
| 148 | (unsigned long long)__entry->logged_trans) |
| 149 | ); |
| 150 | |
| 151 | DEFINE_EVENT(btrfs__inode, btrfs_inode_new, |
| 152 | |
| 153 | TP_PROTO(struct inode *inode), |
| 154 | |
| 155 | TP_ARGS(inode) |
| 156 | ); |
| 157 | |
| 158 | DEFINE_EVENT(btrfs__inode, btrfs_inode_request, |
| 159 | |
| 160 | TP_PROTO(struct inode *inode), |
| 161 | |
| 162 | TP_ARGS(inode) |
| 163 | ); |
| 164 | |
| 165 | DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, |
| 166 | |
| 167 | TP_PROTO(struct inode *inode), |
| 168 | |
| 169 | TP_ARGS(inode) |
| 170 | ); |
| 171 | |
| 172 | #define __show_map_type(type) \ |
liubo | 7f34b74 | 2011-04-19 09:35:31 +0800 | [diff] [blame] | 173 | __print_symbolic_u64(type, \ |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 174 | { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \ |
| 175 | { EXTENT_MAP_HOLE, "HOLE" }, \ |
| 176 | { EXTENT_MAP_INLINE, "INLINE" }, \ |
| 177 | { EXTENT_MAP_DELALLOC, "DELALLOC" }) |
| 178 | |
| 179 | #define show_map_type(type) \ |
| 180 | type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" : __show_map_type(type) |
| 181 | |
| 182 | #define show_map_flags(flag) \ |
| 183 | __print_flags(flag, "|", \ |
Liu Bo | 254a2d1 | 2014-09-17 21:36:41 +0800 | [diff] [blame] | 184 | { (1 << EXTENT_FLAG_PINNED), "PINNED" },\ |
| 185 | { (1 << EXTENT_FLAG_COMPRESSED), "COMPRESSED" },\ |
| 186 | { (1 << EXTENT_FLAG_VACANCY), "VACANCY" },\ |
| 187 | { (1 << EXTENT_FLAG_PREALLOC), "PREALLOC" },\ |
| 188 | { (1 << EXTENT_FLAG_LOGGING), "LOGGING" },\ |
| 189 | { (1 << EXTENT_FLAG_FILLING), "FILLING" },\ |
| 190 | { (1 << EXTENT_FLAG_FS_MAPPING), "FS_MAPPING" }) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 191 | |
Steven Rostedt | 4cd8587 | 2013-11-14 22:57:29 -0500 | [diff] [blame] | 192 | TRACE_EVENT_CONDITION(btrfs_get_extent, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 193 | |
Nikolay Borisov | 4a0cc7c | 2017-01-10 20:35:31 +0200 | [diff] [blame] | 194 | TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, |
Liu Bo | 92a1bf7 | 2016-11-17 15:00:50 -0800 | [diff] [blame] | 195 | struct extent_map *map), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 196 | |
Liu Bo | 92a1bf7 | 2016-11-17 15:00:50 -0800 | [diff] [blame] | 197 | TP_ARGS(root, inode, map), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 198 | |
Steven Rostedt | 4cd8587 | 2013-11-14 22:57:29 -0500 | [diff] [blame] | 199 | TP_CONDITION(map), |
| 200 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 201 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 202 | __field( u64, root_objectid ) |
Liu Bo | 92a1bf7 | 2016-11-17 15:00:50 -0800 | [diff] [blame] | 203 | __field( u64, ino ) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 204 | __field( u64, start ) |
| 205 | __field( u64, len ) |
| 206 | __field( u64, orig_start ) |
| 207 | __field( u64, block_start ) |
| 208 | __field( u64, block_len ) |
| 209 | __field( unsigned long, flags ) |
| 210 | __field( int, refs ) |
| 211 | __field( unsigned int, compress_type ) |
| 212 | ), |
| 213 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 214 | TP_fast_assign_btrfs(root->fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 215 | __entry->root_objectid = root->root_key.objectid; |
Liu Bo | 92a1bf7 | 2016-11-17 15:00:50 -0800 | [diff] [blame] | 216 | __entry->ino = btrfs_ino(inode); |
| 217 | __entry->start = map->start; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 218 | __entry->len = map->len; |
| 219 | __entry->orig_start = map->orig_start; |
| 220 | __entry->block_start = map->block_start; |
| 221 | __entry->block_len = map->block_len; |
| 222 | __entry->flags = map->flags; |
Elena Reshetova | 490b54d | 2017-03-03 10:55:12 +0200 | [diff] [blame] | 223 | __entry->refs = refcount_read(&map->refs); |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 224 | __entry->compress_type = map->compress_type; |
| 225 | ), |
| 226 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 227 | TP_printk_btrfs("root=%llu(%s) ino=%llu start=%llu len=%llu " |
| 228 | "orig_start=%llu block_start=%llu(%s) " |
| 229 | "block_len=%llu flags=%s refs=%u " |
| 230 | "compress_type=%u", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 231 | show_root_type(__entry->root_objectid), |
Liu Bo | 92a1bf7 | 2016-11-17 15:00:50 -0800 | [diff] [blame] | 232 | (unsigned long long)__entry->ino, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 233 | (unsigned long long)__entry->start, |
| 234 | (unsigned long long)__entry->len, |
| 235 | (unsigned long long)__entry->orig_start, |
| 236 | show_map_type(__entry->block_start), |
| 237 | (unsigned long long)__entry->block_len, |
| 238 | show_map_flags(__entry->flags), |
| 239 | __entry->refs, __entry->compress_type) |
| 240 | ); |
| 241 | |
Liu Bo | 09ed2f1 | 2017-03-10 11:09:48 -0800 | [diff] [blame^] | 242 | /* file extent item */ |
| 243 | DECLARE_EVENT_CLASS(btrfs__file_extent_item_regular, |
| 244 | |
| 245 | TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
| 246 | struct btrfs_file_extent_item *fi, u64 start), |
| 247 | |
| 248 | TP_ARGS(bi, l, fi, start), |
| 249 | |
| 250 | TP_STRUCT__entry_btrfs( |
| 251 | __field( u64, root_obj ) |
| 252 | __field( u64, ino ) |
| 253 | __field( loff_t, isize ) |
| 254 | __field( u64, disk_isize ) |
| 255 | __field( u64, num_bytes ) |
| 256 | __field( u64, ram_bytes ) |
| 257 | __field( u64, disk_bytenr ) |
| 258 | __field( u64, disk_num_bytes ) |
| 259 | __field( u64, extent_offset ) |
| 260 | __field( u8, extent_type ) |
| 261 | __field( u8, compression ) |
| 262 | __field( u64, extent_start ) |
| 263 | __field( u64, extent_end ) |
| 264 | ), |
| 265 | |
| 266 | TP_fast_assign_btrfs(bi->root->fs_info, |
| 267 | __entry->root_obj = bi->root->objectid; |
| 268 | __entry->ino = btrfs_ino(bi); |
| 269 | __entry->isize = bi->vfs_inode.i_size; |
| 270 | __entry->disk_isize = bi->disk_i_size; |
| 271 | __entry->num_bytes = btrfs_file_extent_num_bytes(l, fi); |
| 272 | __entry->ram_bytes = btrfs_file_extent_ram_bytes(l, fi); |
| 273 | __entry->disk_bytenr = btrfs_file_extent_disk_bytenr(l, fi); |
| 274 | __entry->disk_num_bytes = btrfs_file_extent_disk_num_bytes(l, fi); |
| 275 | __entry->extent_offset = btrfs_file_extent_offset(l, fi); |
| 276 | __entry->extent_type = btrfs_file_extent_type(l, fi); |
| 277 | __entry->compression = btrfs_file_extent_compression(l, fi); |
| 278 | __entry->extent_start = start; |
| 279 | __entry->extent_end = (start + __entry->num_bytes); |
| 280 | ), |
| 281 | |
| 282 | TP_printk_btrfs( |
| 283 | "root=%llu(%s) inode=%llu size=%llu disk_isize=%llu " |
| 284 | "file extent range=[%llu %llu] " |
| 285 | "(num_bytes=%llu ram_bytes=%llu disk_bytenr=%llu " |
| 286 | "disk_num_bytes=%llu extent_offset=%llu type=%s " |
| 287 | "compression=%u", |
| 288 | show_root_type(__entry->root_obj), __entry->ino, |
| 289 | __entry->isize, |
| 290 | __entry->disk_isize, __entry->extent_start, |
| 291 | __entry->extent_end, __entry->num_bytes, __entry->ram_bytes, |
| 292 | __entry->disk_bytenr, __entry->disk_num_bytes, |
| 293 | __entry->extent_offset, show_fi_type(__entry->extent_type), |
| 294 | __entry->compression) |
| 295 | ); |
| 296 | |
| 297 | DECLARE_EVENT_CLASS( |
| 298 | btrfs__file_extent_item_inline, |
| 299 | |
| 300 | TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
| 301 | struct btrfs_file_extent_item *fi, int slot, u64 start), |
| 302 | |
| 303 | TP_ARGS(bi, l, fi, slot, start), |
| 304 | |
| 305 | TP_STRUCT__entry_btrfs( |
| 306 | __field( u64, root_obj ) |
| 307 | __field( u64, ino ) |
| 308 | __field( loff_t, isize ) |
| 309 | __field( u64, disk_isize ) |
| 310 | __field( u8, extent_type ) |
| 311 | __field( u8, compression ) |
| 312 | __field( u64, extent_start ) |
| 313 | __field( u64, extent_end ) |
| 314 | ), |
| 315 | |
| 316 | TP_fast_assign_btrfs( |
| 317 | bi->root->fs_info, |
| 318 | __entry->root_obj = bi->root->objectid; |
| 319 | __entry->ino = btrfs_ino(bi); |
| 320 | __entry->isize = bi->vfs_inode.i_size; |
| 321 | __entry->disk_isize = bi->disk_i_size; |
| 322 | __entry->extent_type = btrfs_file_extent_type(l, fi); |
| 323 | __entry->compression = btrfs_file_extent_compression(l, fi); |
| 324 | __entry->extent_start = start; |
| 325 | __entry->extent_end = (start + btrfs_file_extent_inline_len(l, slot, fi)); |
| 326 | ), |
| 327 | |
| 328 | TP_printk_btrfs( |
| 329 | "root=%llu(%s) inode=%llu size=%llu disk_isize=%llu " |
| 330 | "file extent range=[%llu %llu] " |
| 331 | "extent_type=%s compression=%u", |
| 332 | show_root_type(__entry->root_obj), __entry->ino, __entry->isize, |
| 333 | __entry->disk_isize, __entry->extent_start, |
| 334 | __entry->extent_end, show_fi_type(__entry->extent_type), |
| 335 | __entry->compression) |
| 336 | ); |
| 337 | |
| 338 | DEFINE_EVENT( |
| 339 | btrfs__file_extent_item_regular, btrfs_get_extent_show_fi_regular, |
| 340 | |
| 341 | TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
| 342 | struct btrfs_file_extent_item *fi, u64 start), |
| 343 | |
| 344 | TP_ARGS(bi, l, fi, start) |
| 345 | ); |
| 346 | |
| 347 | DEFINE_EVENT( |
| 348 | btrfs__file_extent_item_regular, btrfs_truncate_show_fi_regular, |
| 349 | |
| 350 | TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
| 351 | struct btrfs_file_extent_item *fi, u64 start), |
| 352 | |
| 353 | TP_ARGS(bi, l, fi, start) |
| 354 | ); |
| 355 | |
| 356 | DEFINE_EVENT( |
| 357 | btrfs__file_extent_item_inline, btrfs_get_extent_show_fi_inline, |
| 358 | |
| 359 | TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
| 360 | struct btrfs_file_extent_item *fi, int slot, u64 start), |
| 361 | |
| 362 | TP_ARGS(bi, l, fi, slot, start) |
| 363 | ); |
| 364 | |
| 365 | DEFINE_EVENT( |
| 366 | btrfs__file_extent_item_inline, btrfs_truncate_show_fi_inline, |
| 367 | |
| 368 | TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
| 369 | struct btrfs_file_extent_item *fi, int slot, u64 start), |
| 370 | |
| 371 | TP_ARGS(bi, l, fi, slot, start) |
| 372 | ); |
| 373 | |
Liu Bo | 9d04a8c | 2013-11-06 12:04:13 +0800 | [diff] [blame] | 374 | #define show_ordered_flags(flags) \ |
| 375 | __print_flags(flags, "|", \ |
| 376 | { (1 << BTRFS_ORDERED_IO_DONE), "IO_DONE" }, \ |
| 377 | { (1 << BTRFS_ORDERED_COMPLETE), "COMPLETE" }, \ |
| 378 | { (1 << BTRFS_ORDERED_NOCOW), "NOCOW" }, \ |
| 379 | { (1 << BTRFS_ORDERED_COMPRESSED), "COMPRESSED" }, \ |
| 380 | { (1 << BTRFS_ORDERED_PREALLOC), "PREALLOC" }, \ |
| 381 | { (1 << BTRFS_ORDERED_DIRECT), "DIRECT" }, \ |
| 382 | { (1 << BTRFS_ORDERED_IOERR), "IOERR" }, \ |
| 383 | { (1 << BTRFS_ORDERED_UPDATED_ISIZE), "UPDATED_ISIZE" }, \ |
Liu Bo | 792ddef | 2013-11-06 12:04:14 +0800 | [diff] [blame] | 384 | { (1 << BTRFS_ORDERED_LOGGED_CSUM), "LOGGED_CSUM" }, \ |
| 385 | { (1 << BTRFS_ORDERED_TRUNCATED), "TRUNCATED" }) |
Liu Bo | e112e2b | 2013-05-26 13:50:28 +0000 | [diff] [blame] | 386 | |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 387 | |
| 388 | DECLARE_EVENT_CLASS(btrfs__ordered_extent, |
| 389 | |
| 390 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), |
| 391 | |
| 392 | TP_ARGS(inode, ordered), |
| 393 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 394 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 395 | __field( ino_t, ino ) |
| 396 | __field( u64, file_offset ) |
| 397 | __field( u64, start ) |
| 398 | __field( u64, len ) |
| 399 | __field( u64, disk_len ) |
| 400 | __field( u64, bytes_left ) |
| 401 | __field( unsigned long, flags ) |
| 402 | __field( int, compress_type ) |
| 403 | __field( int, refs ) |
| 404 | __field( u64, root_objectid ) |
Liu Bo | 7856654 | 2016-11-30 16:10:10 -0800 | [diff] [blame] | 405 | __field( u64, truncated_len ) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 406 | ), |
| 407 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 408 | TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 409 | __entry->ino = inode->i_ino; |
| 410 | __entry->file_offset = ordered->file_offset; |
| 411 | __entry->start = ordered->start; |
| 412 | __entry->len = ordered->len; |
| 413 | __entry->disk_len = ordered->disk_len; |
| 414 | __entry->bytes_left = ordered->bytes_left; |
| 415 | __entry->flags = ordered->flags; |
| 416 | __entry->compress_type = ordered->compress_type; |
Elena Reshetova | e76edab | 2017-03-03 10:55:13 +0200 | [diff] [blame] | 417 | __entry->refs = refcount_read(&ordered->refs); |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 418 | __entry->root_objectid = |
| 419 | BTRFS_I(inode)->root->root_key.objectid; |
Liu Bo | 7856654 | 2016-11-30 16:10:10 -0800 | [diff] [blame] | 420 | __entry->truncated_len = ordered->truncated_len; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 421 | ), |
| 422 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 423 | TP_printk_btrfs("root=%llu(%s) ino=%llu file_offset=%llu " |
| 424 | "start=%llu len=%llu disk_len=%llu " |
| 425 | "truncated_len=%llu " |
| 426 | "bytes_left=%llu flags=%s compress_type=%d " |
| 427 | "refs=%d", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 428 | show_root_type(__entry->root_objectid), |
| 429 | (unsigned long long)__entry->ino, |
| 430 | (unsigned long long)__entry->file_offset, |
| 431 | (unsigned long long)__entry->start, |
| 432 | (unsigned long long)__entry->len, |
| 433 | (unsigned long long)__entry->disk_len, |
Liu Bo | 7856654 | 2016-11-30 16:10:10 -0800 | [diff] [blame] | 434 | (unsigned long long)__entry->truncated_len, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 435 | (unsigned long long)__entry->bytes_left, |
| 436 | show_ordered_flags(__entry->flags), |
| 437 | __entry->compress_type, __entry->refs) |
| 438 | ); |
| 439 | |
| 440 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add, |
| 441 | |
| 442 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), |
| 443 | |
| 444 | TP_ARGS(inode, ordered) |
| 445 | ); |
| 446 | |
| 447 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove, |
| 448 | |
| 449 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), |
| 450 | |
| 451 | TP_ARGS(inode, ordered) |
| 452 | ); |
| 453 | |
| 454 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start, |
| 455 | |
| 456 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), |
| 457 | |
| 458 | TP_ARGS(inode, ordered) |
| 459 | ); |
| 460 | |
| 461 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put, |
| 462 | |
| 463 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), |
| 464 | |
| 465 | TP_ARGS(inode, ordered) |
| 466 | ); |
| 467 | |
| 468 | DECLARE_EVENT_CLASS(btrfs__writepage, |
| 469 | |
| 470 | TP_PROTO(struct page *page, struct inode *inode, |
| 471 | struct writeback_control *wbc), |
| 472 | |
| 473 | TP_ARGS(page, inode, wbc), |
| 474 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 475 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 476 | __field( ino_t, ino ) |
| 477 | __field( pgoff_t, index ) |
| 478 | __field( long, nr_to_write ) |
| 479 | __field( long, pages_skipped ) |
| 480 | __field( loff_t, range_start ) |
| 481 | __field( loff_t, range_end ) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 482 | __field( char, for_kupdate ) |
| 483 | __field( char, for_reclaim ) |
| 484 | __field( char, range_cyclic ) |
| 485 | __field( pgoff_t, writeback_index ) |
| 486 | __field( u64, root_objectid ) |
| 487 | ), |
| 488 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 489 | TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 490 | __entry->ino = inode->i_ino; |
| 491 | __entry->index = page->index; |
| 492 | __entry->nr_to_write = wbc->nr_to_write; |
| 493 | __entry->pages_skipped = wbc->pages_skipped; |
| 494 | __entry->range_start = wbc->range_start; |
| 495 | __entry->range_end = wbc->range_end; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 496 | __entry->for_kupdate = wbc->for_kupdate; |
| 497 | __entry->for_reclaim = wbc->for_reclaim; |
| 498 | __entry->range_cyclic = wbc->range_cyclic; |
| 499 | __entry->writeback_index = inode->i_mapping->writeback_index; |
| 500 | __entry->root_objectid = |
| 501 | BTRFS_I(inode)->root->root_key.objectid; |
| 502 | ), |
| 503 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 504 | TP_printk_btrfs("root=%llu(%s) ino=%lu page_index=%lu " |
| 505 | "nr_to_write=%ld pages_skipped=%ld range_start=%llu " |
| 506 | "range_end=%llu for_kupdate=%d " |
| 507 | "for_reclaim=%d range_cyclic=%d writeback_index=%lu", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 508 | show_root_type(__entry->root_objectid), |
| 509 | (unsigned long)__entry->ino, __entry->index, |
| 510 | __entry->nr_to_write, __entry->pages_skipped, |
| 511 | __entry->range_start, __entry->range_end, |
Wu Fengguang | 846d5a0 | 2011-05-05 21:10:38 -0600 | [diff] [blame] | 512 | __entry->for_kupdate, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 513 | __entry->for_reclaim, __entry->range_cyclic, |
| 514 | (unsigned long)__entry->writeback_index) |
| 515 | ); |
| 516 | |
| 517 | DEFINE_EVENT(btrfs__writepage, __extent_writepage, |
| 518 | |
| 519 | TP_PROTO(struct page *page, struct inode *inode, |
| 520 | struct writeback_control *wbc), |
| 521 | |
| 522 | TP_ARGS(page, inode, wbc) |
| 523 | ); |
| 524 | |
| 525 | TRACE_EVENT(btrfs_writepage_end_io_hook, |
| 526 | |
| 527 | TP_PROTO(struct page *page, u64 start, u64 end, int uptodate), |
| 528 | |
| 529 | TP_ARGS(page, start, end, uptodate), |
| 530 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 531 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 532 | __field( ino_t, ino ) |
| 533 | __field( pgoff_t, index ) |
| 534 | __field( u64, start ) |
| 535 | __field( u64, end ) |
| 536 | __field( int, uptodate ) |
| 537 | __field( u64, root_objectid ) |
| 538 | ), |
| 539 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 540 | TP_fast_assign_btrfs(btrfs_sb(page->mapping->host->i_sb), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 541 | __entry->ino = page->mapping->host->i_ino; |
| 542 | __entry->index = page->index; |
| 543 | __entry->start = start; |
| 544 | __entry->end = end; |
| 545 | __entry->uptodate = uptodate; |
| 546 | __entry->root_objectid = |
| 547 | BTRFS_I(page->mapping->host)->root->root_key.objectid; |
| 548 | ), |
| 549 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 550 | TP_printk_btrfs("root=%llu(%s) ino=%lu page_index=%lu start=%llu " |
| 551 | "end=%llu uptodate=%d", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 552 | show_root_type(__entry->root_objectid), |
| 553 | (unsigned long)__entry->ino, (unsigned long)__entry->index, |
| 554 | (unsigned long long)__entry->start, |
| 555 | (unsigned long long)__entry->end, __entry->uptodate) |
| 556 | ); |
| 557 | |
| 558 | TRACE_EVENT(btrfs_sync_file, |
| 559 | |
| 560 | TP_PROTO(struct file *file, int datasync), |
| 561 | |
| 562 | TP_ARGS(file, datasync), |
| 563 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 564 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 565 | __field( ino_t, ino ) |
| 566 | __field( ino_t, parent ) |
| 567 | __field( int, datasync ) |
| 568 | __field( u64, root_objectid ) |
| 569 | ), |
| 570 | |
| 571 | TP_fast_assign( |
| 572 | struct dentry *dentry = file->f_path.dentry; |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 573 | struct inode *inode = d_inode(dentry); |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 574 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 575 | TP_fast_assign_fsid(btrfs_sb(file->f_path.dentry->d_sb)); |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 576 | __entry->ino = inode->i_ino; |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 577 | __entry->parent = d_inode(dentry->d_parent)->i_ino; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 578 | __entry->datasync = datasync; |
| 579 | __entry->root_objectid = |
| 580 | BTRFS_I(inode)->root->root_key.objectid; |
| 581 | ), |
| 582 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 583 | TP_printk_btrfs("root=%llu(%s) ino=%ld parent=%ld datasync=%d", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 584 | show_root_type(__entry->root_objectid), |
| 585 | (unsigned long)__entry->ino, (unsigned long)__entry->parent, |
| 586 | __entry->datasync) |
| 587 | ); |
| 588 | |
| 589 | TRACE_EVENT(btrfs_sync_fs, |
| 590 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 591 | TP_PROTO(struct btrfs_fs_info *fs_info, int wait), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 592 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 593 | TP_ARGS(fs_info, wait), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 594 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 595 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 596 | __field( int, wait ) |
| 597 | ), |
| 598 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 599 | TP_fast_assign_btrfs(fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 600 | __entry->wait = wait; |
| 601 | ), |
| 602 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 603 | TP_printk_btrfs("wait = %d", __entry->wait) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 604 | ); |
| 605 | |
Josef Bacik | c83f8ef | 2016-03-25 13:25:52 -0400 | [diff] [blame] | 606 | TRACE_EVENT(btrfs_add_block_group, |
| 607 | |
| 608 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 609 | struct btrfs_block_group_cache *block_group, int create), |
| 610 | |
| 611 | TP_ARGS(fs_info, block_group, create), |
| 612 | |
| 613 | TP_STRUCT__entry( |
| 614 | __array( u8, fsid, BTRFS_UUID_SIZE ) |
| 615 | __field( u64, offset ) |
| 616 | __field( u64, size ) |
| 617 | __field( u64, flags ) |
| 618 | __field( u64, bytes_used ) |
| 619 | __field( u64, bytes_super ) |
| 620 | __field( int, create ) |
| 621 | ), |
| 622 | |
| 623 | TP_fast_assign( |
| 624 | memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); |
| 625 | __entry->offset = block_group->key.objectid; |
| 626 | __entry->size = block_group->key.offset; |
| 627 | __entry->flags = block_group->flags; |
| 628 | __entry->bytes_used = |
| 629 | btrfs_block_group_used(&block_group->item); |
| 630 | __entry->bytes_super = block_group->bytes_super; |
| 631 | __entry->create = create; |
| 632 | ), |
| 633 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 634 | TP_printk("%pU: block_group offset=%llu size=%llu " |
| 635 | "flags=%llu(%s) bytes_used=%llu bytes_super=%llu " |
| 636 | "create=%d", __entry->fsid, |
Josef Bacik | c83f8ef | 2016-03-25 13:25:52 -0400 | [diff] [blame] | 637 | (unsigned long long)__entry->offset, |
| 638 | (unsigned long long)__entry->size, |
| 639 | (unsigned long long)__entry->flags, |
| 640 | __print_flags((unsigned long)__entry->flags, "|", |
| 641 | BTRFS_GROUP_FLAGS), |
| 642 | (unsigned long long)__entry->bytes_used, |
| 643 | (unsigned long long)__entry->bytes_super, __entry->create) |
| 644 | ); |
| 645 | |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 646 | #define show_ref_action(action) \ |
| 647 | __print_symbolic(action, \ |
| 648 | { BTRFS_ADD_DELAYED_REF, "ADD_DELAYED_REF" }, \ |
| 649 | { BTRFS_DROP_DELAYED_REF, "DROP_DELAYED_REF" }, \ |
| 650 | { BTRFS_ADD_DELAYED_EXTENT, "ADD_DELAYED_EXTENT" }, \ |
| 651 | { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" }) |
| 652 | |
| 653 | |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 654 | DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 655 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 656 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 657 | struct btrfs_delayed_ref_node *ref, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 658 | struct btrfs_delayed_tree_ref *full_ref, |
| 659 | int action), |
| 660 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 661 | TP_ARGS(fs_info, ref, full_ref, action), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 662 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 663 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 664 | __field( u64, bytenr ) |
| 665 | __field( u64, num_bytes ) |
| 666 | __field( int, action ) |
| 667 | __field( u64, parent ) |
| 668 | __field( u64, ref_root ) |
| 669 | __field( int, level ) |
| 670 | __field( int, type ) |
Liu Bo | dea7d76 | 2012-09-07 20:01:27 -0600 | [diff] [blame] | 671 | __field( u64, seq ) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 672 | ), |
| 673 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 674 | TP_fast_assign_btrfs(fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 675 | __entry->bytenr = ref->bytenr; |
| 676 | __entry->num_bytes = ref->num_bytes; |
| 677 | __entry->action = action; |
| 678 | __entry->parent = full_ref->parent; |
| 679 | __entry->ref_root = full_ref->root; |
| 680 | __entry->level = full_ref->level; |
| 681 | __entry->type = ref->type; |
Liu Bo | dea7d76 | 2012-09-07 20:01:27 -0600 | [diff] [blame] | 682 | __entry->seq = ref->seq; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 683 | ), |
| 684 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 685 | TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s " |
| 686 | "parent=%llu(%s) ref_root=%llu(%s) level=%d " |
| 687 | "type=%s seq=%llu", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 688 | (unsigned long long)__entry->bytenr, |
| 689 | (unsigned long long)__entry->num_bytes, |
| 690 | show_ref_action(__entry->action), |
| 691 | show_root_type(__entry->parent), |
| 692 | show_root_type(__entry->ref_root), |
Liu Bo | dea7d76 | 2012-09-07 20:01:27 -0600 | [diff] [blame] | 693 | __entry->level, show_ref_type(__entry->type), |
| 694 | (unsigned long long)__entry->seq) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 695 | ); |
| 696 | |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 697 | DEFINE_EVENT(btrfs_delayed_tree_ref, add_delayed_tree_ref, |
| 698 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 699 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 700 | struct btrfs_delayed_ref_node *ref, |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 701 | struct btrfs_delayed_tree_ref *full_ref, |
| 702 | int action), |
| 703 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 704 | TP_ARGS(fs_info, ref, full_ref, action) |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 705 | ); |
| 706 | |
| 707 | DEFINE_EVENT(btrfs_delayed_tree_ref, run_delayed_tree_ref, |
| 708 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 709 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 710 | struct btrfs_delayed_ref_node *ref, |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 711 | struct btrfs_delayed_tree_ref *full_ref, |
| 712 | int action), |
| 713 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 714 | TP_ARGS(fs_info, ref, full_ref, action) |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 715 | ); |
| 716 | |
| 717 | DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 718 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 719 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 720 | struct btrfs_delayed_ref_node *ref, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 721 | struct btrfs_delayed_data_ref *full_ref, |
| 722 | int action), |
| 723 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 724 | TP_ARGS(fs_info, ref, full_ref, action), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 725 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 726 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 727 | __field( u64, bytenr ) |
| 728 | __field( u64, num_bytes ) |
| 729 | __field( int, action ) |
| 730 | __field( u64, parent ) |
| 731 | __field( u64, ref_root ) |
| 732 | __field( u64, owner ) |
| 733 | __field( u64, offset ) |
| 734 | __field( int, type ) |
Liu Bo | dea7d76 | 2012-09-07 20:01:27 -0600 | [diff] [blame] | 735 | __field( u64, seq ) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 736 | ), |
| 737 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 738 | TP_fast_assign_btrfs(fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 739 | __entry->bytenr = ref->bytenr; |
| 740 | __entry->num_bytes = ref->num_bytes; |
| 741 | __entry->action = action; |
| 742 | __entry->parent = full_ref->parent; |
| 743 | __entry->ref_root = full_ref->root; |
| 744 | __entry->owner = full_ref->objectid; |
| 745 | __entry->offset = full_ref->offset; |
| 746 | __entry->type = ref->type; |
Liu Bo | dea7d76 | 2012-09-07 20:01:27 -0600 | [diff] [blame] | 747 | __entry->seq = ref->seq; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 748 | ), |
| 749 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 750 | TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s " |
| 751 | "parent=%llu(%s) ref_root=%llu(%s) owner=%llu " |
| 752 | "offset=%llu type=%s seq=%llu", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 753 | (unsigned long long)__entry->bytenr, |
| 754 | (unsigned long long)__entry->num_bytes, |
| 755 | show_ref_action(__entry->action), |
| 756 | show_root_type(__entry->parent), |
| 757 | show_root_type(__entry->ref_root), |
| 758 | (unsigned long long)__entry->owner, |
| 759 | (unsigned long long)__entry->offset, |
Liu Bo | dea7d76 | 2012-09-07 20:01:27 -0600 | [diff] [blame] | 760 | show_ref_type(__entry->type), |
| 761 | (unsigned long long)__entry->seq) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 762 | ); |
| 763 | |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 764 | DEFINE_EVENT(btrfs_delayed_data_ref, add_delayed_data_ref, |
| 765 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 766 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 767 | struct btrfs_delayed_ref_node *ref, |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 768 | struct btrfs_delayed_data_ref *full_ref, |
| 769 | int action), |
| 770 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 771 | TP_ARGS(fs_info, ref, full_ref, action) |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 772 | ); |
| 773 | |
| 774 | DEFINE_EVENT(btrfs_delayed_data_ref, run_delayed_data_ref, |
| 775 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 776 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 777 | struct btrfs_delayed_ref_node *ref, |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 778 | struct btrfs_delayed_data_ref *full_ref, |
| 779 | int action), |
| 780 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 781 | TP_ARGS(fs_info, ref, full_ref, action) |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 782 | ); |
| 783 | |
| 784 | DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 785 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 786 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 787 | struct btrfs_delayed_ref_node *ref, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 788 | struct btrfs_delayed_ref_head *head_ref, |
| 789 | int action), |
| 790 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 791 | TP_ARGS(fs_info, ref, head_ref, action), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 792 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 793 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 794 | __field( u64, bytenr ) |
| 795 | __field( u64, num_bytes ) |
| 796 | __field( int, action ) |
| 797 | __field( int, is_data ) |
| 798 | ), |
| 799 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 800 | TP_fast_assign_btrfs(fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 801 | __entry->bytenr = ref->bytenr; |
| 802 | __entry->num_bytes = ref->num_bytes; |
| 803 | __entry->action = action; |
| 804 | __entry->is_data = head_ref->is_data; |
| 805 | ), |
| 806 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 807 | TP_printk_btrfs("bytenr=%llu num_bytes=%llu action=%s is_data=%d", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 808 | (unsigned long long)__entry->bytenr, |
| 809 | (unsigned long long)__entry->num_bytes, |
| 810 | show_ref_action(__entry->action), |
| 811 | __entry->is_data) |
| 812 | ); |
| 813 | |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 814 | DEFINE_EVENT(btrfs_delayed_ref_head, add_delayed_ref_head, |
| 815 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 816 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 817 | struct btrfs_delayed_ref_node *ref, |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 818 | struct btrfs_delayed_ref_head *head_ref, |
| 819 | int action), |
| 820 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 821 | TP_ARGS(fs_info, ref, head_ref, action) |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 822 | ); |
| 823 | |
| 824 | DEFINE_EVENT(btrfs_delayed_ref_head, run_delayed_ref_head, |
| 825 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 826 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 827 | struct btrfs_delayed_ref_node *ref, |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 828 | struct btrfs_delayed_ref_head *head_ref, |
| 829 | int action), |
| 830 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 831 | TP_ARGS(fs_info, ref, head_ref, action) |
Liu Bo | 599c75e | 2013-07-16 19:03:36 +0800 | [diff] [blame] | 832 | ); |
| 833 | |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 834 | #define show_chunk_type(type) \ |
| 835 | __print_flags(type, "|", \ |
| 836 | { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \ |
| 837 | { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \ |
| 838 | { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \ |
| 839 | { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \ |
| 840 | { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \ |
| 841 | { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \ |
Liu Bo | e112e2b | 2013-05-26 13:50:28 +0000 | [diff] [blame] | 842 | { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \ |
| 843 | { BTRFS_BLOCK_GROUP_RAID5, "RAID5" }, \ |
| 844 | { BTRFS_BLOCK_GROUP_RAID6, "RAID6" }) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 845 | |
| 846 | DECLARE_EVENT_CLASS(btrfs__chunk, |
| 847 | |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 848 | TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 849 | u64 offset, u64 size), |
| 850 | |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 851 | TP_ARGS(fs_info, map, offset, size), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 852 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 853 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 854 | __field( int, num_stripes ) |
| 855 | __field( u64, type ) |
| 856 | __field( int, sub_stripes ) |
| 857 | __field( u64, offset ) |
| 858 | __field( u64, size ) |
| 859 | __field( u64, root_objectid ) |
| 860 | ), |
| 861 | |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 862 | TP_fast_assign_btrfs(fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 863 | __entry->num_stripes = map->num_stripes; |
| 864 | __entry->type = map->type; |
| 865 | __entry->sub_stripes = map->sub_stripes; |
| 866 | __entry->offset = offset; |
| 867 | __entry->size = size; |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 868 | __entry->root_objectid = fs_info->chunk_root->root_key.objectid; |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 869 | ), |
| 870 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 871 | TP_printk_btrfs("root=%llu(%s) offset=%llu size=%llu " |
| 872 | "num_stripes=%d sub_stripes=%d type=%s", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 873 | show_root_type(__entry->root_objectid), |
| 874 | (unsigned long long)__entry->offset, |
| 875 | (unsigned long long)__entry->size, |
| 876 | __entry->num_stripes, __entry->sub_stripes, |
| 877 | show_chunk_type(__entry->type)) |
| 878 | ); |
| 879 | |
| 880 | DEFINE_EVENT(btrfs__chunk, btrfs_chunk_alloc, |
| 881 | |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 882 | TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 883 | u64 offset, u64 size), |
| 884 | |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 885 | TP_ARGS(fs_info, map, offset, size) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 886 | ); |
| 887 | |
| 888 | DEFINE_EVENT(btrfs__chunk, btrfs_chunk_free, |
| 889 | |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 890 | TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 891 | u64 offset, u64 size), |
| 892 | |
Jeff Mahoney | 6bccf3a | 2016-06-21 21:16:51 -0400 | [diff] [blame] | 893 | TP_ARGS(fs_info, map, offset, size) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 894 | ); |
| 895 | |
| 896 | TRACE_EVENT(btrfs_cow_block, |
| 897 | |
| 898 | TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf, |
| 899 | struct extent_buffer *cow), |
| 900 | |
| 901 | TP_ARGS(root, buf, cow), |
| 902 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 903 | TP_STRUCT__entry_btrfs( |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 904 | __field( u64, root_objectid ) |
| 905 | __field( u64, buf_start ) |
| 906 | __field( int, refs ) |
| 907 | __field( u64, cow_start ) |
| 908 | __field( int, buf_level ) |
| 909 | __field( int, cow_level ) |
| 910 | ), |
| 911 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 912 | TP_fast_assign_btrfs(root->fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 913 | __entry->root_objectid = root->root_key.objectid; |
| 914 | __entry->buf_start = buf->start; |
| 915 | __entry->refs = atomic_read(&buf->refs); |
| 916 | __entry->cow_start = cow->start; |
| 917 | __entry->buf_level = btrfs_header_level(buf); |
| 918 | __entry->cow_level = btrfs_header_level(cow); |
| 919 | ), |
| 920 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 921 | TP_printk_btrfs("root=%llu(%s) refs=%d orig_buf=%llu " |
| 922 | "(orig_level=%d) cow_buf=%llu (cow_level=%d)", |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 923 | show_root_type(__entry->root_objectid), |
| 924 | __entry->refs, |
| 925 | (unsigned long long)__entry->buf_start, |
| 926 | __entry->buf_level, |
| 927 | (unsigned long long)__entry->cow_start, |
| 928 | __entry->cow_level) |
| 929 | ); |
| 930 | |
Josef Bacik | 8c2a3ca | 2012-01-10 10:31:31 -0500 | [diff] [blame] | 931 | TRACE_EVENT(btrfs_space_reservation, |
| 932 | |
| 933 | TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val, |
| 934 | u64 bytes, int reserve), |
| 935 | |
| 936 | TP_ARGS(fs_info, type, val, bytes, reserve), |
| 937 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 938 | TP_STRUCT__entry_btrfs( |
Josef Bacik | 8c2a3ca | 2012-01-10 10:31:31 -0500 | [diff] [blame] | 939 | __string( type, type ) |
| 940 | __field( u64, val ) |
| 941 | __field( u64, bytes ) |
| 942 | __field( int, reserve ) |
| 943 | ), |
| 944 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 945 | TP_fast_assign_btrfs(fs_info, |
Josef Bacik | 8c2a3ca | 2012-01-10 10:31:31 -0500 | [diff] [blame] | 946 | __assign_str(type, type); |
| 947 | __entry->val = val; |
| 948 | __entry->bytes = bytes; |
| 949 | __entry->reserve = reserve; |
| 950 | ), |
| 951 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 952 | TP_printk_btrfs("%s: %Lu %s %Lu", __get_str(type), __entry->val, |
| 953 | __entry->reserve ? "reserve" : "release", |
| 954 | __entry->bytes) |
Josef Bacik | 8c2a3ca | 2012-01-10 10:31:31 -0500 | [diff] [blame] | 955 | ); |
| 956 | |
Josef Bacik | f376df2 | 2016-03-25 13:25:56 -0400 | [diff] [blame] | 957 | #define show_flush_action(action) \ |
| 958 | __print_symbolic(action, \ |
| 959 | { BTRFS_RESERVE_NO_FLUSH, "BTRFS_RESERVE_NO_FLUSH"}, \ |
| 960 | { BTRFS_RESERVE_FLUSH_LIMIT, "BTRFS_RESERVE_FLUSH_LIMIT"}, \ |
| 961 | { BTRFS_RESERVE_FLUSH_ALL, "BTRFS_RESERVE_FLUSH_ALL"}) |
| 962 | |
| 963 | TRACE_EVENT(btrfs_trigger_flush, |
| 964 | |
| 965 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 flags, u64 bytes, |
| 966 | int flush, char *reason), |
| 967 | |
| 968 | TP_ARGS(fs_info, flags, bytes, flush, reason), |
| 969 | |
| 970 | TP_STRUCT__entry( |
| 971 | __array( u8, fsid, BTRFS_UUID_SIZE ) |
| 972 | __field( u64, flags ) |
| 973 | __field( u64, bytes ) |
| 974 | __field( int, flush ) |
| 975 | __string( reason, reason ) |
| 976 | ), |
| 977 | |
| 978 | TP_fast_assign( |
| 979 | memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); |
| 980 | __entry->flags = flags; |
| 981 | __entry->bytes = bytes; |
| 982 | __entry->flush = flush; |
| 983 | __assign_str(reason, reason) |
| 984 | ), |
| 985 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 986 | TP_printk("%pU: %s: flush=%d(%s) flags=%llu(%s) bytes=%llu", |
Josef Bacik | f376df2 | 2016-03-25 13:25:56 -0400 | [diff] [blame] | 987 | __entry->fsid, __get_str(reason), __entry->flush, |
| 988 | show_flush_action(__entry->flush), |
| 989 | (unsigned long long)__entry->flags, |
| 990 | __print_flags((unsigned long)__entry->flags, "|", |
| 991 | BTRFS_GROUP_FLAGS), |
| 992 | (unsigned long long)__entry->bytes) |
| 993 | ); |
| 994 | |
| 995 | #define show_flush_state(state) \ |
| 996 | __print_symbolic(state, \ |
| 997 | { FLUSH_DELAYED_ITEMS_NR, "FLUSH_DELAYED_ITEMS_NR"}, \ |
| 998 | { FLUSH_DELAYED_ITEMS, "FLUSH_DELAYED_ITEMS"}, \ |
| 999 | { FLUSH_DELALLOC, "FLUSH_DELALLOC"}, \ |
| 1000 | { FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT"}, \ |
| 1001 | { ALLOC_CHUNK, "ALLOC_CHUNK"}, \ |
| 1002 | { COMMIT_TRANS, "COMMIT_TRANS"}) |
| 1003 | |
| 1004 | TRACE_EVENT(btrfs_flush_space, |
| 1005 | |
| 1006 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 flags, u64 num_bytes, |
| 1007 | u64 orig_bytes, int state, int ret), |
| 1008 | |
| 1009 | TP_ARGS(fs_info, flags, num_bytes, orig_bytes, state, ret), |
| 1010 | |
| 1011 | TP_STRUCT__entry( |
| 1012 | __array( u8, fsid, BTRFS_UUID_SIZE ) |
| 1013 | __field( u64, flags ) |
| 1014 | __field( u64, num_bytes ) |
| 1015 | __field( u64, orig_bytes ) |
| 1016 | __field( int, state ) |
| 1017 | __field( int, ret ) |
| 1018 | ), |
| 1019 | |
| 1020 | TP_fast_assign( |
| 1021 | memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); |
| 1022 | __entry->flags = flags; |
| 1023 | __entry->num_bytes = num_bytes; |
| 1024 | __entry->orig_bytes = orig_bytes; |
| 1025 | __entry->state = state; |
| 1026 | __entry->ret = ret; |
| 1027 | ), |
| 1028 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1029 | TP_printk("%pU: state=%d(%s) flags=%llu(%s) num_bytes=%llu " |
| 1030 | "orig_bytes=%llu ret=%d", __entry->fsid, __entry->state, |
Josef Bacik | f376df2 | 2016-03-25 13:25:56 -0400 | [diff] [blame] | 1031 | show_flush_state(__entry->state), |
| 1032 | (unsigned long long)__entry->flags, |
| 1033 | __print_flags((unsigned long)__entry->flags, "|", |
| 1034 | BTRFS_GROUP_FLAGS), |
| 1035 | (unsigned long long)__entry->num_bytes, |
| 1036 | (unsigned long long)__entry->orig_bytes, __entry->ret) |
| 1037 | ); |
| 1038 | |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1039 | DECLARE_EVENT_CLASS(btrfs__reserved_extent, |
| 1040 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1041 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1042 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1043 | TP_ARGS(fs_info, start, len), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1044 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1045 | TP_STRUCT__entry_btrfs( |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1046 | __field( u64, start ) |
| 1047 | __field( u64, len ) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1048 | ), |
| 1049 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1050 | TP_fast_assign_btrfs(fs_info, |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1051 | __entry->start = start; |
| 1052 | __entry->len = len; |
| 1053 | ), |
| 1054 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1055 | TP_printk_btrfs("root=%llu(%s) start=%llu len=%llu", |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1056 | show_root_type(BTRFS_EXTENT_TREE_OBJECTID), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1057 | (unsigned long long)__entry->start, |
| 1058 | (unsigned long long)__entry->len) |
| 1059 | ); |
| 1060 | |
| 1061 | DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_alloc, |
| 1062 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1063 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1064 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1065 | TP_ARGS(fs_info, start, len) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1066 | ); |
| 1067 | |
| 1068 | DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free, |
| 1069 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1070 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1071 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1072 | TP_ARGS(fs_info, start, len) |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1073 | ); |
| 1074 | |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1075 | TRACE_EVENT(find_free_extent, |
| 1076 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1077 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1078 | u64 data), |
| 1079 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1080 | TP_ARGS(fs_info, num_bytes, empty_size, data), |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1081 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1082 | TP_STRUCT__entry_btrfs( |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1083 | __field( u64, num_bytes ) |
| 1084 | __field( u64, empty_size ) |
| 1085 | __field( u64, data ) |
| 1086 | ), |
| 1087 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1088 | TP_fast_assign_btrfs(fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1089 | __entry->num_bytes = num_bytes; |
| 1090 | __entry->empty_size = empty_size; |
| 1091 | __entry->data = data; |
| 1092 | ), |
| 1093 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1094 | TP_printk_btrfs("root=%Lu(%s) len=%Lu empty_size=%Lu flags=%Lu(%s)", |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1095 | show_root_type(BTRFS_EXTENT_TREE_OBJECTID), |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1096 | __entry->num_bytes, __entry->empty_size, __entry->data, |
| 1097 | __print_flags((unsigned long)__entry->data, "|", |
| 1098 | BTRFS_GROUP_FLAGS)) |
| 1099 | ); |
| 1100 | |
| 1101 | DECLARE_EVENT_CLASS(btrfs__reserve_extent, |
| 1102 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1103 | TP_PROTO(struct btrfs_fs_info *fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1104 | struct btrfs_block_group_cache *block_group, u64 start, |
| 1105 | u64 len), |
| 1106 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1107 | TP_ARGS(fs_info, block_group, start, len), |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1108 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1109 | TP_STRUCT__entry_btrfs( |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1110 | __field( u64, bg_objectid ) |
| 1111 | __field( u64, flags ) |
| 1112 | __field( u64, start ) |
| 1113 | __field( u64, len ) |
| 1114 | ), |
| 1115 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1116 | TP_fast_assign_btrfs(fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1117 | __entry->bg_objectid = block_group->key.objectid; |
| 1118 | __entry->flags = block_group->flags; |
| 1119 | __entry->start = start; |
| 1120 | __entry->len = len; |
| 1121 | ), |
| 1122 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1123 | TP_printk_btrfs("root=%Lu(%s) block_group=%Lu flags=%Lu(%s) " |
| 1124 | "start=%Lu len=%Lu", |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1125 | show_root_type(BTRFS_EXTENT_TREE_OBJECTID), |
| 1126 | __entry->bg_objectid, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1127 | __entry->flags, __print_flags((unsigned long)__entry->flags, |
| 1128 | "|", BTRFS_GROUP_FLAGS), |
| 1129 | __entry->start, __entry->len) |
| 1130 | ); |
| 1131 | |
| 1132 | DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent, |
| 1133 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1134 | TP_PROTO(struct btrfs_fs_info *fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1135 | struct btrfs_block_group_cache *block_group, u64 start, |
| 1136 | u64 len), |
| 1137 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1138 | TP_ARGS(fs_info, block_group, start, len) |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1139 | ); |
| 1140 | |
| 1141 | DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster, |
| 1142 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1143 | TP_PROTO(struct btrfs_fs_info *fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1144 | struct btrfs_block_group_cache *block_group, u64 start, |
| 1145 | u64 len), |
| 1146 | |
Jeff Mahoney | 71ff643 | 2016-09-06 16:00:42 -0400 | [diff] [blame] | 1147 | TP_ARGS(fs_info, block_group, start, len) |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1148 | ); |
| 1149 | |
| 1150 | TRACE_EVENT(btrfs_find_cluster, |
| 1151 | |
| 1152 | TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start, |
| 1153 | u64 bytes, u64 empty_size, u64 min_bytes), |
| 1154 | |
| 1155 | TP_ARGS(block_group, start, bytes, empty_size, min_bytes), |
| 1156 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1157 | TP_STRUCT__entry_btrfs( |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1158 | __field( u64, bg_objectid ) |
| 1159 | __field( u64, flags ) |
| 1160 | __field( u64, start ) |
| 1161 | __field( u64, bytes ) |
| 1162 | __field( u64, empty_size ) |
| 1163 | __field( u64, min_bytes ) |
| 1164 | ), |
| 1165 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1166 | TP_fast_assign_btrfs(block_group->fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1167 | __entry->bg_objectid = block_group->key.objectid; |
| 1168 | __entry->flags = block_group->flags; |
| 1169 | __entry->start = start; |
| 1170 | __entry->bytes = bytes; |
| 1171 | __entry->empty_size = empty_size; |
| 1172 | __entry->min_bytes = min_bytes; |
| 1173 | ), |
| 1174 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1175 | TP_printk_btrfs("block_group=%Lu flags=%Lu(%s) start=%Lu len=%Lu " |
| 1176 | "empty_size=%Lu min_bytes=%Lu", __entry->bg_objectid, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1177 | __entry->flags, |
| 1178 | __print_flags((unsigned long)__entry->flags, "|", |
| 1179 | BTRFS_GROUP_FLAGS), __entry->start, |
| 1180 | __entry->bytes, __entry->empty_size, __entry->min_bytes) |
| 1181 | ); |
| 1182 | |
| 1183 | TRACE_EVENT(btrfs_failed_cluster_setup, |
| 1184 | |
| 1185 | TP_PROTO(struct btrfs_block_group_cache *block_group), |
| 1186 | |
| 1187 | TP_ARGS(block_group), |
| 1188 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1189 | TP_STRUCT__entry_btrfs( |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1190 | __field( u64, bg_objectid ) |
| 1191 | ), |
| 1192 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1193 | TP_fast_assign_btrfs(block_group->fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1194 | __entry->bg_objectid = block_group->key.objectid; |
| 1195 | ), |
| 1196 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1197 | TP_printk_btrfs("block_group=%Lu", __entry->bg_objectid) |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1198 | ); |
| 1199 | |
| 1200 | TRACE_EVENT(btrfs_setup_cluster, |
| 1201 | |
| 1202 | TP_PROTO(struct btrfs_block_group_cache *block_group, |
| 1203 | struct btrfs_free_cluster *cluster, u64 size, int bitmap), |
| 1204 | |
| 1205 | TP_ARGS(block_group, cluster, size, bitmap), |
| 1206 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1207 | TP_STRUCT__entry_btrfs( |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1208 | __field( u64, bg_objectid ) |
| 1209 | __field( u64, flags ) |
| 1210 | __field( u64, start ) |
| 1211 | __field( u64, max_size ) |
| 1212 | __field( u64, size ) |
| 1213 | __field( int, bitmap ) |
| 1214 | ), |
| 1215 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1216 | TP_fast_assign_btrfs(block_group->fs_info, |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1217 | __entry->bg_objectid = block_group->key.objectid; |
| 1218 | __entry->flags = block_group->flags; |
| 1219 | __entry->start = cluster->window_start; |
| 1220 | __entry->max_size = cluster->max_size; |
| 1221 | __entry->size = size; |
| 1222 | __entry->bitmap = bitmap; |
| 1223 | ), |
| 1224 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1225 | TP_printk_btrfs("block_group=%Lu flags=%Lu(%s) window_start=%Lu " |
| 1226 | "size=%Lu max_size=%Lu bitmap=%d", |
Josef Bacik | 3f7de03 | 2011-11-10 08:29:20 -0500 | [diff] [blame] | 1227 | __entry->bg_objectid, |
| 1228 | __entry->flags, |
| 1229 | __print_flags((unsigned long)__entry->flags, "|", |
| 1230 | BTRFS_GROUP_FLAGS), __entry->start, |
| 1231 | __entry->size, __entry->max_size, __entry->bitmap) |
| 1232 | ); |
| 1233 | |
Jeff Mahoney | 143bede | 2012-03-01 14:56:26 +0100 | [diff] [blame] | 1234 | struct extent_state; |
| 1235 | TRACE_EVENT(alloc_extent_state, |
| 1236 | |
| 1237 | TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP), |
| 1238 | |
| 1239 | TP_ARGS(state, mask, IP), |
| 1240 | |
| 1241 | TP_STRUCT__entry( |
| 1242 | __field(struct extent_state *, state) |
| 1243 | __field(gfp_t, mask) |
| 1244 | __field(unsigned long, ip) |
| 1245 | ), |
| 1246 | |
| 1247 | TP_fast_assign( |
| 1248 | __entry->state = state, |
| 1249 | __entry->mask = mask, |
| 1250 | __entry->ip = IP |
| 1251 | ), |
| 1252 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1253 | TP_printk("state=%p mask=%s caller=%pS", __entry->state, |
Jeff Mahoney | 143bede | 2012-03-01 14:56:26 +0100 | [diff] [blame] | 1254 | show_gfp_flags(__entry->mask), (void *)__entry->ip) |
| 1255 | ); |
| 1256 | |
| 1257 | TRACE_EVENT(free_extent_state, |
| 1258 | |
| 1259 | TP_PROTO(struct extent_state *state, unsigned long IP), |
| 1260 | |
| 1261 | TP_ARGS(state, IP), |
| 1262 | |
| 1263 | TP_STRUCT__entry( |
| 1264 | __field(struct extent_state *, state) |
| 1265 | __field(unsigned long, ip) |
| 1266 | ), |
| 1267 | |
| 1268 | TP_fast_assign( |
| 1269 | __entry->state = state, |
| 1270 | __entry->ip = IP |
| 1271 | ), |
| 1272 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1273 | TP_printk("state=%p caller=%pS", __entry->state, |
Jeff Mahoney | 143bede | 2012-03-01 14:56:26 +0100 | [diff] [blame] | 1274 | (void *)__entry->ip) |
| 1275 | ); |
| 1276 | |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1277 | DECLARE_EVENT_CLASS(btrfs__work, |
| 1278 | |
| 1279 | TP_PROTO(struct btrfs_work *work), |
| 1280 | |
| 1281 | TP_ARGS(work), |
| 1282 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1283 | TP_STRUCT__entry_btrfs( |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1284 | __field( void *, work ) |
| 1285 | __field( void *, wq ) |
| 1286 | __field( void *, func ) |
| 1287 | __field( void *, ordered_func ) |
| 1288 | __field( void *, ordered_free ) |
Liu Bo | b38a625 | 2014-08-12 16:33:17 +0800 | [diff] [blame] | 1289 | __field( void *, normal_work ) |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1290 | ), |
| 1291 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1292 | TP_fast_assign_btrfs(btrfs_work_owner(work), |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1293 | __entry->work = work; |
| 1294 | __entry->wq = work->wq; |
| 1295 | __entry->func = work->func; |
| 1296 | __entry->ordered_func = work->ordered_func; |
| 1297 | __entry->ordered_free = work->ordered_free; |
Liu Bo | b38a625 | 2014-08-12 16:33:17 +0800 | [diff] [blame] | 1298 | __entry->normal_work = &work->normal_work; |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1299 | ), |
| 1300 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1301 | TP_printk_btrfs("work=%p (normal_work=%p) wq=%p func=%pf ordered_func=%p " |
| 1302 | "ordered_free=%p", |
Liu Bo | b38a625 | 2014-08-12 16:33:17 +0800 | [diff] [blame] | 1303 | __entry->work, __entry->normal_work, __entry->wq, |
| 1304 | __entry->func, __entry->ordered_func, __entry->ordered_free) |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1305 | ); |
| 1306 | |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1307 | /* |
| 1308 | * For situiations when the work is freed, we pass fs_info and a tag that that |
| 1309 | * matches address of the work structure so it can be paired with the |
| 1310 | * scheduling event. |
| 1311 | */ |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1312 | DECLARE_EVENT_CLASS(btrfs__work__done, |
| 1313 | |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1314 | TP_PROTO(struct btrfs_fs_info *fs_info, void *wtag), |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1315 | |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1316 | TP_ARGS(fs_info, wtag), |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1317 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1318 | TP_STRUCT__entry_btrfs( |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1319 | __field( void *, wtag ) |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1320 | ), |
| 1321 | |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1322 | TP_fast_assign_btrfs(fs_info, |
| 1323 | __entry->wtag = wtag; |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1324 | ), |
| 1325 | |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1326 | TP_printk_btrfs("work->%p", __entry->wtag) |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1327 | ); |
| 1328 | |
| 1329 | DEFINE_EVENT(btrfs__work, btrfs_work_queued, |
| 1330 | |
| 1331 | TP_PROTO(struct btrfs_work *work), |
| 1332 | |
| 1333 | TP_ARGS(work) |
| 1334 | ); |
| 1335 | |
| 1336 | DEFINE_EVENT(btrfs__work, btrfs_work_sched, |
| 1337 | |
| 1338 | TP_PROTO(struct btrfs_work *work), |
| 1339 | |
| 1340 | TP_ARGS(work) |
| 1341 | ); |
| 1342 | |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1343 | DEFINE_EVENT(btrfs__work__done, btrfs_all_work_done, |
| 1344 | |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1345 | TP_PROTO(struct btrfs_fs_info *fs_info, void *wtag), |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1346 | |
David Sterba | ac0c7cf | 2017-01-06 14:12:51 +0100 | [diff] [blame] | 1347 | TP_ARGS(fs_info, wtag) |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1348 | ); |
| 1349 | |
| 1350 | DEFINE_EVENT(btrfs__work, btrfs_ordered_sched, |
| 1351 | |
| 1352 | TP_PROTO(struct btrfs_work *work), |
| 1353 | |
| 1354 | TP_ARGS(work) |
| 1355 | ); |
| 1356 | |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 1357 | DECLARE_EVENT_CLASS(btrfs__workqueue, |
| 1358 | |
| 1359 | TP_PROTO(struct __btrfs_workqueue *wq, const char *name, int high), |
| 1360 | |
| 1361 | TP_ARGS(wq, name, high), |
| 1362 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1363 | TP_STRUCT__entry_btrfs( |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 1364 | __field( void *, wq ) |
| 1365 | __string( name, name ) |
| 1366 | __field( int , high ) |
| 1367 | ), |
| 1368 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1369 | TP_fast_assign_btrfs(btrfs_workqueue_owner(wq), |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 1370 | __entry->wq = wq; |
| 1371 | __assign_str(name, name); |
| 1372 | __entry->high = high; |
| 1373 | ), |
| 1374 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1375 | TP_printk_btrfs("name=%s%s wq=%p", __get_str(name), |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 1376 | __print_flags(__entry->high, "", |
| 1377 | {(WQ_HIGHPRI), "-high"}), |
| 1378 | __entry->wq) |
| 1379 | ); |
| 1380 | |
| 1381 | DEFINE_EVENT(btrfs__workqueue, btrfs_workqueue_alloc, |
| 1382 | |
| 1383 | TP_PROTO(struct __btrfs_workqueue *wq, const char *name, int high), |
| 1384 | |
| 1385 | TP_ARGS(wq, name, high) |
| 1386 | ); |
| 1387 | |
| 1388 | DECLARE_EVENT_CLASS(btrfs__workqueue_done, |
| 1389 | |
| 1390 | TP_PROTO(struct __btrfs_workqueue *wq), |
| 1391 | |
| 1392 | TP_ARGS(wq), |
| 1393 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1394 | TP_STRUCT__entry_btrfs( |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 1395 | __field( void *, wq ) |
| 1396 | ), |
| 1397 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1398 | TP_fast_assign_btrfs(btrfs_workqueue_owner(wq), |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 1399 | __entry->wq = wq; |
| 1400 | ), |
| 1401 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1402 | TP_printk_btrfs("wq=%p", __entry->wq) |
Qu Wenruo | c3a4689 | 2014-03-12 08:05:33 +0000 | [diff] [blame] | 1403 | ); |
| 1404 | |
| 1405 | DEFINE_EVENT(btrfs__workqueue_done, btrfs_workqueue_destroy, |
| 1406 | |
| 1407 | TP_PROTO(struct __btrfs_workqueue *wq), |
| 1408 | |
| 1409 | TP_ARGS(wq) |
| 1410 | ); |
Qu Wenruo | 52483bc | 2014-03-06 04:19:50 +0000 | [diff] [blame] | 1411 | |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1412 | DECLARE_EVENT_CLASS(btrfs__qgroup_data_map, |
| 1413 | |
| 1414 | TP_PROTO(struct inode *inode, u64 free_reserved), |
| 1415 | |
| 1416 | TP_ARGS(inode, free_reserved), |
| 1417 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1418 | TP_STRUCT__entry_btrfs( |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1419 | __field( u64, rootid ) |
| 1420 | __field( unsigned long, ino ) |
| 1421 | __field( u64, free_reserved ) |
| 1422 | ), |
| 1423 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1424 | TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1425 | __entry->rootid = BTRFS_I(inode)->root->objectid; |
| 1426 | __entry->ino = inode->i_ino; |
| 1427 | __entry->free_reserved = free_reserved; |
| 1428 | ), |
| 1429 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1430 | TP_printk_btrfs("rootid=%llu ino=%lu free_reserved=%llu", |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1431 | __entry->rootid, __entry->ino, __entry->free_reserved) |
| 1432 | ); |
| 1433 | |
| 1434 | DEFINE_EVENT(btrfs__qgroup_data_map, btrfs_qgroup_init_data_rsv_map, |
| 1435 | |
| 1436 | TP_PROTO(struct inode *inode, u64 free_reserved), |
| 1437 | |
| 1438 | TP_ARGS(inode, free_reserved) |
| 1439 | ); |
| 1440 | |
| 1441 | DEFINE_EVENT(btrfs__qgroup_data_map, btrfs_qgroup_free_data_rsv_map, |
| 1442 | |
| 1443 | TP_PROTO(struct inode *inode, u64 free_reserved), |
| 1444 | |
| 1445 | TP_ARGS(inode, free_reserved) |
| 1446 | ); |
| 1447 | |
| 1448 | #define BTRFS_QGROUP_OPERATIONS \ |
| 1449 | { QGROUP_RESERVE, "reserve" }, \ |
| 1450 | { QGROUP_RELEASE, "release" }, \ |
| 1451 | { QGROUP_FREE, "free" } |
| 1452 | |
| 1453 | DECLARE_EVENT_CLASS(btrfs__qgroup_rsv_data, |
| 1454 | |
| 1455 | TP_PROTO(struct inode *inode, u64 start, u64 len, u64 reserved, int op), |
| 1456 | |
| 1457 | TP_ARGS(inode, start, len, reserved, op), |
| 1458 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1459 | TP_STRUCT__entry_btrfs( |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1460 | __field( u64, rootid ) |
| 1461 | __field( unsigned long, ino ) |
| 1462 | __field( u64, start ) |
| 1463 | __field( u64, len ) |
| 1464 | __field( u64, reserved ) |
| 1465 | __field( int, op ) |
| 1466 | ), |
| 1467 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1468 | TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1469 | __entry->rootid = BTRFS_I(inode)->root->objectid; |
| 1470 | __entry->ino = inode->i_ino; |
| 1471 | __entry->start = start; |
| 1472 | __entry->len = len; |
| 1473 | __entry->reserved = reserved; |
| 1474 | __entry->op = op; |
| 1475 | ), |
| 1476 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1477 | TP_printk_btrfs("root=%llu ino=%lu start=%llu len=%llu reserved=%llu op=%s", |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1478 | __entry->rootid, __entry->ino, __entry->start, __entry->len, |
| 1479 | __entry->reserved, |
| 1480 | __print_flags((unsigned long)__entry->op, "", |
| 1481 | BTRFS_QGROUP_OPERATIONS) |
| 1482 | ) |
| 1483 | ); |
| 1484 | |
| 1485 | DEFINE_EVENT(btrfs__qgroup_rsv_data, btrfs_qgroup_reserve_data, |
| 1486 | |
| 1487 | TP_PROTO(struct inode *inode, u64 start, u64 len, u64 reserved, int op), |
| 1488 | |
| 1489 | TP_ARGS(inode, start, len, reserved, op) |
| 1490 | ); |
| 1491 | |
| 1492 | DEFINE_EVENT(btrfs__qgroup_rsv_data, btrfs_qgroup_release_data, |
| 1493 | |
| 1494 | TP_PROTO(struct inode *inode, u64 start, u64 len, u64 reserved, int op), |
| 1495 | |
| 1496 | TP_ARGS(inode, start, len, reserved, op) |
| 1497 | ); |
| 1498 | |
| 1499 | DECLARE_EVENT_CLASS(btrfs__qgroup_delayed_ref, |
| 1500 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1501 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 ref_root, u64 reserved), |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1502 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1503 | TP_ARGS(fs_info, ref_root, reserved), |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1504 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1505 | TP_STRUCT__entry_btrfs( |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1506 | __field( u64, ref_root ) |
| 1507 | __field( u64, reserved ) |
| 1508 | ), |
| 1509 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1510 | TP_fast_assign_btrfs(fs_info, |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1511 | __entry->ref_root = ref_root; |
| 1512 | __entry->reserved = reserved; |
| 1513 | ), |
| 1514 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1515 | TP_printk_btrfs("root=%llu reserved=%llu op=free", |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1516 | __entry->ref_root, __entry->reserved) |
| 1517 | ); |
| 1518 | |
| 1519 | DEFINE_EVENT(btrfs__qgroup_delayed_ref, btrfs_qgroup_free_delayed_ref, |
| 1520 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1521 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 ref_root, u64 reserved), |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1522 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1523 | TP_ARGS(fs_info, ref_root, reserved) |
Qu Wenruo | 81fb6f7 | 2015-09-28 16:57:53 +0800 | [diff] [blame] | 1524 | ); |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1525 | |
| 1526 | DECLARE_EVENT_CLASS(btrfs_qgroup_extent, |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1527 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 1528 | struct btrfs_qgroup_extent_record *rec), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1529 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1530 | TP_ARGS(fs_info, rec), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1531 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1532 | TP_STRUCT__entry_btrfs( |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1533 | __field( u64, bytenr ) |
| 1534 | __field( u64, num_bytes ) |
| 1535 | ), |
| 1536 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1537 | TP_fast_assign_btrfs(fs_info, |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1538 | __entry->bytenr = rec->bytenr, |
| 1539 | __entry->num_bytes = rec->num_bytes; |
| 1540 | ), |
| 1541 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1542 | TP_printk_btrfs("bytenr=%llu num_bytes=%llu", |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1543 | (unsigned long long)__entry->bytenr, |
| 1544 | (unsigned long long)__entry->num_bytes) |
| 1545 | ); |
| 1546 | |
| 1547 | DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_account_extents, |
| 1548 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1549 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 1550 | struct btrfs_qgroup_extent_record *rec), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1551 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1552 | TP_ARGS(fs_info, rec) |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1553 | ); |
| 1554 | |
Qu Wenruo | 50b3e04 | 2016-10-18 09:31:27 +0800 | [diff] [blame] | 1555 | DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_trace_extent, |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1556 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1557 | TP_PROTO(struct btrfs_fs_info *fs_info, |
| 1558 | struct btrfs_qgroup_extent_record *rec), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1559 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1560 | TP_ARGS(fs_info, rec) |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1561 | ); |
| 1562 | |
| 1563 | TRACE_EVENT(btrfs_qgroup_account_extent, |
| 1564 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1565 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 bytenr, |
| 1566 | u64 num_bytes, u64 nr_old_roots, u64 nr_new_roots), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1567 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1568 | TP_ARGS(fs_info, bytenr, num_bytes, nr_old_roots, nr_new_roots), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1569 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1570 | TP_STRUCT__entry_btrfs( |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1571 | __field( u64, bytenr ) |
| 1572 | __field( u64, num_bytes ) |
| 1573 | __field( u64, nr_old_roots ) |
| 1574 | __field( u64, nr_new_roots ) |
| 1575 | ), |
| 1576 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1577 | TP_fast_assign_btrfs(fs_info, |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1578 | __entry->bytenr = bytenr; |
| 1579 | __entry->num_bytes = num_bytes; |
| 1580 | __entry->nr_old_roots = nr_old_roots; |
| 1581 | __entry->nr_new_roots = nr_new_roots; |
| 1582 | ), |
| 1583 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1584 | TP_printk_btrfs("bytenr=%llu num_bytes=%llu nr_old_roots=%llu " |
| 1585 | "nr_new_roots=%llu", |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1586 | __entry->bytenr, |
| 1587 | __entry->num_bytes, |
| 1588 | __entry->nr_old_roots, |
| 1589 | __entry->nr_new_roots) |
| 1590 | ); |
| 1591 | |
| 1592 | TRACE_EVENT(qgroup_update_counters, |
| 1593 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1594 | TP_PROTO(struct btrfs_fs_info *fs_info, u64 qgid, |
| 1595 | u64 cur_old_count, u64 cur_new_count), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1596 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1597 | TP_ARGS(fs_info, qgid, cur_old_count, cur_new_count), |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1598 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1599 | TP_STRUCT__entry_btrfs( |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1600 | __field( u64, qgid ) |
| 1601 | __field( u64, cur_old_count ) |
| 1602 | __field( u64, cur_new_count ) |
| 1603 | ), |
| 1604 | |
Jeff Mahoney | bc07452 | 2016-06-09 17:27:55 -0400 | [diff] [blame] | 1605 | TP_fast_assign_btrfs(fs_info, |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1606 | __entry->qgid = qgid; |
| 1607 | __entry->cur_old_count = cur_old_count; |
| 1608 | __entry->cur_new_count = cur_new_count; |
| 1609 | ), |
| 1610 | |
David Sterba | 562a7a0 | 2017-01-06 15:51:36 +0100 | [diff] [blame] | 1611 | TP_printk_btrfs("qgid=%llu cur_old_count=%llu cur_new_count=%llu", |
Mark Fasheh | 0f5dcf8 | 2016-03-29 17:19:55 -0700 | [diff] [blame] | 1612 | __entry->qgid, |
| 1613 | __entry->cur_old_count, |
| 1614 | __entry->cur_new_count) |
| 1615 | ); |
| 1616 | |
liubo | 1abe9b8 | 2011-03-24 11:18:59 +0000 | [diff] [blame] | 1617 | #endif /* _TRACE_BTRFS_H */ |
| 1618 | |
| 1619 | /* This part must be outside protection */ |
| 1620 | #include <trace/define_trace.h> |