1 /* 2 * Copyright (c) 2009, Christoph Hellwig 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope that it would be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write the Free Software Foundation, 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 #undef TRACE_SYSTEM 19 #define TRACE_SYSTEM xfs 20 21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ) 22 #define _TRACE_XFS_H 23 24 #include <linux/tracepoint.h> 25 26 struct xfs_agf; 27 struct xfs_alloc_arg; 28 struct xfs_attr_list_context; 29 struct xfs_buf_log_item; 30 struct xfs_da_args; 31 struct xfs_da_node_entry; 32 struct xfs_dquot; 33 struct xfs_log_item; 34 struct xlog; 35 struct xlog_ticket; 36 struct xlog_recover; 37 struct xlog_recover_item; 38 struct xfs_buf_log_format; 39 struct xfs_inode_log_format; 40 struct xfs_bmbt_irec; 41 struct xfs_btree_cur; 42 struct xfs_refcount_irec; 43 44 DECLARE_EVENT_CLASS(xfs_attr_list_class, 45 TP_PROTO(struct xfs_attr_list_context *ctx), 46 TP_ARGS(ctx), 47 TP_STRUCT__entry( 48 __field(dev_t, dev) 49 __field(xfs_ino_t, ino) 50 __field(u32, hashval) 51 __field(u32, blkno) 52 __field(u32, offset) 53 __field(void *, alist) 54 __field(int, bufsize) 55 __field(int, count) 56 __field(int, firstu) 57 __field(int, dupcnt) 58 __field(int, flags) 59 ), 60 TP_fast_assign( 61 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; 62 __entry->ino = ctx->dp->i_ino; 63 __entry->hashval = ctx->cursor->hashval; 64 __entry->blkno = ctx->cursor->blkno; 65 __entry->offset = ctx->cursor->offset; 66 __entry->alist = ctx->alist; 67 __entry->bufsize = ctx->bufsize; 68 __entry->count = ctx->count; 69 __entry->firstu = ctx->firstu; 70 __entry->flags = ctx->flags; 71 ), 72 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " 73 "alist 0x%p size %u count %u firstu %u flags %d %s", 74 MAJOR(__entry->dev), MINOR(__entry->dev), 75 __entry->ino, 76 __entry->hashval, 77 __entry->blkno, 78 __entry->offset, 79 __entry->dupcnt, 80 __entry->alist, 81 __entry->bufsize, 82 __entry->count, 83 __entry->firstu, 84 __entry->flags, 85 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS) 86 ) 87 ) 88 89 #define DEFINE_ATTR_LIST_EVENT(name) \ 90 DEFINE_EVENT(xfs_attr_list_class, name, \ 91 TP_PROTO(struct xfs_attr_list_context *ctx), \ 92 TP_ARGS(ctx)) 93 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); 94 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); 95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); 96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); 97 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); 98 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); 99 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); 100 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); 101 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list); 102 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list); 103 104 DECLARE_EVENT_CLASS(xfs_perag_class, 105 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, 106 unsigned long caller_ip), 107 TP_ARGS(mp, agno, refcount, caller_ip), 108 TP_STRUCT__entry( 109 __field(dev_t, dev) 110 __field(xfs_agnumber_t, agno) 111 __field(int, refcount) 112 __field(unsigned long, caller_ip) 113 ), 114 TP_fast_assign( 115 __entry->dev = mp->m_super->s_dev; 116 __entry->agno = agno; 117 __entry->refcount = refcount; 118 __entry->caller_ip = caller_ip; 119 ), 120 TP_printk("dev %d:%d agno %u refcount %d caller %ps", 121 MAJOR(__entry->dev), MINOR(__entry->dev), 122 __entry->agno, 123 __entry->refcount, 124 (char *)__entry->caller_ip) 125 ); 126 127 #define DEFINE_PERAG_REF_EVENT(name) \ 128 DEFINE_EVENT(xfs_perag_class, name, \ 129 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ 130 unsigned long caller_ip), \ 131 TP_ARGS(mp, agno, refcount, caller_ip)) 132 DEFINE_PERAG_REF_EVENT(xfs_perag_get); 133 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag); 134 DEFINE_PERAG_REF_EVENT(xfs_perag_put); 135 DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim); 136 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim); 137 DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks); 138 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks); 139 DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks); 140 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks); 141 142 DECLARE_EVENT_CLASS(xfs_ag_class, 143 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), 144 TP_ARGS(mp, agno), 145 TP_STRUCT__entry( 146 __field(dev_t, dev) 147 __field(xfs_agnumber_t, agno) 148 ), 149 TP_fast_assign( 150 __entry->dev = mp->m_super->s_dev; 151 __entry->agno = agno; 152 ), 153 TP_printk("dev %d:%d agno %u", 154 MAJOR(__entry->dev), MINOR(__entry->dev), 155 __entry->agno) 156 ); 157 #define DEFINE_AG_EVENT(name) \ 158 DEFINE_EVENT(xfs_ag_class, name, \ 159 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \ 160 TP_ARGS(mp, agno)) 161 162 DEFINE_AG_EVENT(xfs_read_agf); 163 DEFINE_AG_EVENT(xfs_alloc_read_agf); 164 DEFINE_AG_EVENT(xfs_read_agi); 165 DEFINE_AG_EVENT(xfs_ialloc_read_agi); 166 167 TRACE_EVENT(xfs_attr_list_node_descend, 168 TP_PROTO(struct xfs_attr_list_context *ctx, 169 struct xfs_da_node_entry *btree), 170 TP_ARGS(ctx, btree), 171 TP_STRUCT__entry( 172 __field(dev_t, dev) 173 __field(xfs_ino_t, ino) 174 __field(u32, hashval) 175 __field(u32, blkno) 176 __field(u32, offset) 177 __field(void *, alist) 178 __field(int, bufsize) 179 __field(int, count) 180 __field(int, firstu) 181 __field(int, dupcnt) 182 __field(int, flags) 183 __field(u32, bt_hashval) 184 __field(u32, bt_before) 185 ), 186 TP_fast_assign( 187 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; 188 __entry->ino = ctx->dp->i_ino; 189 __entry->hashval = ctx->cursor->hashval; 190 __entry->blkno = ctx->cursor->blkno; 191 __entry->offset = ctx->cursor->offset; 192 __entry->alist = ctx->alist; 193 __entry->bufsize = ctx->bufsize; 194 __entry->count = ctx->count; 195 __entry->firstu = ctx->firstu; 196 __entry->flags = ctx->flags; 197 __entry->bt_hashval = be32_to_cpu(btree->hashval); 198 __entry->bt_before = be32_to_cpu(btree->before); 199 ), 200 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " 201 "alist 0x%p size %u count %u firstu %u flags %d %s " 202 "node hashval %u, node before %u", 203 MAJOR(__entry->dev), MINOR(__entry->dev), 204 __entry->ino, 205 __entry->hashval, 206 __entry->blkno, 207 __entry->offset, 208 __entry->dupcnt, 209 __entry->alist, 210 __entry->bufsize, 211 __entry->count, 212 __entry->firstu, 213 __entry->flags, 214 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS), 215 __entry->bt_hashval, 216 __entry->bt_before) 217 ); 218 219 TRACE_EVENT(xfs_iext_insert, 220 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, 221 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip), 222 TP_ARGS(ip, idx, r, state, caller_ip), 223 TP_STRUCT__entry( 224 __field(dev_t, dev) 225 __field(xfs_ino_t, ino) 226 __field(xfs_extnum_t, idx) 227 __field(xfs_fileoff_t, startoff) 228 __field(xfs_fsblock_t, startblock) 229 __field(xfs_filblks_t, blockcount) 230 __field(xfs_exntst_t, state) 231 __field(int, bmap_state) 232 __field(unsigned long, caller_ip) 233 ), 234 TP_fast_assign( 235 __entry->dev = VFS_I(ip)->i_sb->s_dev; 236 __entry->ino = ip->i_ino; 237 __entry->idx = idx; 238 __entry->startoff = r->br_startoff; 239 __entry->startblock = r->br_startblock; 240 __entry->blockcount = r->br_blockcount; 241 __entry->state = r->br_state; 242 __entry->bmap_state = state; 243 __entry->caller_ip = caller_ip; 244 ), 245 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " 246 "offset %lld block %lld count %lld flag %d caller %ps", 247 MAJOR(__entry->dev), MINOR(__entry->dev), 248 __entry->ino, 249 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), 250 (long)__entry->idx, 251 __entry->startoff, 252 (__int64_t)__entry->startblock, 253 __entry->blockcount, 254 __entry->state, 255 (char *)__entry->caller_ip) 256 ); 257 258 DECLARE_EVENT_CLASS(xfs_bmap_class, 259 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, 260 unsigned long caller_ip), 261 TP_ARGS(ip, idx, state, caller_ip), 262 TP_STRUCT__entry( 263 __field(dev_t, dev) 264 __field(xfs_ino_t, ino) 265 __field(xfs_extnum_t, idx) 266 __field(xfs_fileoff_t, startoff) 267 __field(xfs_fsblock_t, startblock) 268 __field(xfs_filblks_t, blockcount) 269 __field(xfs_exntst_t, state) 270 __field(int, bmap_state) 271 __field(unsigned long, caller_ip) 272 ), 273 TP_fast_assign( 274 struct xfs_ifork *ifp; 275 struct xfs_bmbt_irec r; 276 277 ifp = xfs_iext_state_to_fork(ip, state); 278 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r); 279 __entry->dev = VFS_I(ip)->i_sb->s_dev; 280 __entry->ino = ip->i_ino; 281 __entry->idx = idx; 282 __entry->startoff = r.br_startoff; 283 __entry->startblock = r.br_startblock; 284 __entry->blockcount = r.br_blockcount; 285 __entry->state = r.br_state; 286 __entry->bmap_state = state; 287 __entry->caller_ip = caller_ip; 288 ), 289 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " 290 "offset %lld block %lld count %lld flag %d caller %ps", 291 MAJOR(__entry->dev), MINOR(__entry->dev), 292 __entry->ino, 293 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), 294 (long)__entry->idx, 295 __entry->startoff, 296 (__int64_t)__entry->startblock, 297 __entry->blockcount, 298 __entry->state, 299 (char *)__entry->caller_ip) 300 ) 301 302 #define DEFINE_BMAP_EVENT(name) \ 303 DEFINE_EVENT(xfs_bmap_class, name, \ 304 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \ 305 unsigned long caller_ip), \ 306 TP_ARGS(ip, idx, state, caller_ip)) 307 DEFINE_BMAP_EVENT(xfs_iext_remove); 308 DEFINE_BMAP_EVENT(xfs_bmap_pre_update); 309 DEFINE_BMAP_EVENT(xfs_bmap_post_update); 310 DEFINE_BMAP_EVENT(xfs_extlist); 311 312 DECLARE_EVENT_CLASS(xfs_buf_class, 313 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), 314 TP_ARGS(bp, caller_ip), 315 TP_STRUCT__entry( 316 __field(dev_t, dev) 317 __field(xfs_daddr_t, bno) 318 __field(int, nblks) 319 __field(int, hold) 320 __field(int, pincount) 321 __field(unsigned, lockval) 322 __field(unsigned, flags) 323 __field(unsigned long, caller_ip) 324 ), 325 TP_fast_assign( 326 __entry->dev = bp->b_target->bt_dev; 327 __entry->bno = bp->b_bn; 328 __entry->nblks = bp->b_length; 329 __entry->hold = atomic_read(&bp->b_hold); 330 __entry->pincount = atomic_read(&bp->b_pin_count); 331 __entry->lockval = bp->b_sema.count; 332 __entry->flags = bp->b_flags; 333 __entry->caller_ip = caller_ip; 334 ), 335 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d " 336 "lock %d flags %s caller %ps", 337 MAJOR(__entry->dev), MINOR(__entry->dev), 338 (unsigned long long)__entry->bno, 339 __entry->nblks, 340 __entry->hold, 341 __entry->pincount, 342 __entry->lockval, 343 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), 344 (void *)__entry->caller_ip) 345 ) 346 347 #define DEFINE_BUF_EVENT(name) \ 348 DEFINE_EVENT(xfs_buf_class, name, \ 349 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ 350 TP_ARGS(bp, caller_ip)) 351 DEFINE_BUF_EVENT(xfs_buf_init); 352 DEFINE_BUF_EVENT(xfs_buf_free); 353 DEFINE_BUF_EVENT(xfs_buf_hold); 354 DEFINE_BUF_EVENT(xfs_buf_rele); 355 DEFINE_BUF_EVENT(xfs_buf_iodone); 356 DEFINE_BUF_EVENT(xfs_buf_submit); 357 DEFINE_BUF_EVENT(xfs_buf_submit_wait); 358 DEFINE_BUF_EVENT(xfs_buf_lock); 359 DEFINE_BUF_EVENT(xfs_buf_lock_done); 360 DEFINE_BUF_EVENT(xfs_buf_trylock_fail); 361 DEFINE_BUF_EVENT(xfs_buf_trylock); 362 DEFINE_BUF_EVENT(xfs_buf_unlock); 363 DEFINE_BUF_EVENT(xfs_buf_iowait); 364 DEFINE_BUF_EVENT(xfs_buf_iowait_done); 365 DEFINE_BUF_EVENT(xfs_buf_delwri_queue); 366 DEFINE_BUF_EVENT(xfs_buf_delwri_queued); 367 DEFINE_BUF_EVENT(xfs_buf_delwri_split); 368 DEFINE_BUF_EVENT(xfs_buf_get_uncached); 369 DEFINE_BUF_EVENT(xfs_buf_item_relse); 370 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async); 371 DEFINE_BUF_EVENT(xfs_buf_error_relse); 372 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg); 373 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); 374 375 /* not really buffer traces, but the buf provides useful information */ 376 DEFINE_BUF_EVENT(xfs_btree_corrupt); 377 DEFINE_BUF_EVENT(xfs_reset_dqcounts); 378 379 /* pass flags explicitly */ 380 DECLARE_EVENT_CLASS(xfs_buf_flags_class, 381 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), 382 TP_ARGS(bp, flags, caller_ip), 383 TP_STRUCT__entry( 384 __field(dev_t, dev) 385 __field(xfs_daddr_t, bno) 386 __field(size_t, buffer_length) 387 __field(int, hold) 388 __field(int, pincount) 389 __field(unsigned, lockval) 390 __field(unsigned, flags) 391 __field(unsigned long, caller_ip) 392 ), 393 TP_fast_assign( 394 __entry->dev = bp->b_target->bt_dev; 395 __entry->bno = bp->b_bn; 396 __entry->buffer_length = BBTOB(bp->b_length); 397 __entry->flags = flags; 398 __entry->hold = atomic_read(&bp->b_hold); 399 __entry->pincount = atomic_read(&bp->b_pin_count); 400 __entry->lockval = bp->b_sema.count; 401 __entry->caller_ip = caller_ip; 402 ), 403 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " 404 "lock %d flags %s caller %ps", 405 MAJOR(__entry->dev), MINOR(__entry->dev), 406 (unsigned long long)__entry->bno, 407 __entry->buffer_length, 408 __entry->hold, 409 __entry->pincount, 410 __entry->lockval, 411 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), 412 (void *)__entry->caller_ip) 413 ) 414 415 #define DEFINE_BUF_FLAGS_EVENT(name) \ 416 DEFINE_EVENT(xfs_buf_flags_class, name, \ 417 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ 418 TP_ARGS(bp, flags, caller_ip)) 419 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); 420 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); 421 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); 422 423 TRACE_EVENT(xfs_buf_ioerror, 424 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip), 425 TP_ARGS(bp, error, caller_ip), 426 TP_STRUCT__entry( 427 __field(dev_t, dev) 428 __field(xfs_daddr_t, bno) 429 __field(size_t, buffer_length) 430 __field(unsigned, flags) 431 __field(int, hold) 432 __field(int, pincount) 433 __field(unsigned, lockval) 434 __field(int, error) 435 __field(unsigned long, caller_ip) 436 ), 437 TP_fast_assign( 438 __entry->dev = bp->b_target->bt_dev; 439 __entry->bno = bp->b_bn; 440 __entry->buffer_length = BBTOB(bp->b_length); 441 __entry->hold = atomic_read(&bp->b_hold); 442 __entry->pincount = atomic_read(&bp->b_pin_count); 443 __entry->lockval = bp->b_sema.count; 444 __entry->error = error; 445 __entry->flags = bp->b_flags; 446 __entry->caller_ip = caller_ip; 447 ), 448 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " 449 "lock %d error %d flags %s caller %ps", 450 MAJOR(__entry->dev), MINOR(__entry->dev), 451 (unsigned long long)__entry->bno, 452 __entry->buffer_length, 453 __entry->hold, 454 __entry->pincount, 455 __entry->lockval, 456 __entry->error, 457 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), 458 (void *)__entry->caller_ip) 459 ); 460 461 DECLARE_EVENT_CLASS(xfs_buf_item_class, 462 TP_PROTO(struct xfs_buf_log_item *bip), 463 TP_ARGS(bip), 464 TP_STRUCT__entry( 465 __field(dev_t, dev) 466 __field(xfs_daddr_t, buf_bno) 467 __field(size_t, buf_len) 468 __field(int, buf_hold) 469 __field(int, buf_pincount) 470 __field(int, buf_lockval) 471 __field(unsigned, buf_flags) 472 __field(unsigned, bli_recur) 473 __field(int, bli_refcount) 474 __field(unsigned, bli_flags) 475 __field(void *, li_desc) 476 __field(unsigned, li_flags) 477 ), 478 TP_fast_assign( 479 __entry->dev = bip->bli_buf->b_target->bt_dev; 480 __entry->bli_flags = bip->bli_flags; 481 __entry->bli_recur = bip->bli_recur; 482 __entry->bli_refcount = atomic_read(&bip->bli_refcount); 483 __entry->buf_bno = bip->bli_buf->b_bn; 484 __entry->buf_len = BBTOB(bip->bli_buf->b_length); 485 __entry->buf_flags = bip->bli_buf->b_flags; 486 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); 487 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); 488 __entry->buf_lockval = bip->bli_buf->b_sema.count; 489 __entry->li_desc = bip->bli_item.li_desc; 490 __entry->li_flags = bip->bli_item.li_flags; 491 ), 492 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " 493 "lock %d flags %s recur %d refcount %d bliflags %s " 494 "lidesc 0x%p liflags %s", 495 MAJOR(__entry->dev), MINOR(__entry->dev), 496 (unsigned long long)__entry->buf_bno, 497 __entry->buf_len, 498 __entry->buf_hold, 499 __entry->buf_pincount, 500 __entry->buf_lockval, 501 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS), 502 __entry->bli_recur, 503 __entry->bli_refcount, 504 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS), 505 __entry->li_desc, 506 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS)) 507 ) 508 509 #define DEFINE_BUF_ITEM_EVENT(name) \ 510 DEFINE_EVENT(xfs_buf_item_class, name, \ 511 TP_PROTO(struct xfs_buf_log_item *bip), \ 512 TP_ARGS(bip)) 513 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); 514 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); 515 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); 516 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); 517 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered); 518 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); 519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); 520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); 521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); 522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); 523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock); 524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale); 525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); 526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); 527 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); 528 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); 529 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); 530 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); 531 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); 532 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); 533 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); 534 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); 535 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); 536 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); 537 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); 538 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); 539 540 DECLARE_EVENT_CLASS(xfs_filestream_class, 541 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), 542 TP_ARGS(ip, agno), 543 TP_STRUCT__entry( 544 __field(dev_t, dev) 545 __field(xfs_ino_t, ino) 546 __field(xfs_agnumber_t, agno) 547 __field(int, streams) 548 ), 549 TP_fast_assign( 550 __entry->dev = VFS_I(ip)->i_sb->s_dev; 551 __entry->ino = ip->i_ino; 552 __entry->agno = agno; 553 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno); 554 ), 555 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d", 556 MAJOR(__entry->dev), MINOR(__entry->dev), 557 __entry->ino, 558 __entry->agno, 559 __entry->streams) 560 ) 561 #define DEFINE_FILESTREAM_EVENT(name) \ 562 DEFINE_EVENT(xfs_filestream_class, name, \ 563 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \ 564 TP_ARGS(ip, agno)) 565 DEFINE_FILESTREAM_EVENT(xfs_filestream_free); 566 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup); 567 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan); 568 569 TRACE_EVENT(xfs_filestream_pick, 570 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno, 571 xfs_extlen_t free, int nscan), 572 TP_ARGS(ip, agno, free, nscan), 573 TP_STRUCT__entry( 574 __field(dev_t, dev) 575 __field(xfs_ino_t, ino) 576 __field(xfs_agnumber_t, agno) 577 __field(int, streams) 578 __field(xfs_extlen_t, free) 579 __field(int, nscan) 580 ), 581 TP_fast_assign( 582 __entry->dev = VFS_I(ip)->i_sb->s_dev; 583 __entry->ino = ip->i_ino; 584 __entry->agno = agno; 585 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno); 586 __entry->free = free; 587 __entry->nscan = nscan; 588 ), 589 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d", 590 MAJOR(__entry->dev), MINOR(__entry->dev), 591 __entry->ino, 592 __entry->agno, 593 __entry->streams, 594 __entry->free, 595 __entry->nscan) 596 ); 597 598 DECLARE_EVENT_CLASS(xfs_lock_class, 599 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, 600 unsigned long caller_ip), 601 TP_ARGS(ip, lock_flags, caller_ip), 602 TP_STRUCT__entry( 603 __field(dev_t, dev) 604 __field(xfs_ino_t, ino) 605 __field(int, lock_flags) 606 __field(unsigned long, caller_ip) 607 ), 608 TP_fast_assign( 609 __entry->dev = VFS_I(ip)->i_sb->s_dev; 610 __entry->ino = ip->i_ino; 611 __entry->lock_flags = lock_flags; 612 __entry->caller_ip = caller_ip; 613 ), 614 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps", 615 MAJOR(__entry->dev), MINOR(__entry->dev), 616 __entry->ino, 617 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), 618 (void *)__entry->caller_ip) 619 ) 620 621 #define DEFINE_LOCK_EVENT(name) \ 622 DEFINE_EVENT(xfs_lock_class, name, \ 623 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ 624 unsigned long caller_ip), \ 625 TP_ARGS(ip, lock_flags, caller_ip)) 626 DEFINE_LOCK_EVENT(xfs_ilock); 627 DEFINE_LOCK_EVENT(xfs_ilock_nowait); 628 DEFINE_LOCK_EVENT(xfs_ilock_demote); 629 DEFINE_LOCK_EVENT(xfs_iunlock); 630 631 DECLARE_EVENT_CLASS(xfs_inode_class, 632 TP_PROTO(struct xfs_inode *ip), 633 TP_ARGS(ip), 634 TP_STRUCT__entry( 635 __field(dev_t, dev) 636 __field(xfs_ino_t, ino) 637 ), 638 TP_fast_assign( 639 __entry->dev = VFS_I(ip)->i_sb->s_dev; 640 __entry->ino = ip->i_ino; 641 ), 642 TP_printk("dev %d:%d ino 0x%llx", 643 MAJOR(__entry->dev), MINOR(__entry->dev), 644 __entry->ino) 645 ) 646 647 #define DEFINE_INODE_EVENT(name) \ 648 DEFINE_EVENT(xfs_inode_class, name, \ 649 TP_PROTO(struct xfs_inode *ip), \ 650 TP_ARGS(ip)) 651 DEFINE_INODE_EVENT(xfs_iget_skip); 652 DEFINE_INODE_EVENT(xfs_iget_reclaim); 653 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail); 654 DEFINE_INODE_EVENT(xfs_iget_hit); 655 DEFINE_INODE_EVENT(xfs_iget_miss); 656 657 DEFINE_INODE_EVENT(xfs_getattr); 658 DEFINE_INODE_EVENT(xfs_setattr); 659 DEFINE_INODE_EVENT(xfs_readlink); 660 DEFINE_INODE_EVENT(xfs_inactive_symlink); 661 DEFINE_INODE_EVENT(xfs_alloc_file_space); 662 DEFINE_INODE_EVENT(xfs_free_file_space); 663 DEFINE_INODE_EVENT(xfs_zero_file_space); 664 DEFINE_INODE_EVENT(xfs_collapse_file_space); 665 DEFINE_INODE_EVENT(xfs_insert_file_space); 666 DEFINE_INODE_EVENT(xfs_readdir); 667 #ifdef CONFIG_XFS_POSIX_ACL 668 DEFINE_INODE_EVENT(xfs_get_acl); 669 #endif 670 DEFINE_INODE_EVENT(xfs_vm_bmap); 671 DEFINE_INODE_EVENT(xfs_file_ioctl); 672 DEFINE_INODE_EVENT(xfs_file_compat_ioctl); 673 DEFINE_INODE_EVENT(xfs_ioctl_setattr); 674 DEFINE_INODE_EVENT(xfs_dir_fsync); 675 DEFINE_INODE_EVENT(xfs_file_fsync); 676 DEFINE_INODE_EVENT(xfs_destroy_inode); 677 DEFINE_INODE_EVENT(xfs_update_time); 678 679 DEFINE_INODE_EVENT(xfs_dquot_dqalloc); 680 DEFINE_INODE_EVENT(xfs_dquot_dqdetach); 681 682 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag); 683 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag); 684 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid); 685 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag); 686 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag); 687 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid); 688 689 DEFINE_INODE_EVENT(xfs_filemap_fault); 690 DEFINE_INODE_EVENT(xfs_filemap_pmd_fault); 691 DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite); 692 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite); 693 694 DECLARE_EVENT_CLASS(xfs_iref_class, 695 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), 696 TP_ARGS(ip, caller_ip), 697 TP_STRUCT__entry( 698 __field(dev_t, dev) 699 __field(xfs_ino_t, ino) 700 __field(int, count) 701 __field(int, pincount) 702 __field(unsigned long, caller_ip) 703 ), 704 TP_fast_assign( 705 __entry->dev = VFS_I(ip)->i_sb->s_dev; 706 __entry->ino = ip->i_ino; 707 __entry->count = atomic_read(&VFS_I(ip)->i_count); 708 __entry->pincount = atomic_read(&ip->i_pincount); 709 __entry->caller_ip = caller_ip; 710 ), 711 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps", 712 MAJOR(__entry->dev), MINOR(__entry->dev), 713 __entry->ino, 714 __entry->count, 715 __entry->pincount, 716 (char *)__entry->caller_ip) 717 ) 718 719 TRACE_EVENT(xfs_iomap_prealloc_size, 720 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift, 721 unsigned int writeio_blocks), 722 TP_ARGS(ip, blocks, shift, writeio_blocks), 723 TP_STRUCT__entry( 724 __field(dev_t, dev) 725 __field(xfs_ino_t, ino) 726 __field(xfs_fsblock_t, blocks) 727 __field(int, shift) 728 __field(unsigned int, writeio_blocks) 729 ), 730 TP_fast_assign( 731 __entry->dev = VFS_I(ip)->i_sb->s_dev; 732 __entry->ino = ip->i_ino; 733 __entry->blocks = blocks; 734 __entry->shift = shift; 735 __entry->writeio_blocks = writeio_blocks; 736 ), 737 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d " 738 "m_writeio_blocks %u", 739 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, 740 __entry->blocks, __entry->shift, __entry->writeio_blocks) 741 ) 742 743 TRACE_EVENT(xfs_irec_merge_pre, 744 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, 745 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask), 746 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask), 747 TP_STRUCT__entry( 748 __field(dev_t, dev) 749 __field(xfs_agnumber_t, agno) 750 __field(xfs_agino_t, agino) 751 __field(uint16_t, holemask) 752 __field(xfs_agino_t, nagino) 753 __field(uint16_t, nholemask) 754 ), 755 TP_fast_assign( 756 __entry->dev = mp->m_super->s_dev; 757 __entry->agno = agno; 758 __entry->agino = agino; 759 __entry->holemask = holemask; 760 __entry->nagino = nagino; 761 __entry->nholemask = holemask; 762 ), 763 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)", 764 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, 765 __entry->agino, __entry->holemask, __entry->nagino, 766 __entry->nholemask) 767 ) 768 769 TRACE_EVENT(xfs_irec_merge_post, 770 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, 771 uint16_t holemask), 772 TP_ARGS(mp, agno, agino, holemask), 773 TP_STRUCT__entry( 774 __field(dev_t, dev) 775 __field(xfs_agnumber_t, agno) 776 __field(xfs_agino_t, agino) 777 __field(uint16_t, holemask) 778 ), 779 TP_fast_assign( 780 __entry->dev = mp->m_super->s_dev; 781 __entry->agno = agno; 782 __entry->agino = agino; 783 __entry->holemask = holemask; 784 ), 785 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev), 786 MINOR(__entry->dev), __entry->agno, __entry->agino, 787 __entry->holemask) 788 ) 789 790 #define DEFINE_IREF_EVENT(name) \ 791 DEFINE_EVENT(xfs_iref_class, name, \ 792 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ 793 TP_ARGS(ip, caller_ip)) 794 DEFINE_IREF_EVENT(xfs_irele); 795 DEFINE_IREF_EVENT(xfs_inode_pin); 796 DEFINE_IREF_EVENT(xfs_inode_unpin); 797 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait); 798 799 DECLARE_EVENT_CLASS(xfs_namespace_class, 800 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), 801 TP_ARGS(dp, name), 802 TP_STRUCT__entry( 803 __field(dev_t, dev) 804 __field(xfs_ino_t, dp_ino) 805 __field(int, namelen) 806 __dynamic_array(char, name, name->len) 807 ), 808 TP_fast_assign( 809 __entry->dev = VFS_I(dp)->i_sb->s_dev; 810 __entry->dp_ino = dp->i_ino; 811 __entry->namelen = name->len; 812 memcpy(__get_str(name), name->name, name->len); 813 ), 814 TP_printk("dev %d:%d dp ino 0x%llx name %.*s", 815 MAJOR(__entry->dev), MINOR(__entry->dev), 816 __entry->dp_ino, 817 __entry->namelen, 818 __get_str(name)) 819 ) 820 821 #define DEFINE_NAMESPACE_EVENT(name) \ 822 DEFINE_EVENT(xfs_namespace_class, name, \ 823 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \ 824 TP_ARGS(dp, name)) 825 DEFINE_NAMESPACE_EVENT(xfs_remove); 826 DEFINE_NAMESPACE_EVENT(xfs_link); 827 DEFINE_NAMESPACE_EVENT(xfs_lookup); 828 DEFINE_NAMESPACE_EVENT(xfs_create); 829 DEFINE_NAMESPACE_EVENT(xfs_symlink); 830 831 TRACE_EVENT(xfs_rename, 832 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp, 833 struct xfs_name *src_name, struct xfs_name *target_name), 834 TP_ARGS(src_dp, target_dp, src_name, target_name), 835 TP_STRUCT__entry( 836 __field(dev_t, dev) 837 __field(xfs_ino_t, src_dp_ino) 838 __field(xfs_ino_t, target_dp_ino) 839 __field(int, src_namelen) 840 __field(int, target_namelen) 841 __dynamic_array(char, src_name, src_name->len) 842 __dynamic_array(char, target_name, target_name->len) 843 ), 844 TP_fast_assign( 845 __entry->dev = VFS_I(src_dp)->i_sb->s_dev; 846 __entry->src_dp_ino = src_dp->i_ino; 847 __entry->target_dp_ino = target_dp->i_ino; 848 __entry->src_namelen = src_name->len; 849 __entry->target_namelen = target_name->len; 850 memcpy(__get_str(src_name), src_name->name, src_name->len); 851 memcpy(__get_str(target_name), target_name->name, 852 target_name->len); 853 ), 854 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx" 855 " src name %.*s target name %.*s", 856 MAJOR(__entry->dev), MINOR(__entry->dev), 857 __entry->src_dp_ino, 858 __entry->target_dp_ino, 859 __entry->src_namelen, 860 __get_str(src_name), 861 __entry->target_namelen, 862 __get_str(target_name)) 863 ) 864 865 DECLARE_EVENT_CLASS(xfs_dquot_class, 866 TP_PROTO(struct xfs_dquot *dqp), 867 TP_ARGS(dqp), 868 TP_STRUCT__entry( 869 __field(dev_t, dev) 870 __field(u32, id) 871 __field(unsigned, flags) 872 __field(unsigned, nrefs) 873 __field(unsigned long long, res_bcount) 874 __field(unsigned long long, bcount) 875 __field(unsigned long long, icount) 876 __field(unsigned long long, blk_hardlimit) 877 __field(unsigned long long, blk_softlimit) 878 __field(unsigned long long, ino_hardlimit) 879 __field(unsigned long long, ino_softlimit) 880 ), \ 881 TP_fast_assign( 882 __entry->dev = dqp->q_mount->m_super->s_dev; 883 __entry->id = be32_to_cpu(dqp->q_core.d_id); 884 __entry->flags = dqp->dq_flags; 885 __entry->nrefs = dqp->q_nrefs; 886 __entry->res_bcount = dqp->q_res_bcount; 887 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount); 888 __entry->icount = be64_to_cpu(dqp->q_core.d_icount); 889 __entry->blk_hardlimit = 890 be64_to_cpu(dqp->q_core.d_blk_hardlimit); 891 __entry->blk_softlimit = 892 be64_to_cpu(dqp->q_core.d_blk_softlimit); 893 __entry->ino_hardlimit = 894 be64_to_cpu(dqp->q_core.d_ino_hardlimit); 895 __entry->ino_softlimit = 896 be64_to_cpu(dqp->q_core.d_ino_softlimit); 897 ), 898 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx " 899 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx " 900 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]", 901 MAJOR(__entry->dev), MINOR(__entry->dev), 902 __entry->id, 903 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS), 904 __entry->nrefs, 905 __entry->res_bcount, 906 __entry->bcount, 907 __entry->blk_hardlimit, 908 __entry->blk_softlimit, 909 __entry->icount, 910 __entry->ino_hardlimit, 911 __entry->ino_softlimit) 912 ) 913 914 #define DEFINE_DQUOT_EVENT(name) \ 915 DEFINE_EVENT(xfs_dquot_class, name, \ 916 TP_PROTO(struct xfs_dquot *dqp), \ 917 TP_ARGS(dqp)) 918 DEFINE_DQUOT_EVENT(xfs_dqadjust); 919 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want); 920 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty); 921 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy); 922 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done); 923 DEFINE_DQUOT_EVENT(xfs_dqattach_found); 924 DEFINE_DQUOT_EVENT(xfs_dqattach_get); 925 DEFINE_DQUOT_EVENT(xfs_dqalloc); 926 DEFINE_DQUOT_EVENT(xfs_dqtobp_read); 927 DEFINE_DQUOT_EVENT(xfs_dqread); 928 DEFINE_DQUOT_EVENT(xfs_dqread_fail); 929 DEFINE_DQUOT_EVENT(xfs_dqget_hit); 930 DEFINE_DQUOT_EVENT(xfs_dqget_miss); 931 DEFINE_DQUOT_EVENT(xfs_dqget_freeing); 932 DEFINE_DQUOT_EVENT(xfs_dqget_dup); 933 DEFINE_DQUOT_EVENT(xfs_dqput); 934 DEFINE_DQUOT_EVENT(xfs_dqput_free); 935 DEFINE_DQUOT_EVENT(xfs_dqrele); 936 DEFINE_DQUOT_EVENT(xfs_dqflush); 937 DEFINE_DQUOT_EVENT(xfs_dqflush_force); 938 DEFINE_DQUOT_EVENT(xfs_dqflush_done); 939 940 DECLARE_EVENT_CLASS(xfs_loggrant_class, 941 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), 942 TP_ARGS(log, tic), 943 TP_STRUCT__entry( 944 __field(dev_t, dev) 945 __field(char, ocnt) 946 __field(char, cnt) 947 __field(int, curr_res) 948 __field(int, unit_res) 949 __field(unsigned int, flags) 950 __field(int, reserveq) 951 __field(int, writeq) 952 __field(int, grant_reserve_cycle) 953 __field(int, grant_reserve_bytes) 954 __field(int, grant_write_cycle) 955 __field(int, grant_write_bytes) 956 __field(int, curr_cycle) 957 __field(int, curr_block) 958 __field(xfs_lsn_t, tail_lsn) 959 ), 960 TP_fast_assign( 961 __entry->dev = log->l_mp->m_super->s_dev; 962 __entry->ocnt = tic->t_ocnt; 963 __entry->cnt = tic->t_cnt; 964 __entry->curr_res = tic->t_curr_res; 965 __entry->unit_res = tic->t_unit_res; 966 __entry->flags = tic->t_flags; 967 __entry->reserveq = list_empty(&log->l_reserve_head.waiters); 968 __entry->writeq = list_empty(&log->l_write_head.waiters); 969 xlog_crack_grant_head(&log->l_reserve_head.grant, 970 &__entry->grant_reserve_cycle, 971 &__entry->grant_reserve_bytes); 972 xlog_crack_grant_head(&log->l_write_head.grant, 973 &__entry->grant_write_cycle, 974 &__entry->grant_write_bytes); 975 __entry->curr_cycle = log->l_curr_cycle; 976 __entry->curr_block = log->l_curr_block; 977 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn); 978 ), 979 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u " 980 "t_unit_res %u t_flags %s reserveq %s " 981 "writeq %s grant_reserve_cycle %d " 982 "grant_reserve_bytes %d grant_write_cycle %d " 983 "grant_write_bytes %d curr_cycle %d curr_block %d " 984 "tail_cycle %d tail_block %d", 985 MAJOR(__entry->dev), MINOR(__entry->dev), 986 __entry->ocnt, 987 __entry->cnt, 988 __entry->curr_res, 989 __entry->unit_res, 990 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS), 991 __entry->reserveq ? "empty" : "active", 992 __entry->writeq ? "empty" : "active", 993 __entry->grant_reserve_cycle, 994 __entry->grant_reserve_bytes, 995 __entry->grant_write_cycle, 996 __entry->grant_write_bytes, 997 __entry->curr_cycle, 998 __entry->curr_block, 999 CYCLE_LSN(__entry->tail_lsn), 1000 BLOCK_LSN(__entry->tail_lsn) 1001 ) 1002 ) 1003 1004 #define DEFINE_LOGGRANT_EVENT(name) \ 1005 DEFINE_EVENT(xfs_loggrant_class, name, \ 1006 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \ 1007 TP_ARGS(log, tic)) 1008 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); 1009 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); 1010 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write); 1011 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep); 1012 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake); 1013 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up); 1014 DEFINE_LOGGRANT_EVENT(xfs_log_reserve); 1015 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit); 1016 DEFINE_LOGGRANT_EVENT(xfs_log_regrant); 1017 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit); 1018 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter); 1019 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit); 1020 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub); 1021 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter); 1022 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); 1023 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); 1024 1025 DECLARE_EVENT_CLASS(xfs_log_item_class, 1026 TP_PROTO(struct xfs_log_item *lip), 1027 TP_ARGS(lip), 1028 TP_STRUCT__entry( 1029 __field(dev_t, dev) 1030 __field(void *, lip) 1031 __field(uint, type) 1032 __field(uint, flags) 1033 __field(xfs_lsn_t, lsn) 1034 ), 1035 TP_fast_assign( 1036 __entry->dev = lip->li_mountp->m_super->s_dev; 1037 __entry->lip = lip; 1038 __entry->type = lip->li_type; 1039 __entry->flags = lip->li_flags; 1040 __entry->lsn = lip->li_lsn; 1041 ), 1042 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s", 1043 MAJOR(__entry->dev), MINOR(__entry->dev), 1044 __entry->lip, 1045 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn), 1046 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), 1047 __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) 1048 ) 1049 1050 TRACE_EVENT(xfs_log_force, 1051 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip), 1052 TP_ARGS(mp, lsn, caller_ip), 1053 TP_STRUCT__entry( 1054 __field(dev_t, dev) 1055 __field(xfs_lsn_t, lsn) 1056 __field(unsigned long, caller_ip) 1057 ), 1058 TP_fast_assign( 1059 __entry->dev = mp->m_super->s_dev; 1060 __entry->lsn = lsn; 1061 __entry->caller_ip = caller_ip; 1062 ), 1063 TP_printk("dev %d:%d lsn 0x%llx caller %ps", 1064 MAJOR(__entry->dev), MINOR(__entry->dev), 1065 __entry->lsn, (void *)__entry->caller_ip) 1066 ) 1067 1068 #define DEFINE_LOG_ITEM_EVENT(name) \ 1069 DEFINE_EVENT(xfs_log_item_class, name, \ 1070 TP_PROTO(struct xfs_log_item *lip), \ 1071 TP_ARGS(lip)) 1072 DEFINE_LOG_ITEM_EVENT(xfs_ail_push); 1073 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned); 1074 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked); 1075 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing); 1076 1077 DECLARE_EVENT_CLASS(xfs_ail_class, 1078 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), 1079 TP_ARGS(lip, old_lsn, new_lsn), 1080 TP_STRUCT__entry( 1081 __field(dev_t, dev) 1082 __field(void *, lip) 1083 __field(uint, type) 1084 __field(uint, flags) 1085 __field(xfs_lsn_t, old_lsn) 1086 __field(xfs_lsn_t, new_lsn) 1087 ), 1088 TP_fast_assign( 1089 __entry->dev = lip->li_mountp->m_super->s_dev; 1090 __entry->lip = lip; 1091 __entry->type = lip->li_type; 1092 __entry->flags = lip->li_flags; 1093 __entry->old_lsn = old_lsn; 1094 __entry->new_lsn = new_lsn; 1095 ), 1096 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s", 1097 MAJOR(__entry->dev), MINOR(__entry->dev), 1098 __entry->lip, 1099 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), 1100 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), 1101 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), 1102 __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) 1103 ) 1104 1105 #define DEFINE_AIL_EVENT(name) \ 1106 DEFINE_EVENT(xfs_ail_class, name, \ 1107 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \ 1108 TP_ARGS(lip, old_lsn, new_lsn)) 1109 DEFINE_AIL_EVENT(xfs_ail_insert); 1110 DEFINE_AIL_EVENT(xfs_ail_move); 1111 DEFINE_AIL_EVENT(xfs_ail_delete); 1112 1113 TRACE_EVENT(xfs_log_assign_tail_lsn, 1114 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn), 1115 TP_ARGS(log, new_lsn), 1116 TP_STRUCT__entry( 1117 __field(dev_t, dev) 1118 __field(xfs_lsn_t, new_lsn) 1119 __field(xfs_lsn_t, old_lsn) 1120 __field(xfs_lsn_t, last_sync_lsn) 1121 ), 1122 TP_fast_assign( 1123 __entry->dev = log->l_mp->m_super->s_dev; 1124 __entry->new_lsn = new_lsn; 1125 __entry->old_lsn = atomic64_read(&log->l_tail_lsn); 1126 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn); 1127 ), 1128 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d", 1129 MAJOR(__entry->dev), MINOR(__entry->dev), 1130 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), 1131 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), 1132 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn)) 1133 ) 1134 1135 DECLARE_EVENT_CLASS(xfs_file_class, 1136 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), 1137 TP_ARGS(ip, count, offset), 1138 TP_STRUCT__entry( 1139 __field(dev_t, dev) 1140 __field(xfs_ino_t, ino) 1141 __field(xfs_fsize_t, size) 1142 __field(loff_t, offset) 1143 __field(size_t, count) 1144 ), 1145 TP_fast_assign( 1146 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1147 __entry->ino = ip->i_ino; 1148 __entry->size = ip->i_d.di_size; 1149 __entry->offset = offset; 1150 __entry->count = count; 1151 ), 1152 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx", 1153 MAJOR(__entry->dev), MINOR(__entry->dev), 1154 __entry->ino, 1155 __entry->size, 1156 __entry->offset, 1157 __entry->count) 1158 ) 1159 1160 #define DEFINE_RW_EVENT(name) \ 1161 DEFINE_EVENT(xfs_file_class, name, \ 1162 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \ 1163 TP_ARGS(ip, count, offset)) 1164 DEFINE_RW_EVENT(xfs_file_buffered_read); 1165 DEFINE_RW_EVENT(xfs_file_direct_read); 1166 DEFINE_RW_EVENT(xfs_file_dax_read); 1167 DEFINE_RW_EVENT(xfs_file_buffered_write); 1168 DEFINE_RW_EVENT(xfs_file_direct_write); 1169 DEFINE_RW_EVENT(xfs_file_dax_write); 1170 1171 DECLARE_EVENT_CLASS(xfs_page_class, 1172 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, 1173 unsigned int len), 1174 TP_ARGS(inode, page, off, len), 1175 TP_STRUCT__entry( 1176 __field(dev_t, dev) 1177 __field(xfs_ino_t, ino) 1178 __field(pgoff_t, pgoff) 1179 __field(loff_t, size) 1180 __field(unsigned long, offset) 1181 __field(unsigned int, length) 1182 __field(int, delalloc) 1183 __field(int, unwritten) 1184 ), 1185 TP_fast_assign( 1186 int delalloc = -1, unwritten = -1; 1187 1188 if (page_has_buffers(page)) 1189 xfs_count_page_state(page, &delalloc, &unwritten); 1190 __entry->dev = inode->i_sb->s_dev; 1191 __entry->ino = XFS_I(inode)->i_ino; 1192 __entry->pgoff = page_offset(page); 1193 __entry->size = i_size_read(inode); 1194 __entry->offset = off; 1195 __entry->length = len; 1196 __entry->delalloc = delalloc; 1197 __entry->unwritten = unwritten; 1198 ), 1199 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " 1200 "length %x delalloc %d unwritten %d", 1201 MAJOR(__entry->dev), MINOR(__entry->dev), 1202 __entry->ino, 1203 __entry->pgoff, 1204 __entry->size, 1205 __entry->offset, 1206 __entry->length, 1207 __entry->delalloc, 1208 __entry->unwritten) 1209 ) 1210 1211 #define DEFINE_PAGE_EVENT(name) \ 1212 DEFINE_EVENT(xfs_page_class, name, \ 1213 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \ 1214 unsigned int len), \ 1215 TP_ARGS(inode, page, off, len)) 1216 DEFINE_PAGE_EVENT(xfs_writepage); 1217 DEFINE_PAGE_EVENT(xfs_releasepage); 1218 DEFINE_PAGE_EVENT(xfs_invalidatepage); 1219 1220 DECLARE_EVENT_CLASS(xfs_readpage_class, 1221 TP_PROTO(struct inode *inode, int nr_pages), 1222 TP_ARGS(inode, nr_pages), 1223 TP_STRUCT__entry( 1224 __field(dev_t, dev) 1225 __field(xfs_ino_t, ino) 1226 __field(int, nr_pages) 1227 ), 1228 TP_fast_assign( 1229 __entry->dev = inode->i_sb->s_dev; 1230 __entry->ino = inode->i_ino; 1231 __entry->nr_pages = nr_pages; 1232 ), 1233 TP_printk("dev %d:%d ino 0x%llx nr_pages %d", 1234 MAJOR(__entry->dev), MINOR(__entry->dev), 1235 __entry->ino, 1236 __entry->nr_pages) 1237 ) 1238 1239 #define DEFINE_READPAGE_EVENT(name) \ 1240 DEFINE_EVENT(xfs_readpage_class, name, \ 1241 TP_PROTO(struct inode *inode, int nr_pages), \ 1242 TP_ARGS(inode, nr_pages)) 1243 DEFINE_READPAGE_EVENT(xfs_vm_readpage); 1244 DEFINE_READPAGE_EVENT(xfs_vm_readpages); 1245 1246 DECLARE_EVENT_CLASS(xfs_imap_class, 1247 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, 1248 int type, struct xfs_bmbt_irec *irec), 1249 TP_ARGS(ip, offset, count, type, irec), 1250 TP_STRUCT__entry( 1251 __field(dev_t, dev) 1252 __field(xfs_ino_t, ino) 1253 __field(loff_t, size) 1254 __field(loff_t, offset) 1255 __field(size_t, count) 1256 __field(int, type) 1257 __field(xfs_fileoff_t, startoff) 1258 __field(xfs_fsblock_t, startblock) 1259 __field(xfs_filblks_t, blockcount) 1260 ), 1261 TP_fast_assign( 1262 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1263 __entry->ino = ip->i_ino; 1264 __entry->size = ip->i_d.di_size; 1265 __entry->offset = offset; 1266 __entry->count = count; 1267 __entry->type = type; 1268 __entry->startoff = irec ? irec->br_startoff : 0; 1269 __entry->startblock = irec ? irec->br_startblock : 0; 1270 __entry->blockcount = irec ? irec->br_blockcount : 0; 1271 ), 1272 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd " 1273 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx", 1274 MAJOR(__entry->dev), MINOR(__entry->dev), 1275 __entry->ino, 1276 __entry->size, 1277 __entry->offset, 1278 __entry->count, 1279 __print_symbolic(__entry->type, XFS_IO_TYPES), 1280 __entry->startoff, 1281 (__int64_t)__entry->startblock, 1282 __entry->blockcount) 1283 ) 1284 1285 #define DEFINE_IOMAP_EVENT(name) \ 1286 DEFINE_EVENT(xfs_imap_class, name, \ 1287 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ 1288 int type, struct xfs_bmbt_irec *irec), \ 1289 TP_ARGS(ip, offset, count, type, irec)) 1290 DEFINE_IOMAP_EVENT(xfs_map_blocks_found); 1291 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc); 1292 DEFINE_IOMAP_EVENT(xfs_get_blocks_found); 1293 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); 1294 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); 1295 DEFINE_IOMAP_EVENT(xfs_iomap_alloc); 1296 DEFINE_IOMAP_EVENT(xfs_iomap_found); 1297 1298 DECLARE_EVENT_CLASS(xfs_simple_io_class, 1299 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), 1300 TP_ARGS(ip, offset, count), 1301 TP_STRUCT__entry( 1302 __field(dev_t, dev) 1303 __field(xfs_ino_t, ino) 1304 __field(loff_t, isize) 1305 __field(loff_t, disize) 1306 __field(loff_t, offset) 1307 __field(size_t, count) 1308 ), 1309 TP_fast_assign( 1310 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1311 __entry->ino = ip->i_ino; 1312 __entry->isize = VFS_I(ip)->i_size; 1313 __entry->disize = ip->i_d.di_size; 1314 __entry->offset = offset; 1315 __entry->count = count; 1316 ), 1317 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx " 1318 "offset 0x%llx count %zd", 1319 MAJOR(__entry->dev), MINOR(__entry->dev), 1320 __entry->ino, 1321 __entry->isize, 1322 __entry->disize, 1323 __entry->offset, 1324 __entry->count) 1325 ); 1326 1327 #define DEFINE_SIMPLE_IO_EVENT(name) \ 1328 DEFINE_EVENT(xfs_simple_io_class, name, \ 1329 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ 1330 TP_ARGS(ip, offset, count)) 1331 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); 1332 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); 1333 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound); 1334 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); 1335 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); 1336 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); 1337 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); 1338 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); 1339 1340 DECLARE_EVENT_CLASS(xfs_itrunc_class, 1341 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), 1342 TP_ARGS(ip, new_size), 1343 TP_STRUCT__entry( 1344 __field(dev_t, dev) 1345 __field(xfs_ino_t, ino) 1346 __field(xfs_fsize_t, size) 1347 __field(xfs_fsize_t, new_size) 1348 ), 1349 TP_fast_assign( 1350 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1351 __entry->ino = ip->i_ino; 1352 __entry->size = ip->i_d.di_size; 1353 __entry->new_size = new_size; 1354 ), 1355 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", 1356 MAJOR(__entry->dev), MINOR(__entry->dev), 1357 __entry->ino, 1358 __entry->size, 1359 __entry->new_size) 1360 ) 1361 1362 #define DEFINE_ITRUNC_EVENT(name) \ 1363 DEFINE_EVENT(xfs_itrunc_class, name, \ 1364 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \ 1365 TP_ARGS(ip, new_size)) 1366 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start); 1367 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end); 1368 1369 TRACE_EVENT(xfs_pagecache_inval, 1370 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish), 1371 TP_ARGS(ip, start, finish), 1372 TP_STRUCT__entry( 1373 __field(dev_t, dev) 1374 __field(xfs_ino_t, ino) 1375 __field(xfs_fsize_t, size) 1376 __field(xfs_off_t, start) 1377 __field(xfs_off_t, finish) 1378 ), 1379 TP_fast_assign( 1380 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1381 __entry->ino = ip->i_ino; 1382 __entry->size = ip->i_d.di_size; 1383 __entry->start = start; 1384 __entry->finish = finish; 1385 ), 1386 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx", 1387 MAJOR(__entry->dev), MINOR(__entry->dev), 1388 __entry->ino, 1389 __entry->size, 1390 __entry->start, 1391 __entry->finish) 1392 ); 1393 1394 TRACE_EVENT(xfs_bunmap, 1395 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len, 1396 int flags, unsigned long caller_ip), 1397 TP_ARGS(ip, bno, len, flags, caller_ip), 1398 TP_STRUCT__entry( 1399 __field(dev_t, dev) 1400 __field(xfs_ino_t, ino) 1401 __field(xfs_fsize_t, size) 1402 __field(xfs_fileoff_t, bno) 1403 __field(xfs_filblks_t, len) 1404 __field(unsigned long, caller_ip) 1405 __field(int, flags) 1406 ), 1407 TP_fast_assign( 1408 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1409 __entry->ino = ip->i_ino; 1410 __entry->size = ip->i_d.di_size; 1411 __entry->bno = bno; 1412 __entry->len = len; 1413 __entry->caller_ip = caller_ip; 1414 __entry->flags = flags; 1415 ), 1416 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx" 1417 "flags %s caller %ps", 1418 MAJOR(__entry->dev), MINOR(__entry->dev), 1419 __entry->ino, 1420 __entry->size, 1421 __entry->bno, 1422 __entry->len, 1423 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS), 1424 (void *)__entry->caller_ip) 1425 1426 ); 1427 1428 DECLARE_EVENT_CLASS(xfs_extent_busy_class, 1429 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 1430 xfs_agblock_t agbno, xfs_extlen_t len), 1431 TP_ARGS(mp, agno, agbno, len), 1432 TP_STRUCT__entry( 1433 __field(dev_t, dev) 1434 __field(xfs_agnumber_t, agno) 1435 __field(xfs_agblock_t, agbno) 1436 __field(xfs_extlen_t, len) 1437 ), 1438 TP_fast_assign( 1439 __entry->dev = mp->m_super->s_dev; 1440 __entry->agno = agno; 1441 __entry->agbno = agbno; 1442 __entry->len = len; 1443 ), 1444 TP_printk("dev %d:%d agno %u agbno %u len %u", 1445 MAJOR(__entry->dev), MINOR(__entry->dev), 1446 __entry->agno, 1447 __entry->agbno, 1448 __entry->len) 1449 ); 1450 #define DEFINE_BUSY_EVENT(name) \ 1451 DEFINE_EVENT(xfs_extent_busy_class, name, \ 1452 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 1453 xfs_agblock_t agbno, xfs_extlen_t len), \ 1454 TP_ARGS(mp, agno, agbno, len)) 1455 DEFINE_BUSY_EVENT(xfs_extent_busy); 1456 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem); 1457 DEFINE_BUSY_EVENT(xfs_extent_busy_force); 1458 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse); 1459 DEFINE_BUSY_EVENT(xfs_extent_busy_clear); 1460 1461 TRACE_EVENT(xfs_extent_busy_trim, 1462 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 1463 xfs_agblock_t agbno, xfs_extlen_t len, 1464 xfs_agblock_t tbno, xfs_extlen_t tlen), 1465 TP_ARGS(mp, agno, agbno, len, tbno, tlen), 1466 TP_STRUCT__entry( 1467 __field(dev_t, dev) 1468 __field(xfs_agnumber_t, agno) 1469 __field(xfs_agblock_t, agbno) 1470 __field(xfs_extlen_t, len) 1471 __field(xfs_agblock_t, tbno) 1472 __field(xfs_extlen_t, tlen) 1473 ), 1474 TP_fast_assign( 1475 __entry->dev = mp->m_super->s_dev; 1476 __entry->agno = agno; 1477 __entry->agbno = agbno; 1478 __entry->len = len; 1479 __entry->tbno = tbno; 1480 __entry->tlen = tlen; 1481 ), 1482 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u", 1483 MAJOR(__entry->dev), MINOR(__entry->dev), 1484 __entry->agno, 1485 __entry->agbno, 1486 __entry->len, 1487 __entry->tbno, 1488 __entry->tlen) 1489 ); 1490 1491 TRACE_EVENT(xfs_trans_commit_lsn, 1492 TP_PROTO(struct xfs_trans *trans), 1493 TP_ARGS(trans), 1494 TP_STRUCT__entry( 1495 __field(dev_t, dev) 1496 __field(struct xfs_trans *, tp) 1497 __field(xfs_lsn_t, lsn) 1498 ), 1499 TP_fast_assign( 1500 __entry->dev = trans->t_mountp->m_super->s_dev; 1501 __entry->tp = trans; 1502 __entry->lsn = trans->t_commit_lsn; 1503 ), 1504 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx", 1505 MAJOR(__entry->dev), MINOR(__entry->dev), 1506 __entry->tp, 1507 __entry->lsn) 1508 ); 1509 1510 TRACE_EVENT(xfs_agf, 1511 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, 1512 unsigned long caller_ip), 1513 TP_ARGS(mp, agf, flags, caller_ip), 1514 TP_STRUCT__entry( 1515 __field(dev_t, dev) 1516 __field(xfs_agnumber_t, agno) 1517 __field(int, flags) 1518 __field(__u32, length) 1519 __field(__u32, bno_root) 1520 __field(__u32, cnt_root) 1521 __field(__u32, bno_level) 1522 __field(__u32, cnt_level) 1523 __field(__u32, flfirst) 1524 __field(__u32, fllast) 1525 __field(__u32, flcount) 1526 __field(__u32, freeblks) 1527 __field(__u32, longest) 1528 __field(unsigned long, caller_ip) 1529 ), 1530 TP_fast_assign( 1531 __entry->dev = mp->m_super->s_dev; 1532 __entry->agno = be32_to_cpu(agf->agf_seqno), 1533 __entry->flags = flags; 1534 __entry->length = be32_to_cpu(agf->agf_length), 1535 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), 1536 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), 1537 __entry->bno_level = 1538 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), 1539 __entry->cnt_level = 1540 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), 1541 __entry->flfirst = be32_to_cpu(agf->agf_flfirst), 1542 __entry->fllast = be32_to_cpu(agf->agf_fllast), 1543 __entry->flcount = be32_to_cpu(agf->agf_flcount), 1544 __entry->freeblks = be32_to_cpu(agf->agf_freeblks), 1545 __entry->longest = be32_to_cpu(agf->agf_longest); 1546 __entry->caller_ip = caller_ip; 1547 ), 1548 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u " 1549 "levels b %u c %u flfirst %u fllast %u flcount %u " 1550 "freeblks %u longest %u caller %ps", 1551 MAJOR(__entry->dev), MINOR(__entry->dev), 1552 __entry->agno, 1553 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS), 1554 __entry->length, 1555 __entry->bno_root, 1556 __entry->cnt_root, 1557 __entry->bno_level, 1558 __entry->cnt_level, 1559 __entry->flfirst, 1560 __entry->fllast, 1561 __entry->flcount, 1562 __entry->freeblks, 1563 __entry->longest, 1564 (void *)__entry->caller_ip) 1565 ); 1566 1567 TRACE_EVENT(xfs_free_extent, 1568 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, 1569 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft, 1570 int haveright), 1571 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright), 1572 TP_STRUCT__entry( 1573 __field(dev_t, dev) 1574 __field(xfs_agnumber_t, agno) 1575 __field(xfs_agblock_t, agbno) 1576 __field(xfs_extlen_t, len) 1577 __field(int, resv) 1578 __field(int, haveleft) 1579 __field(int, haveright) 1580 ), 1581 TP_fast_assign( 1582 __entry->dev = mp->m_super->s_dev; 1583 __entry->agno = agno; 1584 __entry->agbno = agbno; 1585 __entry->len = len; 1586 __entry->resv = resv; 1587 __entry->haveleft = haveleft; 1588 __entry->haveright = haveright; 1589 ), 1590 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s", 1591 MAJOR(__entry->dev), MINOR(__entry->dev), 1592 __entry->agno, 1593 __entry->agbno, 1594 __entry->len, 1595 __entry->resv, 1596 __entry->haveleft ? 1597 (__entry->haveright ? "both" : "left") : 1598 (__entry->haveright ? "right" : "none")) 1599 1600 ); 1601 1602 DECLARE_EVENT_CLASS(xfs_alloc_class, 1603 TP_PROTO(struct xfs_alloc_arg *args), 1604 TP_ARGS(args), 1605 TP_STRUCT__entry( 1606 __field(dev_t, dev) 1607 __field(xfs_agnumber_t, agno) 1608 __field(xfs_agblock_t, agbno) 1609 __field(xfs_extlen_t, minlen) 1610 __field(xfs_extlen_t, maxlen) 1611 __field(xfs_extlen_t, mod) 1612 __field(xfs_extlen_t, prod) 1613 __field(xfs_extlen_t, minleft) 1614 __field(xfs_extlen_t, total) 1615 __field(xfs_extlen_t, alignment) 1616 __field(xfs_extlen_t, minalignslop) 1617 __field(xfs_extlen_t, len) 1618 __field(short, type) 1619 __field(short, otype) 1620 __field(char, wasdel) 1621 __field(char, wasfromfl) 1622 __field(int, resv) 1623 __field(int, datatype) 1624 __field(xfs_fsblock_t, firstblock) 1625 ), 1626 TP_fast_assign( 1627 __entry->dev = args->mp->m_super->s_dev; 1628 __entry->agno = args->agno; 1629 __entry->agbno = args->agbno; 1630 __entry->minlen = args->minlen; 1631 __entry->maxlen = args->maxlen; 1632 __entry->mod = args->mod; 1633 __entry->prod = args->prod; 1634 __entry->minleft = args->minleft; 1635 __entry->total = args->total; 1636 __entry->alignment = args->alignment; 1637 __entry->minalignslop = args->minalignslop; 1638 __entry->len = args->len; 1639 __entry->type = args->type; 1640 __entry->otype = args->otype; 1641 __entry->wasdel = args->wasdel; 1642 __entry->wasfromfl = args->wasfromfl; 1643 __entry->resv = args->resv; 1644 __entry->datatype = args->datatype; 1645 __entry->firstblock = args->firstblock; 1646 ), 1647 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u " 1648 "prod %u minleft %u total %u alignment %u minalignslop %u " 1649 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d " 1650 "datatype 0x%x firstblock 0x%llx", 1651 MAJOR(__entry->dev), MINOR(__entry->dev), 1652 __entry->agno, 1653 __entry->agbno, 1654 __entry->minlen, 1655 __entry->maxlen, 1656 __entry->mod, 1657 __entry->prod, 1658 __entry->minleft, 1659 __entry->total, 1660 __entry->alignment, 1661 __entry->minalignslop, 1662 __entry->len, 1663 __print_symbolic(__entry->type, XFS_ALLOC_TYPES), 1664 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES), 1665 __entry->wasdel, 1666 __entry->wasfromfl, 1667 __entry->resv, 1668 __entry->datatype, 1669 (unsigned long long)__entry->firstblock) 1670 ) 1671 1672 #define DEFINE_ALLOC_EVENT(name) \ 1673 DEFINE_EVENT(xfs_alloc_class, name, \ 1674 TP_PROTO(struct xfs_alloc_arg *args), \ 1675 TP_ARGS(args)) 1676 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done); 1677 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound); 1678 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error); 1679 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft); 1680 DEFINE_ALLOC_EVENT(xfs_alloc_near_first); 1681 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater); 1682 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser); 1683 DEFINE_ALLOC_EVENT(xfs_alloc_near_error); 1684 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry); 1685 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy); 1686 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither); 1687 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry); 1688 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft); 1689 DEFINE_ALLOC_EVENT(xfs_alloc_size_done); 1690 DEFINE_ALLOC_EVENT(xfs_alloc_size_error); 1691 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy); 1692 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist); 1693 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough); 1694 DEFINE_ALLOC_EVENT(xfs_alloc_small_done); 1695 DEFINE_ALLOC_EVENT(xfs_alloc_small_error); 1696 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs); 1697 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix); 1698 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp); 1699 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); 1700 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); 1701 1702 DECLARE_EVENT_CLASS(xfs_da_class, 1703 TP_PROTO(struct xfs_da_args *args), 1704 TP_ARGS(args), 1705 TP_STRUCT__entry( 1706 __field(dev_t, dev) 1707 __field(xfs_ino_t, ino) 1708 __dynamic_array(char, name, args->namelen) 1709 __field(int, namelen) 1710 __field(xfs_dahash_t, hashval) 1711 __field(xfs_ino_t, inumber) 1712 __field(int, op_flags) 1713 ), 1714 TP_fast_assign( 1715 __entry->dev = VFS_I(args->dp)->i_sb->s_dev; 1716 __entry->ino = args->dp->i_ino; 1717 if (args->namelen) 1718 memcpy(__get_str(name), args->name, args->namelen); 1719 __entry->namelen = args->namelen; 1720 __entry->hashval = args->hashval; 1721 __entry->inumber = args->inumber; 1722 __entry->op_flags = args->op_flags; 1723 ), 1724 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x " 1725 "inumber 0x%llx op_flags %s", 1726 MAJOR(__entry->dev), MINOR(__entry->dev), 1727 __entry->ino, 1728 __entry->namelen, 1729 __entry->namelen ? __get_str(name) : NULL, 1730 __entry->namelen, 1731 __entry->hashval, 1732 __entry->inumber, 1733 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) 1734 ) 1735 1736 #define DEFINE_DIR2_EVENT(name) \ 1737 DEFINE_EVENT(xfs_da_class, name, \ 1738 TP_PROTO(struct xfs_da_args *args), \ 1739 TP_ARGS(args)) 1740 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname); 1741 DEFINE_DIR2_EVENT(xfs_dir2_sf_create); 1742 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup); 1743 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace); 1744 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename); 1745 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4); 1746 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8); 1747 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block); 1748 DEFINE_DIR2_EVENT(xfs_dir2_block_addname); 1749 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup); 1750 DEFINE_DIR2_EVENT(xfs_dir2_block_replace); 1751 DEFINE_DIR2_EVENT(xfs_dir2_block_removename); 1752 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf); 1753 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf); 1754 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname); 1755 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup); 1756 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace); 1757 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename); 1758 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block); 1759 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node); 1760 DEFINE_DIR2_EVENT(xfs_dir2_node_addname); 1761 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup); 1762 DEFINE_DIR2_EVENT(xfs_dir2_node_replace); 1763 DEFINE_DIR2_EVENT(xfs_dir2_node_removename); 1764 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf); 1765 1766 DECLARE_EVENT_CLASS(xfs_attr_class, 1767 TP_PROTO(struct xfs_da_args *args), 1768 TP_ARGS(args), 1769 TP_STRUCT__entry( 1770 __field(dev_t, dev) 1771 __field(xfs_ino_t, ino) 1772 __dynamic_array(char, name, args->namelen) 1773 __field(int, namelen) 1774 __field(int, valuelen) 1775 __field(xfs_dahash_t, hashval) 1776 __field(int, op_flags) 1777 ), 1778 TP_fast_assign( 1779 __entry->dev = VFS_I(args->dp)->i_sb->s_dev; 1780 __entry->ino = args->dp->i_ino; 1781 if (args->namelen) 1782 memcpy(__get_str(name), args->name, args->namelen); 1783 __entry->namelen = args->namelen; 1784 __entry->valuelen = args->valuelen; 1785 __entry->hashval = args->hashval; 1786 __entry->op_flags = args->op_flags; 1787 ), 1788 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d " 1789 "hashval 0x%x op_flags %s", 1790 MAJOR(__entry->dev), MINOR(__entry->dev), 1791 __entry->ino, 1792 __entry->namelen, 1793 __entry->namelen ? __get_str(name) : NULL, 1794 __entry->namelen, 1795 __entry->valuelen, 1796 __entry->hashval, 1797 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) 1798 ) 1799 1800 #define DEFINE_ATTR_EVENT(name) \ 1801 DEFINE_EVENT(xfs_attr_class, name, \ 1802 TP_PROTO(struct xfs_da_args *args), \ 1803 TP_ARGS(args)) 1804 DEFINE_ATTR_EVENT(xfs_attr_sf_add); 1805 DEFINE_ATTR_EVENT(xfs_attr_sf_addname); 1806 DEFINE_ATTR_EVENT(xfs_attr_sf_create); 1807 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup); 1808 DEFINE_ATTR_EVENT(xfs_attr_sf_remove); 1809 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf); 1810 1811 DEFINE_ATTR_EVENT(xfs_attr_leaf_add); 1812 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old); 1813 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new); 1814 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work); 1815 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname); 1816 DEFINE_ATTR_EVENT(xfs_attr_leaf_create); 1817 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact); 1818 DEFINE_ATTR_EVENT(xfs_attr_leaf_get); 1819 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup); 1820 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace); 1821 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove); 1822 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename); 1823 DEFINE_ATTR_EVENT(xfs_attr_leaf_split); 1824 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before); 1825 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after); 1826 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag); 1827 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag); 1828 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags); 1829 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf); 1830 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node); 1831 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance); 1832 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance); 1833 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall); 1834 1835 DEFINE_ATTR_EVENT(xfs_attr_node_addname); 1836 DEFINE_ATTR_EVENT(xfs_attr_node_get); 1837 DEFINE_ATTR_EVENT(xfs_attr_node_replace); 1838 DEFINE_ATTR_EVENT(xfs_attr_node_removename); 1839 1840 DEFINE_ATTR_EVENT(xfs_attr_fillstate); 1841 DEFINE_ATTR_EVENT(xfs_attr_refillstate); 1842 1843 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get); 1844 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set); 1845 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove); 1846 1847 #define DEFINE_DA_EVENT(name) \ 1848 DEFINE_EVENT(xfs_da_class, name, \ 1849 TP_PROTO(struct xfs_da_args *args), \ 1850 TP_ARGS(args)) 1851 DEFINE_DA_EVENT(xfs_da_split); 1852 DEFINE_DA_EVENT(xfs_da_join); 1853 DEFINE_DA_EVENT(xfs_da_link_before); 1854 DEFINE_DA_EVENT(xfs_da_link_after); 1855 DEFINE_DA_EVENT(xfs_da_unlink_back); 1856 DEFINE_DA_EVENT(xfs_da_unlink_forward); 1857 DEFINE_DA_EVENT(xfs_da_root_split); 1858 DEFINE_DA_EVENT(xfs_da_root_join); 1859 DEFINE_DA_EVENT(xfs_da_node_add); 1860 DEFINE_DA_EVENT(xfs_da_node_create); 1861 DEFINE_DA_EVENT(xfs_da_node_split); 1862 DEFINE_DA_EVENT(xfs_da_node_remove); 1863 DEFINE_DA_EVENT(xfs_da_node_rebalance); 1864 DEFINE_DA_EVENT(xfs_da_node_unbalance); 1865 DEFINE_DA_EVENT(xfs_da_node_toosmall); 1866 DEFINE_DA_EVENT(xfs_da_swap_lastblock); 1867 DEFINE_DA_EVENT(xfs_da_grow_inode); 1868 DEFINE_DA_EVENT(xfs_da_shrink_inode); 1869 DEFINE_DA_EVENT(xfs_da_fixhashpath); 1870 DEFINE_DA_EVENT(xfs_da_path_shift); 1871 1872 DECLARE_EVENT_CLASS(xfs_dir2_space_class, 1873 TP_PROTO(struct xfs_da_args *args, int idx), 1874 TP_ARGS(args, idx), 1875 TP_STRUCT__entry( 1876 __field(dev_t, dev) 1877 __field(xfs_ino_t, ino) 1878 __field(int, op_flags) 1879 __field(int, idx) 1880 ), 1881 TP_fast_assign( 1882 __entry->dev = VFS_I(args->dp)->i_sb->s_dev; 1883 __entry->ino = args->dp->i_ino; 1884 __entry->op_flags = args->op_flags; 1885 __entry->idx = idx; 1886 ), 1887 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d", 1888 MAJOR(__entry->dev), MINOR(__entry->dev), 1889 __entry->ino, 1890 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), 1891 __entry->idx) 1892 ) 1893 1894 #define DEFINE_DIR2_SPACE_EVENT(name) \ 1895 DEFINE_EVENT(xfs_dir2_space_class, name, \ 1896 TP_PROTO(struct xfs_da_args *args, int idx), \ 1897 TP_ARGS(args, idx)) 1898 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add); 1899 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove); 1900 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode); 1901 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode); 1902 1903 TRACE_EVENT(xfs_dir2_leafn_moveents, 1904 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count), 1905 TP_ARGS(args, src_idx, dst_idx, count), 1906 TP_STRUCT__entry( 1907 __field(dev_t, dev) 1908 __field(xfs_ino_t, ino) 1909 __field(int, op_flags) 1910 __field(int, src_idx) 1911 __field(int, dst_idx) 1912 __field(int, count) 1913 ), 1914 TP_fast_assign( 1915 __entry->dev = VFS_I(args->dp)->i_sb->s_dev; 1916 __entry->ino = args->dp->i_ino; 1917 __entry->op_flags = args->op_flags; 1918 __entry->src_idx = src_idx; 1919 __entry->dst_idx = dst_idx; 1920 __entry->count = count; 1921 ), 1922 TP_printk("dev %d:%d ino 0x%llx op_flags %s " 1923 "src_idx %d dst_idx %d count %d", 1924 MAJOR(__entry->dev), MINOR(__entry->dev), 1925 __entry->ino, 1926 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), 1927 __entry->src_idx, 1928 __entry->dst_idx, 1929 __entry->count) 1930 ); 1931 1932 #define XFS_SWAPEXT_INODES \ 1933 { 0, "target" }, \ 1934 { 1, "temp" } 1935 1936 #define XFS_INODE_FORMAT_STR \ 1937 { 0, "invalid" }, \ 1938 { 1, "local" }, \ 1939 { 2, "extent" }, \ 1940 { 3, "btree" } 1941 1942 DECLARE_EVENT_CLASS(xfs_swap_extent_class, 1943 TP_PROTO(struct xfs_inode *ip, int which), 1944 TP_ARGS(ip, which), 1945 TP_STRUCT__entry( 1946 __field(dev_t, dev) 1947 __field(int, which) 1948 __field(xfs_ino_t, ino) 1949 __field(int, format) 1950 __field(int, nex) 1951 __field(int, broot_size) 1952 __field(int, fork_off) 1953 ), 1954 TP_fast_assign( 1955 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1956 __entry->which = which; 1957 __entry->ino = ip->i_ino; 1958 __entry->format = ip->i_d.di_format; 1959 __entry->nex = ip->i_d.di_nextents; 1960 __entry->broot_size = ip->i_df.if_broot_bytes; 1961 __entry->fork_off = XFS_IFORK_BOFF(ip); 1962 ), 1963 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, " 1964 "broot size %d, fork offset %d", 1965 MAJOR(__entry->dev), MINOR(__entry->dev), 1966 __entry->ino, 1967 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES), 1968 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR), 1969 __entry->nex, 1970 __entry->broot_size, 1971 __entry->fork_off) 1972 ) 1973 1974 #define DEFINE_SWAPEXT_EVENT(name) \ 1975 DEFINE_EVENT(xfs_swap_extent_class, name, \ 1976 TP_PROTO(struct xfs_inode *ip, int which), \ 1977 TP_ARGS(ip, which)) 1978 1979 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before); 1980 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); 1981 1982 TRACE_EVENT(xfs_log_recover_record, 1983 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass), 1984 TP_ARGS(log, rhead, pass), 1985 TP_STRUCT__entry( 1986 __field(dev_t, dev) 1987 __field(xfs_lsn_t, lsn) 1988 __field(int, len) 1989 __field(int, num_logops) 1990 __field(int, pass) 1991 ), 1992 TP_fast_assign( 1993 __entry->dev = log->l_mp->m_super->s_dev; 1994 __entry->lsn = be64_to_cpu(rhead->h_lsn); 1995 __entry->len = be32_to_cpu(rhead->h_len); 1996 __entry->num_logops = be32_to_cpu(rhead->h_num_logops); 1997 __entry->pass = pass; 1998 ), 1999 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d", 2000 MAJOR(__entry->dev), MINOR(__entry->dev), 2001 __entry->lsn, __entry->len, __entry->num_logops, 2002 __entry->pass) 2003 ) 2004 2005 DECLARE_EVENT_CLASS(xfs_log_recover_item_class, 2006 TP_PROTO(struct xlog *log, struct xlog_recover *trans, 2007 struct xlog_recover_item *item, int pass), 2008 TP_ARGS(log, trans, item, pass), 2009 TP_STRUCT__entry( 2010 __field(dev_t, dev) 2011 __field(unsigned long, item) 2012 __field(xlog_tid_t, tid) 2013 __field(xfs_lsn_t, lsn) 2014 __field(int, type) 2015 __field(int, pass) 2016 __field(int, count) 2017 __field(int, total) 2018 ), 2019 TP_fast_assign( 2020 __entry->dev = log->l_mp->m_super->s_dev; 2021 __entry->item = (unsigned long)item; 2022 __entry->tid = trans->r_log_tid; 2023 __entry->lsn = trans->r_lsn; 2024 __entry->type = ITEM_TYPE(item); 2025 __entry->pass = pass; 2026 __entry->count = item->ri_cnt; 2027 __entry->total = item->ri_total; 2028 ), 2029 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, " 2030 "item type %s item region count/total %d/%d", 2031 MAJOR(__entry->dev), MINOR(__entry->dev), 2032 __entry->tid, 2033 __entry->lsn, 2034 __entry->pass, 2035 (void *)__entry->item, 2036 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), 2037 __entry->count, 2038 __entry->total) 2039 ) 2040 2041 #define DEFINE_LOG_RECOVER_ITEM(name) \ 2042 DEFINE_EVENT(xfs_log_recover_item_class, name, \ 2043 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \ 2044 struct xlog_recover_item *item, int pass), \ 2045 TP_ARGS(log, trans, item, pass)) 2046 2047 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add); 2048 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont); 2049 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head); 2050 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail); 2051 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); 2052 2053 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, 2054 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), 2055 TP_ARGS(log, buf_f), 2056 TP_STRUCT__entry( 2057 __field(dev_t, dev) 2058 __field(__int64_t, blkno) 2059 __field(unsigned short, len) 2060 __field(unsigned short, flags) 2061 __field(unsigned short, size) 2062 __field(unsigned int, map_size) 2063 ), 2064 TP_fast_assign( 2065 __entry->dev = log->l_mp->m_super->s_dev; 2066 __entry->blkno = buf_f->blf_blkno; 2067 __entry->len = buf_f->blf_len; 2068 __entry->flags = buf_f->blf_flags; 2069 __entry->size = buf_f->blf_size; 2070 __entry->map_size = buf_f->blf_map_size; 2071 ), 2072 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, " 2073 "map_size %d", 2074 MAJOR(__entry->dev), MINOR(__entry->dev), 2075 __entry->blkno, 2076 __entry->len, 2077 __entry->flags, 2078 __entry->size, 2079 __entry->map_size) 2080 ) 2081 2082 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ 2083 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ 2084 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \ 2085 TP_ARGS(log, buf_f)) 2086 2087 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); 2088 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel); 2089 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add); 2090 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc); 2091 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover); 2092 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip); 2093 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf); 2094 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf); 2095 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); 2096 2097 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, 2098 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), 2099 TP_ARGS(log, in_f), 2100 TP_STRUCT__entry( 2101 __field(dev_t, dev) 2102 __field(xfs_ino_t, ino) 2103 __field(unsigned short, size) 2104 __field(int, fields) 2105 __field(unsigned short, asize) 2106 __field(unsigned short, dsize) 2107 __field(__int64_t, blkno) 2108 __field(int, len) 2109 __field(int, boffset) 2110 ), 2111 TP_fast_assign( 2112 __entry->dev = log->l_mp->m_super->s_dev; 2113 __entry->ino = in_f->ilf_ino; 2114 __entry->size = in_f->ilf_size; 2115 __entry->fields = in_f->ilf_fields; 2116 __entry->asize = in_f->ilf_asize; 2117 __entry->dsize = in_f->ilf_dsize; 2118 __entry->blkno = in_f->ilf_blkno; 2119 __entry->len = in_f->ilf_len; 2120 __entry->boffset = in_f->ilf_boffset; 2121 ), 2122 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, " 2123 "dsize %d, blkno 0x%llx, len %d, boffset %d", 2124 MAJOR(__entry->dev), MINOR(__entry->dev), 2125 __entry->ino, 2126 __entry->size, 2127 __entry->fields, 2128 __entry->asize, 2129 __entry->dsize, 2130 __entry->blkno, 2131 __entry->len, 2132 __entry->boffset) 2133 ) 2134 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ 2135 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ 2136 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \ 2137 TP_ARGS(log, in_f)) 2138 2139 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover); 2140 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel); 2141 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip); 2142 2143 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class, 2144 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), 2145 TP_ARGS(log, in_f), 2146 TP_STRUCT__entry( 2147 __field(dev_t, dev) 2148 __field(xfs_agnumber_t, agno) 2149 __field(xfs_agblock_t, agbno) 2150 __field(unsigned int, count) 2151 __field(unsigned int, isize) 2152 __field(xfs_agblock_t, length) 2153 __field(unsigned int, gen) 2154 ), 2155 TP_fast_assign( 2156 __entry->dev = log->l_mp->m_super->s_dev; 2157 __entry->agno = be32_to_cpu(in_f->icl_ag); 2158 __entry->agbno = be32_to_cpu(in_f->icl_agbno); 2159 __entry->count = be32_to_cpu(in_f->icl_count); 2160 __entry->isize = be32_to_cpu(in_f->icl_isize); 2161 __entry->length = be32_to_cpu(in_f->icl_length); 2162 __entry->gen = be32_to_cpu(in_f->icl_gen); 2163 ), 2164 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u " 2165 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev), 2166 __entry->agno, __entry->agbno, __entry->count, __entry->isize, 2167 __entry->length, __entry->gen) 2168 ) 2169 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \ 2170 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \ 2171 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \ 2172 TP_ARGS(log, in_f)) 2173 2174 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel); 2175 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover); 2176 2177 DECLARE_EVENT_CLASS(xfs_discard_class, 2178 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2179 xfs_agblock_t agbno, xfs_extlen_t len), 2180 TP_ARGS(mp, agno, agbno, len), 2181 TP_STRUCT__entry( 2182 __field(dev_t, dev) 2183 __field(xfs_agnumber_t, agno) 2184 __field(xfs_agblock_t, agbno) 2185 __field(xfs_extlen_t, len) 2186 ), 2187 TP_fast_assign( 2188 __entry->dev = mp->m_super->s_dev; 2189 __entry->agno = agno; 2190 __entry->agbno = agbno; 2191 __entry->len = len; 2192 ), 2193 TP_printk("dev %d:%d agno %u agbno %u len %u\n", 2194 MAJOR(__entry->dev), MINOR(__entry->dev), 2195 __entry->agno, 2196 __entry->agbno, 2197 __entry->len) 2198 ) 2199 2200 #define DEFINE_DISCARD_EVENT(name) \ 2201 DEFINE_EVENT(xfs_discard_class, name, \ 2202 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2203 xfs_agblock_t agbno, xfs_extlen_t len), \ 2204 TP_ARGS(mp, agno, agbno, len)) 2205 DEFINE_DISCARD_EVENT(xfs_discard_extent); 2206 DEFINE_DISCARD_EVENT(xfs_discard_toosmall); 2207 DEFINE_DISCARD_EVENT(xfs_discard_exclude); 2208 DEFINE_DISCARD_EVENT(xfs_discard_busy); 2209 2210 /* btree cursor events */ 2211 DECLARE_EVENT_CLASS(xfs_btree_cur_class, 2212 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), 2213 TP_ARGS(cur, level, bp), 2214 TP_STRUCT__entry( 2215 __field(dev_t, dev) 2216 __field(xfs_btnum_t, btnum) 2217 __field(int, level) 2218 __field(int, nlevels) 2219 __field(int, ptr) 2220 __field(xfs_daddr_t, daddr) 2221 ), 2222 TP_fast_assign( 2223 __entry->dev = cur->bc_mp->m_super->s_dev; 2224 __entry->btnum = cur->bc_btnum; 2225 __entry->level = level; 2226 __entry->nlevels = cur->bc_nlevels; 2227 __entry->ptr = cur->bc_ptrs[level]; 2228 __entry->daddr = bp ? bp->b_bn : -1; 2229 ), 2230 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx", 2231 MAJOR(__entry->dev), MINOR(__entry->dev), 2232 __entry->btnum, 2233 __entry->level, 2234 __entry->nlevels, 2235 __entry->ptr, 2236 (unsigned long long)__entry->daddr) 2237 ) 2238 2239 #define DEFINE_BTREE_CUR_EVENT(name) \ 2240 DEFINE_EVENT(xfs_btree_cur_class, name, \ 2241 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \ 2242 TP_ARGS(cur, level, bp)) 2243 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys); 2244 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range); 2245 2246 /* deferred ops */ 2247 struct xfs_defer_pending; 2248 struct xfs_defer_intake; 2249 struct xfs_defer_ops; 2250 2251 DECLARE_EVENT_CLASS(xfs_defer_class, 2252 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), 2253 TP_ARGS(mp, dop), 2254 TP_STRUCT__entry( 2255 __field(dev_t, dev) 2256 __field(void *, dop) 2257 __field(bool, committed) 2258 __field(bool, low) 2259 ), 2260 TP_fast_assign( 2261 __entry->dev = mp ? mp->m_super->s_dev : 0; 2262 __entry->dop = dop; 2263 __entry->committed = dop->dop_committed; 2264 __entry->low = dop->dop_low; 2265 ), 2266 TP_printk("dev %d:%d ops %p committed %d low %d\n", 2267 MAJOR(__entry->dev), MINOR(__entry->dev), 2268 __entry->dop, 2269 __entry->committed, 2270 __entry->low) 2271 ) 2272 #define DEFINE_DEFER_EVENT(name) \ 2273 DEFINE_EVENT(xfs_defer_class, name, \ 2274 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \ 2275 TP_ARGS(mp, dop)) 2276 2277 DECLARE_EVENT_CLASS(xfs_defer_error_class, 2278 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), 2279 TP_ARGS(mp, dop, error), 2280 TP_STRUCT__entry( 2281 __field(dev_t, dev) 2282 __field(void *, dop) 2283 __field(bool, committed) 2284 __field(bool, low) 2285 __field(int, error) 2286 ), 2287 TP_fast_assign( 2288 __entry->dev = mp ? mp->m_super->s_dev : 0; 2289 __entry->dop = dop; 2290 __entry->committed = dop->dop_committed; 2291 __entry->low = dop->dop_low; 2292 __entry->error = error; 2293 ), 2294 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n", 2295 MAJOR(__entry->dev), MINOR(__entry->dev), 2296 __entry->dop, 2297 __entry->committed, 2298 __entry->low, 2299 __entry->error) 2300 ) 2301 #define DEFINE_DEFER_ERROR_EVENT(name) \ 2302 DEFINE_EVENT(xfs_defer_error_class, name, \ 2303 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \ 2304 TP_ARGS(mp, dop, error)) 2305 2306 DECLARE_EVENT_CLASS(xfs_defer_pending_class, 2307 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), 2308 TP_ARGS(mp, dfp), 2309 TP_STRUCT__entry( 2310 __field(dev_t, dev) 2311 __field(int, type) 2312 __field(void *, intent) 2313 __field(bool, committed) 2314 __field(int, nr) 2315 ), 2316 TP_fast_assign( 2317 __entry->dev = mp ? mp->m_super->s_dev : 0; 2318 __entry->type = dfp->dfp_type->type; 2319 __entry->intent = dfp->dfp_intent; 2320 __entry->committed = dfp->dfp_done != NULL; 2321 __entry->nr = dfp->dfp_count; 2322 ), 2323 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n", 2324 MAJOR(__entry->dev), MINOR(__entry->dev), 2325 __entry->type, 2326 __entry->intent, 2327 __entry->committed, 2328 __entry->nr) 2329 ) 2330 #define DEFINE_DEFER_PENDING_EVENT(name) \ 2331 DEFINE_EVENT(xfs_defer_pending_class, name, \ 2332 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \ 2333 TP_ARGS(mp, dfp)) 2334 2335 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class, 2336 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2337 int type, xfs_agblock_t agbno, xfs_extlen_t len), 2338 TP_ARGS(mp, agno, type, agbno, len), 2339 TP_STRUCT__entry( 2340 __field(dev_t, dev) 2341 __field(xfs_agnumber_t, agno) 2342 __field(int, type) 2343 __field(xfs_agblock_t, agbno) 2344 __field(xfs_extlen_t, len) 2345 ), 2346 TP_fast_assign( 2347 __entry->dev = mp->m_super->s_dev; 2348 __entry->agno = agno; 2349 __entry->type = type; 2350 __entry->agbno = agbno; 2351 __entry->len = len; 2352 ), 2353 TP_printk("dev %d:%d op %d agno %u agbno %u len %u", 2354 MAJOR(__entry->dev), MINOR(__entry->dev), 2355 __entry->type, 2356 __entry->agno, 2357 __entry->agbno, 2358 __entry->len) 2359 ); 2360 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \ 2361 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \ 2362 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2363 int type, \ 2364 xfs_agblock_t bno, \ 2365 xfs_extlen_t len), \ 2366 TP_ARGS(mp, agno, type, bno, len)) 2367 2368 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class, 2369 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2370 int op, 2371 xfs_agblock_t agbno, 2372 xfs_ino_t ino, 2373 int whichfork, 2374 xfs_fileoff_t offset, 2375 xfs_filblks_t len, 2376 xfs_exntst_t state), 2377 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state), 2378 TP_STRUCT__entry( 2379 __field(dev_t, dev) 2380 __field(xfs_agnumber_t, agno) 2381 __field(xfs_ino_t, ino) 2382 __field(xfs_agblock_t, agbno) 2383 __field(int, whichfork) 2384 __field(xfs_fileoff_t, l_loff) 2385 __field(xfs_filblks_t, l_len) 2386 __field(xfs_exntst_t, l_state) 2387 __field(int, op) 2388 ), 2389 TP_fast_assign( 2390 __entry->dev = mp->m_super->s_dev; 2391 __entry->agno = agno; 2392 __entry->ino = ino; 2393 __entry->agbno = agbno; 2394 __entry->whichfork = whichfork; 2395 __entry->l_loff = offset; 2396 __entry->l_len = len; 2397 __entry->l_state = state; 2398 __entry->op = op; 2399 ), 2400 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d", 2401 MAJOR(__entry->dev), MINOR(__entry->dev), 2402 __entry->op, 2403 __entry->agno, 2404 __entry->agbno, 2405 __entry->ino, 2406 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data", 2407 __entry->l_loff, 2408 __entry->l_len, 2409 __entry->l_state) 2410 ); 2411 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \ 2412 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \ 2413 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2414 int op, \ 2415 xfs_agblock_t agbno, \ 2416 xfs_ino_t ino, \ 2417 int whichfork, \ 2418 xfs_fileoff_t offset, \ 2419 xfs_filblks_t len, \ 2420 xfs_exntst_t state), \ 2421 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state)) 2422 2423 DEFINE_DEFER_EVENT(xfs_defer_init); 2424 DEFINE_DEFER_EVENT(xfs_defer_cancel); 2425 DEFINE_DEFER_EVENT(xfs_defer_trans_roll); 2426 DEFINE_DEFER_EVENT(xfs_defer_trans_abort); 2427 DEFINE_DEFER_EVENT(xfs_defer_finish); 2428 DEFINE_DEFER_EVENT(xfs_defer_finish_done); 2429 2430 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error); 2431 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error); 2432 2433 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work); 2434 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel); 2435 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel); 2436 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish); 2437 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort); 2438 2439 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT 2440 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer); 2441 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred); 2442 2443 /* rmap tracepoints */ 2444 DECLARE_EVENT_CLASS(xfs_rmap_class, 2445 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2446 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, 2447 struct xfs_owner_info *oinfo), 2448 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo), 2449 TP_STRUCT__entry( 2450 __field(dev_t, dev) 2451 __field(xfs_agnumber_t, agno) 2452 __field(xfs_agblock_t, agbno) 2453 __field(xfs_extlen_t, len) 2454 __field(uint64_t, owner) 2455 __field(uint64_t, offset) 2456 __field(unsigned long, flags) 2457 ), 2458 TP_fast_assign( 2459 __entry->dev = mp->m_super->s_dev; 2460 __entry->agno = agno; 2461 __entry->agbno = agbno; 2462 __entry->len = len; 2463 __entry->owner = oinfo->oi_owner; 2464 __entry->offset = oinfo->oi_offset; 2465 __entry->flags = oinfo->oi_flags; 2466 if (unwritten) 2467 __entry->flags |= XFS_RMAP_UNWRITTEN; 2468 ), 2469 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx", 2470 MAJOR(__entry->dev), MINOR(__entry->dev), 2471 __entry->agno, 2472 __entry->agbno, 2473 __entry->len, 2474 __entry->owner, 2475 __entry->offset, 2476 __entry->flags) 2477 ); 2478 #define DEFINE_RMAP_EVENT(name) \ 2479 DEFINE_EVENT(xfs_rmap_class, name, \ 2480 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2481 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \ 2482 struct xfs_owner_info *oinfo), \ 2483 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo)) 2484 2485 /* simple AG-based error/%ip tracepoint class */ 2486 DECLARE_EVENT_CLASS(xfs_ag_error_class, 2487 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, 2488 unsigned long caller_ip), 2489 TP_ARGS(mp, agno, error, caller_ip), 2490 TP_STRUCT__entry( 2491 __field(dev_t, dev) 2492 __field(xfs_agnumber_t, agno) 2493 __field(int, error) 2494 __field(unsigned long, caller_ip) 2495 ), 2496 TP_fast_assign( 2497 __entry->dev = mp->m_super->s_dev; 2498 __entry->agno = agno; 2499 __entry->error = error; 2500 __entry->caller_ip = caller_ip; 2501 ), 2502 TP_printk("dev %d:%d agno %u error %d caller %ps", 2503 MAJOR(__entry->dev), MINOR(__entry->dev), 2504 __entry->agno, 2505 __entry->error, 2506 (char *)__entry->caller_ip) 2507 ); 2508 2509 #define DEFINE_AG_ERROR_EVENT(name) \ 2510 DEFINE_EVENT(xfs_ag_error_class, name, \ 2511 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \ 2512 unsigned long caller_ip), \ 2513 TP_ARGS(mp, agno, error, caller_ip)) 2514 2515 DEFINE_RMAP_EVENT(xfs_rmap_unmap); 2516 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done); 2517 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error); 2518 DEFINE_RMAP_EVENT(xfs_rmap_map); 2519 DEFINE_RMAP_EVENT(xfs_rmap_map_done); 2520 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error); 2521 DEFINE_RMAP_EVENT(xfs_rmap_convert); 2522 DEFINE_RMAP_EVENT(xfs_rmap_convert_done); 2523 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error); 2524 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state); 2525 2526 DECLARE_EVENT_CLASS(xfs_rmapbt_class, 2527 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2528 xfs_agblock_t agbno, xfs_extlen_t len, 2529 uint64_t owner, uint64_t offset, unsigned int flags), 2530 TP_ARGS(mp, agno, agbno, len, owner, offset, flags), 2531 TP_STRUCT__entry( 2532 __field(dev_t, dev) 2533 __field(xfs_agnumber_t, agno) 2534 __field(xfs_agblock_t, agbno) 2535 __field(xfs_extlen_t, len) 2536 __field(uint64_t, owner) 2537 __field(uint64_t, offset) 2538 __field(unsigned int, flags) 2539 ), 2540 TP_fast_assign( 2541 __entry->dev = mp->m_super->s_dev; 2542 __entry->agno = agno; 2543 __entry->agbno = agbno; 2544 __entry->len = len; 2545 __entry->owner = owner; 2546 __entry->offset = offset; 2547 __entry->flags = flags; 2548 ), 2549 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x", 2550 MAJOR(__entry->dev), MINOR(__entry->dev), 2551 __entry->agno, 2552 __entry->agbno, 2553 __entry->len, 2554 __entry->owner, 2555 __entry->offset, 2556 __entry->flags) 2557 ); 2558 #define DEFINE_RMAPBT_EVENT(name) \ 2559 DEFINE_EVENT(xfs_rmapbt_class, name, \ 2560 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2561 xfs_agblock_t agbno, xfs_extlen_t len, \ 2562 uint64_t owner, uint64_t offset, unsigned int flags), \ 2563 TP_ARGS(mp, agno, agbno, len, owner, offset, flags)) 2564 2565 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT 2566 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer); 2567 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred); 2568 2569 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block); 2570 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block); 2571 DEFINE_RMAPBT_EVENT(xfs_rmap_update); 2572 DEFINE_RMAPBT_EVENT(xfs_rmap_insert); 2573 DEFINE_RMAPBT_EVENT(xfs_rmap_delete); 2574 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error); 2575 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error); 2576 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error); 2577 2578 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate); 2579 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query); 2580 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate); 2581 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range); 2582 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result); 2583 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result); 2584 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result); 2585 2586 /* deferred bmbt updates */ 2587 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT 2588 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer); 2589 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred); 2590 2591 /* per-AG reservation */ 2592 DECLARE_EVENT_CLASS(xfs_ag_resv_class, 2593 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv, 2594 xfs_extlen_t len), 2595 TP_ARGS(pag, resv, len), 2596 TP_STRUCT__entry( 2597 __field(dev_t, dev) 2598 __field(xfs_agnumber_t, agno) 2599 __field(int, resv) 2600 __field(xfs_extlen_t, freeblks) 2601 __field(xfs_extlen_t, flcount) 2602 __field(xfs_extlen_t, reserved) 2603 __field(xfs_extlen_t, asked) 2604 __field(xfs_extlen_t, len) 2605 ), 2606 TP_fast_assign( 2607 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv); 2608 2609 __entry->dev = pag->pag_mount->m_super->s_dev; 2610 __entry->agno = pag->pag_agno; 2611 __entry->resv = resv; 2612 __entry->freeblks = pag->pagf_freeblks; 2613 __entry->flcount = pag->pagf_flcount; 2614 __entry->reserved = r ? r->ar_reserved : 0; 2615 __entry->asked = r ? r->ar_asked : 0; 2616 __entry->len = len; 2617 ), 2618 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u resv %u ask %u len %u\n", 2619 MAJOR(__entry->dev), MINOR(__entry->dev), 2620 __entry->agno, 2621 __entry->resv, 2622 __entry->freeblks, 2623 __entry->flcount, 2624 __entry->reserved, 2625 __entry->asked, 2626 __entry->len) 2627 ) 2628 #define DEFINE_AG_RESV_EVENT(name) \ 2629 DEFINE_EVENT(xfs_ag_resv_class, name, \ 2630 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \ 2631 xfs_extlen_t len), \ 2632 TP_ARGS(pag, type, len)) 2633 2634 /* per-AG reservation tracepoints */ 2635 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init); 2636 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free); 2637 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent); 2638 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent); 2639 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical); 2640 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed); 2641 2642 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error); 2643 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error); 2644 2645 /* refcount tracepoint classes */ 2646 2647 /* reuse the discard trace class for agbno/aglen-based traces */ 2648 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name) 2649 2650 /* ag btree lookup tracepoint class */ 2651 #define XFS_AG_BTREE_CMP_FORMAT_STR \ 2652 { XFS_LOOKUP_EQ, "eq" }, \ 2653 { XFS_LOOKUP_LE, "le" }, \ 2654 { XFS_LOOKUP_GE, "ge" } 2655 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class, 2656 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2657 xfs_agblock_t agbno, xfs_lookup_t dir), 2658 TP_ARGS(mp, agno, agbno, dir), 2659 TP_STRUCT__entry( 2660 __field(dev_t, dev) 2661 __field(xfs_agnumber_t, agno) 2662 __field(xfs_agblock_t, agbno) 2663 __field(xfs_lookup_t, dir) 2664 ), 2665 TP_fast_assign( 2666 __entry->dev = mp->m_super->s_dev; 2667 __entry->agno = agno; 2668 __entry->agbno = agbno; 2669 __entry->dir = dir; 2670 ), 2671 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)\n", 2672 MAJOR(__entry->dev), MINOR(__entry->dev), 2673 __entry->agno, 2674 __entry->agbno, 2675 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR), 2676 __entry->dir) 2677 ) 2678 2679 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \ 2680 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \ 2681 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2682 xfs_agblock_t agbno, xfs_lookup_t dir), \ 2683 TP_ARGS(mp, agno, agbno, dir)) 2684 2685 /* single-rcext tracepoint class */ 2686 DECLARE_EVENT_CLASS(xfs_refcount_extent_class, 2687 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2688 struct xfs_refcount_irec *irec), 2689 TP_ARGS(mp, agno, irec), 2690 TP_STRUCT__entry( 2691 __field(dev_t, dev) 2692 __field(xfs_agnumber_t, agno) 2693 __field(xfs_agblock_t, startblock) 2694 __field(xfs_extlen_t, blockcount) 2695 __field(xfs_nlink_t, refcount) 2696 ), 2697 TP_fast_assign( 2698 __entry->dev = mp->m_super->s_dev; 2699 __entry->agno = agno; 2700 __entry->startblock = irec->rc_startblock; 2701 __entry->blockcount = irec->rc_blockcount; 2702 __entry->refcount = irec->rc_refcount; 2703 ), 2704 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u\n", 2705 MAJOR(__entry->dev), MINOR(__entry->dev), 2706 __entry->agno, 2707 __entry->startblock, 2708 __entry->blockcount, 2709 __entry->refcount) 2710 ) 2711 2712 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \ 2713 DEFINE_EVENT(xfs_refcount_extent_class, name, \ 2714 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2715 struct xfs_refcount_irec *irec), \ 2716 TP_ARGS(mp, agno, irec)) 2717 2718 /* single-rcext and an agbno tracepoint class */ 2719 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class, 2720 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2721 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), 2722 TP_ARGS(mp, agno, irec, agbno), 2723 TP_STRUCT__entry( 2724 __field(dev_t, dev) 2725 __field(xfs_agnumber_t, agno) 2726 __field(xfs_agblock_t, startblock) 2727 __field(xfs_extlen_t, blockcount) 2728 __field(xfs_nlink_t, refcount) 2729 __field(xfs_agblock_t, agbno) 2730 ), 2731 TP_fast_assign( 2732 __entry->dev = mp->m_super->s_dev; 2733 __entry->agno = agno; 2734 __entry->startblock = irec->rc_startblock; 2735 __entry->blockcount = irec->rc_blockcount; 2736 __entry->refcount = irec->rc_refcount; 2737 __entry->agbno = agbno; 2738 ), 2739 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u\n", 2740 MAJOR(__entry->dev), MINOR(__entry->dev), 2741 __entry->agno, 2742 __entry->startblock, 2743 __entry->blockcount, 2744 __entry->refcount, 2745 __entry->agbno) 2746 ) 2747 2748 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \ 2749 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \ 2750 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2751 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \ 2752 TP_ARGS(mp, agno, irec, agbno)) 2753 2754 /* double-rcext tracepoint class */ 2755 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class, 2756 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2757 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), 2758 TP_ARGS(mp, agno, i1, i2), 2759 TP_STRUCT__entry( 2760 __field(dev_t, dev) 2761 __field(xfs_agnumber_t, agno) 2762 __field(xfs_agblock_t, i1_startblock) 2763 __field(xfs_extlen_t, i1_blockcount) 2764 __field(xfs_nlink_t, i1_refcount) 2765 __field(xfs_agblock_t, i2_startblock) 2766 __field(xfs_extlen_t, i2_blockcount) 2767 __field(xfs_nlink_t, i2_refcount) 2768 ), 2769 TP_fast_assign( 2770 __entry->dev = mp->m_super->s_dev; 2771 __entry->agno = agno; 2772 __entry->i1_startblock = i1->rc_startblock; 2773 __entry->i1_blockcount = i1->rc_blockcount; 2774 __entry->i1_refcount = i1->rc_refcount; 2775 __entry->i2_startblock = i2->rc_startblock; 2776 __entry->i2_blockcount = i2->rc_blockcount; 2777 __entry->i2_refcount = i2->rc_refcount; 2778 ), 2779 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " 2780 "agbno %u len %u refcount %u\n", 2781 MAJOR(__entry->dev), MINOR(__entry->dev), 2782 __entry->agno, 2783 __entry->i1_startblock, 2784 __entry->i1_blockcount, 2785 __entry->i1_refcount, 2786 __entry->i2_startblock, 2787 __entry->i2_blockcount, 2788 __entry->i2_refcount) 2789 ) 2790 2791 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \ 2792 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \ 2793 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2794 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \ 2795 TP_ARGS(mp, agno, i1, i2)) 2796 2797 /* double-rcext and an agbno tracepoint class */ 2798 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class, 2799 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2800 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, 2801 xfs_agblock_t agbno), 2802 TP_ARGS(mp, agno, i1, i2, agbno), 2803 TP_STRUCT__entry( 2804 __field(dev_t, dev) 2805 __field(xfs_agnumber_t, agno) 2806 __field(xfs_agblock_t, i1_startblock) 2807 __field(xfs_extlen_t, i1_blockcount) 2808 __field(xfs_nlink_t, i1_refcount) 2809 __field(xfs_agblock_t, i2_startblock) 2810 __field(xfs_extlen_t, i2_blockcount) 2811 __field(xfs_nlink_t, i2_refcount) 2812 __field(xfs_agblock_t, agbno) 2813 ), 2814 TP_fast_assign( 2815 __entry->dev = mp->m_super->s_dev; 2816 __entry->agno = agno; 2817 __entry->i1_startblock = i1->rc_startblock; 2818 __entry->i1_blockcount = i1->rc_blockcount; 2819 __entry->i1_refcount = i1->rc_refcount; 2820 __entry->i2_startblock = i2->rc_startblock; 2821 __entry->i2_blockcount = i2->rc_blockcount; 2822 __entry->i2_refcount = i2->rc_refcount; 2823 __entry->agbno = agbno; 2824 ), 2825 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " 2826 "agbno %u len %u refcount %u @ agbno %u\n", 2827 MAJOR(__entry->dev), MINOR(__entry->dev), 2828 __entry->agno, 2829 __entry->i1_startblock, 2830 __entry->i1_blockcount, 2831 __entry->i1_refcount, 2832 __entry->i2_startblock, 2833 __entry->i2_blockcount, 2834 __entry->i2_refcount, 2835 __entry->agbno) 2836 ) 2837 2838 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \ 2839 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \ 2840 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2841 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ 2842 xfs_agblock_t agbno), \ 2843 TP_ARGS(mp, agno, i1, i2, agbno)) 2844 2845 /* triple-rcext tracepoint class */ 2846 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class, 2847 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2848 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, 2849 struct xfs_refcount_irec *i3), 2850 TP_ARGS(mp, agno, i1, i2, i3), 2851 TP_STRUCT__entry( 2852 __field(dev_t, dev) 2853 __field(xfs_agnumber_t, agno) 2854 __field(xfs_agblock_t, i1_startblock) 2855 __field(xfs_extlen_t, i1_blockcount) 2856 __field(xfs_nlink_t, i1_refcount) 2857 __field(xfs_agblock_t, i2_startblock) 2858 __field(xfs_extlen_t, i2_blockcount) 2859 __field(xfs_nlink_t, i2_refcount) 2860 __field(xfs_agblock_t, i3_startblock) 2861 __field(xfs_extlen_t, i3_blockcount) 2862 __field(xfs_nlink_t, i3_refcount) 2863 ), 2864 TP_fast_assign( 2865 __entry->dev = mp->m_super->s_dev; 2866 __entry->agno = agno; 2867 __entry->i1_startblock = i1->rc_startblock; 2868 __entry->i1_blockcount = i1->rc_blockcount; 2869 __entry->i1_refcount = i1->rc_refcount; 2870 __entry->i2_startblock = i2->rc_startblock; 2871 __entry->i2_blockcount = i2->rc_blockcount; 2872 __entry->i2_refcount = i2->rc_refcount; 2873 __entry->i3_startblock = i3->rc_startblock; 2874 __entry->i3_blockcount = i3->rc_blockcount; 2875 __entry->i3_refcount = i3->rc_refcount; 2876 ), 2877 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " 2878 "agbno %u len %u refcount %u -- " 2879 "agbno %u len %u refcount %u\n", 2880 MAJOR(__entry->dev), MINOR(__entry->dev), 2881 __entry->agno, 2882 __entry->i1_startblock, 2883 __entry->i1_blockcount, 2884 __entry->i1_refcount, 2885 __entry->i2_startblock, 2886 __entry->i2_blockcount, 2887 __entry->i2_refcount, 2888 __entry->i3_startblock, 2889 __entry->i3_blockcount, 2890 __entry->i3_refcount) 2891 ); 2892 2893 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \ 2894 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \ 2895 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 2896 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ 2897 struct xfs_refcount_irec *i3), \ 2898 TP_ARGS(mp, agno, i1, i2, i3)) 2899 2900 /* refcount btree tracepoints */ 2901 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block); 2902 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block); 2903 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup); 2904 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get); 2905 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update); 2906 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert); 2907 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete); 2908 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error); 2909 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error); 2910 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error); 2911 2912 /* refcount adjustment tracepoints */ 2913 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase); 2914 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease); 2915 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase); 2916 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease); 2917 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents); 2918 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent); 2919 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent); 2920 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent); 2921 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent); 2922 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent); 2923 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent); 2924 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent); 2925 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error); 2926 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error); 2927 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error); 2928 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error); 2929 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error); 2930 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error); 2931 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error); 2932 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error); 2933 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error); 2934 2935 /* reflink helpers */ 2936 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared); 2937 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result); 2938 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error); 2939 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT 2940 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer); 2941 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred); 2942 2943 TRACE_EVENT(xfs_refcount_finish_one_leftover, 2944 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 2945 int type, xfs_agblock_t agbno, xfs_extlen_t len, 2946 xfs_agblock_t new_agbno, xfs_extlen_t new_len), 2947 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len), 2948 TP_STRUCT__entry( 2949 __field(dev_t, dev) 2950 __field(xfs_agnumber_t, agno) 2951 __field(int, type) 2952 __field(xfs_agblock_t, agbno) 2953 __field(xfs_extlen_t, len) 2954 __field(xfs_agblock_t, new_agbno) 2955 __field(xfs_extlen_t, new_len) 2956 ), 2957 TP_fast_assign( 2958 __entry->dev = mp->m_super->s_dev; 2959 __entry->agno = agno; 2960 __entry->type = type; 2961 __entry->agbno = agbno; 2962 __entry->len = len; 2963 __entry->new_agbno = new_agbno; 2964 __entry->new_len = new_len; 2965 ), 2966 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u", 2967 MAJOR(__entry->dev), MINOR(__entry->dev), 2968 __entry->type, 2969 __entry->agno, 2970 __entry->agbno, 2971 __entry->len, 2972 __entry->new_agbno, 2973 __entry->new_len) 2974 ); 2975 2976 /* simple inode-based error/%ip tracepoint class */ 2977 DECLARE_EVENT_CLASS(xfs_inode_error_class, 2978 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip), 2979 TP_ARGS(ip, error, caller_ip), 2980 TP_STRUCT__entry( 2981 __field(dev_t, dev) 2982 __field(xfs_ino_t, ino) 2983 __field(int, error) 2984 __field(unsigned long, caller_ip) 2985 ), 2986 TP_fast_assign( 2987 __entry->dev = VFS_I(ip)->i_sb->s_dev; 2988 __entry->ino = ip->i_ino; 2989 __entry->error = error; 2990 __entry->caller_ip = caller_ip; 2991 ), 2992 TP_printk("dev %d:%d ino %llx error %d caller %ps", 2993 MAJOR(__entry->dev), MINOR(__entry->dev), 2994 __entry->ino, 2995 __entry->error, 2996 (char *)__entry->caller_ip) 2997 ); 2998 2999 #define DEFINE_INODE_ERROR_EVENT(name) \ 3000 DEFINE_EVENT(xfs_inode_error_class, name, \ 3001 TP_PROTO(struct xfs_inode *ip, int error, \ 3002 unsigned long caller_ip), \ 3003 TP_ARGS(ip, error, caller_ip)) 3004 3005 /* reflink allocator */ 3006 TRACE_EVENT(xfs_bmap_remap_alloc, 3007 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t fsbno, 3008 xfs_extlen_t len), 3009 TP_ARGS(ip, fsbno, len), 3010 TP_STRUCT__entry( 3011 __field(dev_t, dev) 3012 __field(xfs_ino_t, ino) 3013 __field(xfs_fsblock_t, fsbno) 3014 __field(xfs_extlen_t, len) 3015 ), 3016 TP_fast_assign( 3017 __entry->dev = VFS_I(ip)->i_sb->s_dev; 3018 __entry->ino = ip->i_ino; 3019 __entry->fsbno = fsbno; 3020 __entry->len = len; 3021 ), 3022 TP_printk("dev %d:%d ino 0x%llx fsbno 0x%llx len %x", 3023 MAJOR(__entry->dev), MINOR(__entry->dev), 3024 __entry->ino, 3025 __entry->fsbno, 3026 __entry->len) 3027 ); 3028 DEFINE_INODE_ERROR_EVENT(xfs_bmap_remap_alloc_error); 3029 3030 /* reflink tracepoint classes */ 3031 3032 /* two-file io tracepoint class */ 3033 DECLARE_EVENT_CLASS(xfs_double_io_class, 3034 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, 3035 struct xfs_inode *dest, xfs_off_t doffset), 3036 TP_ARGS(src, soffset, len, dest, doffset), 3037 TP_STRUCT__entry( 3038 __field(dev_t, dev) 3039 __field(xfs_ino_t, src_ino) 3040 __field(loff_t, src_isize) 3041 __field(loff_t, src_disize) 3042 __field(loff_t, src_offset) 3043 __field(size_t, len) 3044 __field(xfs_ino_t, dest_ino) 3045 __field(loff_t, dest_isize) 3046 __field(loff_t, dest_disize) 3047 __field(loff_t, dest_offset) 3048 ), 3049 TP_fast_assign( 3050 __entry->dev = VFS_I(src)->i_sb->s_dev; 3051 __entry->src_ino = src->i_ino; 3052 __entry->src_isize = VFS_I(src)->i_size; 3053 __entry->src_disize = src->i_d.di_size; 3054 __entry->src_offset = soffset; 3055 __entry->len = len; 3056 __entry->dest_ino = dest->i_ino; 3057 __entry->dest_isize = VFS_I(dest)->i_size; 3058 __entry->dest_disize = dest->i_d.di_size; 3059 __entry->dest_offset = doffset; 3060 ), 3061 TP_printk("dev %d:%d count %zd " 3062 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> " 3063 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx", 3064 MAJOR(__entry->dev), MINOR(__entry->dev), 3065 __entry->len, 3066 __entry->src_ino, 3067 __entry->src_isize, 3068 __entry->src_disize, 3069 __entry->src_offset, 3070 __entry->dest_ino, 3071 __entry->dest_isize, 3072 __entry->dest_disize, 3073 __entry->dest_offset) 3074 ) 3075 3076 #define DEFINE_DOUBLE_IO_EVENT(name) \ 3077 DEFINE_EVENT(xfs_double_io_class, name, \ 3078 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \ 3079 struct xfs_inode *dest, xfs_off_t doffset), \ 3080 TP_ARGS(src, soffset, len, dest, doffset)) 3081 3082 /* inode/irec events */ 3083 DECLARE_EVENT_CLASS(xfs_inode_irec_class, 3084 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), 3085 TP_ARGS(ip, irec), 3086 TP_STRUCT__entry( 3087 __field(dev_t, dev) 3088 __field(xfs_ino_t, ino) 3089 __field(xfs_fileoff_t, lblk) 3090 __field(xfs_extlen_t, len) 3091 __field(xfs_fsblock_t, pblk) 3092 ), 3093 TP_fast_assign( 3094 __entry->dev = VFS_I(ip)->i_sb->s_dev; 3095 __entry->ino = ip->i_ino; 3096 __entry->lblk = irec->br_startoff; 3097 __entry->len = irec->br_blockcount; 3098 __entry->pblk = irec->br_startblock; 3099 ), 3100 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu", 3101 MAJOR(__entry->dev), MINOR(__entry->dev), 3102 __entry->ino, 3103 __entry->lblk, 3104 __entry->len, 3105 __entry->pblk) 3106 ); 3107 #define DEFINE_INODE_IREC_EVENT(name) \ 3108 DEFINE_EVENT(xfs_inode_irec_class, name, \ 3109 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \ 3110 TP_ARGS(ip, irec)) 3111 3112 /* refcount/reflink tracepoint definitions */ 3113 3114 /* reflink tracepoints */ 3115 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag); 3116 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag); 3117 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size); 3118 DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap); 3119 TRACE_EVENT(xfs_reflink_remap_blocks_loop, 3120 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset, 3121 xfs_filblks_t len, struct xfs_inode *dest, 3122 xfs_fileoff_t doffset), 3123 TP_ARGS(src, soffset, len, dest, doffset), 3124 TP_STRUCT__entry( 3125 __field(dev_t, dev) 3126 __field(xfs_ino_t, src_ino) 3127 __field(xfs_fileoff_t, src_lblk) 3128 __field(xfs_filblks_t, len) 3129 __field(xfs_ino_t, dest_ino) 3130 __field(xfs_fileoff_t, dest_lblk) 3131 ), 3132 TP_fast_assign( 3133 __entry->dev = VFS_I(src)->i_sb->s_dev; 3134 __entry->src_ino = src->i_ino; 3135 __entry->src_lblk = soffset; 3136 __entry->len = len; 3137 __entry->dest_ino = dest->i_ino; 3138 __entry->dest_lblk = doffset; 3139 ), 3140 TP_printk("dev %d:%d len 0x%llx " 3141 "ino 0x%llx offset 0x%llx blocks -> " 3142 "ino 0x%llx offset 0x%llx blocks", 3143 MAJOR(__entry->dev), MINOR(__entry->dev), 3144 __entry->len, 3145 __entry->src_ino, 3146 __entry->src_lblk, 3147 __entry->dest_ino, 3148 __entry->dest_lblk) 3149 ); 3150 TRACE_EVENT(xfs_reflink_punch_range, 3151 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, 3152 xfs_extlen_t len), 3153 TP_ARGS(ip, lblk, len), 3154 TP_STRUCT__entry( 3155 __field(dev_t, dev) 3156 __field(xfs_ino_t, ino) 3157 __field(xfs_fileoff_t, lblk) 3158 __field(xfs_extlen_t, len) 3159 ), 3160 TP_fast_assign( 3161 __entry->dev = VFS_I(ip)->i_sb->s_dev; 3162 __entry->ino = ip->i_ino; 3163 __entry->lblk = lblk; 3164 __entry->len = len; 3165 ), 3166 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x", 3167 MAJOR(__entry->dev), MINOR(__entry->dev), 3168 __entry->ino, 3169 __entry->lblk, 3170 __entry->len) 3171 ); 3172 TRACE_EVENT(xfs_reflink_remap, 3173 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, 3174 xfs_extlen_t len, xfs_fsblock_t new_pblk), 3175 TP_ARGS(ip, lblk, len, new_pblk), 3176 TP_STRUCT__entry( 3177 __field(dev_t, dev) 3178 __field(xfs_ino_t, ino) 3179 __field(xfs_fileoff_t, lblk) 3180 __field(xfs_extlen_t, len) 3181 __field(xfs_fsblock_t, new_pblk) 3182 ), 3183 TP_fast_assign( 3184 __entry->dev = VFS_I(ip)->i_sb->s_dev; 3185 __entry->ino = ip->i_ino; 3186 __entry->lblk = lblk; 3187 __entry->len = len; 3188 __entry->new_pblk = new_pblk; 3189 ), 3190 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu", 3191 MAJOR(__entry->dev), MINOR(__entry->dev), 3192 __entry->ino, 3193 __entry->lblk, 3194 __entry->len, 3195 __entry->new_pblk) 3196 ); 3197 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range); 3198 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error); 3199 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error); 3200 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error); 3201 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error); 3202 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error); 3203 3204 /* dedupe tracepoints */ 3205 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents); 3206 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error); 3207 3208 /* ioctl tracepoints */ 3209 TRACE_EVENT(xfs_ioctl_clone, 3210 TP_PROTO(struct inode *src, struct inode *dest), 3211 TP_ARGS(src, dest), 3212 TP_STRUCT__entry( 3213 __field(dev_t, dev) 3214 __field(unsigned long, src_ino) 3215 __field(loff_t, src_isize) 3216 __field(unsigned long, dest_ino) 3217 __field(loff_t, dest_isize) 3218 ), 3219 TP_fast_assign( 3220 __entry->dev = src->i_sb->s_dev; 3221 __entry->src_ino = src->i_ino; 3222 __entry->src_isize = i_size_read(src); 3223 __entry->dest_ino = dest->i_ino; 3224 __entry->dest_isize = i_size_read(dest); 3225 ), 3226 TP_printk("dev %d:%d " 3227 "ino 0x%lx isize 0x%llx -> " 3228 "ino 0x%lx isize 0x%llx\n", 3229 MAJOR(__entry->dev), MINOR(__entry->dev), 3230 __entry->src_ino, 3231 __entry->src_isize, 3232 __entry->dest_ino, 3233 __entry->dest_isize) 3234 ); 3235 3236 /* unshare tracepoints */ 3237 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare); 3238 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error); 3239 3240 /* copy on write */ 3241 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared); 3242 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc); 3243 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found); 3244 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc); 3245 3246 DEFINE_RW_EVENT(xfs_reflink_reserve_cow); 3247 DEFINE_RW_EVENT(xfs_reflink_allocate_cow_range); 3248 3249 DEFINE_INODE_IREC_EVENT(xfs_reflink_bounce_dio_write); 3250 DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping); 3251 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec); 3252 3253 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range); 3254 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow); 3255 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap); 3256 3257 DEFINE_INODE_ERROR_EVENT(xfs_reflink_allocate_cow_range_error); 3258 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error); 3259 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error); 3260 3261 3262 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow); 3263 3264 /* rmap swapext tracepoints */ 3265 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap); 3266 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece); 3267 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error); 3268 3269 #endif /* _TRACE_XFS_H */ 3270 3271 #undef TRACE_INCLUDE_PATH 3272 #define TRACE_INCLUDE_PATH . 3273 #define TRACE_INCLUDE_FILE xfs_trace 3274 #include <trace/define_trace.h> 3275