19 #define TRACE_SYSTEM xfs
21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
29 struct xfs_buf_log_item;
31 struct xfs_da_node_entry;
59 __entry->dev = VFS_I(ctx->
dp)->i_sb->s_dev;
70 TP_printk(
"dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
71 "alist 0x%p size %u count %u firstu %u flags %d %s",
87 #define DEFINE_ATTR_LIST_EVENT(name) \
88 DEFINE_EVENT(xfs_attr_list_class, name, \
89 TP_PROTO(struct xfs_attr_list_context *ctx), \
102 unsigned long caller_ip),
103 TP_ARGS(mp, agno, refcount, caller_ip),
108 __field(
unsigned long, caller_ip)
111 __entry->dev = mp->m_super->s_dev;
114 __entry->caller_ip = caller_ip;
116 TP_printk(
"dev %d:%d agno %u refcount %d caller %pf",
123 #define DEFINE_PERAG_REF_EVENT(name) \
124 DEFINE_EVENT(xfs_perag_class, name, \
125 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
126 unsigned long caller_ip), \
127 TP_ARGS(mp, agno, refcount, caller_ip))
136 struct xfs_da_node_entry *btree),
154 __entry->dev = VFS_I(ctx->
dp)->i_sb->s_dev;
167 TP_printk(
"dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
168 "alist 0x%p size %u count %u firstu %u flags %d %s "
169 "node hashval %u, node before %u",
189 TP_ARGS(ip, idx, r, state, caller_ip),
199 __field(
unsigned long, caller_ip)
202 __entry->dev = VFS_I(ip)->i_sb->s_dev;
210 __entry->caller_ip = caller_ip;
212 TP_printk(
"dev %d:%d ino 0x%llx state %s idx %ld "
213 "offset %lld block %lld count %lld flag %d caller %pf",
219 (__int64_t)
__entry->startblock,
227 unsigned long caller_ip),
228 TP_ARGS(ip, idx, state, caller_ip),
238 __field(
unsigned long, caller_ip)
242 ip->i_afp : &ip->i_df;
246 __entry->dev = VFS_I(ip)->i_sb->s_dev;
254 __entry->caller_ip = caller_ip;
256 TP_printk(
"dev %d:%d ino 0x%llx state %s idx %ld "
257 "offset %lld block %lld count %lld flag %d caller %pf",
263 (__int64_t)
__entry->startblock,
270 DEFINE_EVENT(xfs_bmap_class,
name, \
272 unsigned long caller_ip), \
273 TP_ARGS(ip, idx, state, caller_ip))
275 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
276 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
277 DEFINE_BMAP_EVENT(xfs_extlist);
290 __field(
unsigned long, caller_ip)
300 __entry->caller_ip = caller_ip;
305 (
unsigned long long)
__entry->bno,
314 #define DEFINE_BUF_EVENT(name) \
315 DEFINE_EVENT(xfs_buf_class, name, \
316 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
317 TP_ARGS(bp, caller_ip))
361 __field(
unsigned long, caller_ip)
371 __entry->caller_ip = caller_ip;
373 TP_printk(
"dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
374 "lock %d flags %s caller %pf",
376 (
unsigned long long)
__entry->bno,
385 #define DEFINE_BUF_FLAGS_EVENT(name) \
386 DEFINE_EVENT(xfs_buf_flags_class, name, \
387 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
388 TP_ARGS(bp, flags, caller_ip))
405 __field(
unsigned long, caller_ip)
416 __entry->caller_ip = caller_ip;
418 TP_printk(
"dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
419 "lock %d error %d flags %s caller %pf",
421 (
unsigned long long)
__entry->bno,
432 TP_PROTO(
struct xfs_buf_log_item *bip),
449 __entry->dev = bip->bli_buf->b_target->bt_dev;
450 __entry->bli_flags = bip->bli_flags;
451 __entry->bli_recur = bip->bli_recur;
453 __entry->buf_bno = bip->bli_buf->b_bn;
455 __entry->buf_flags = bip->bli_buf->b_flags;
458 __entry->buf_lockval = bip->bli_buf->b_sema.count;
459 __entry->li_desc = bip->bli_item.li_desc;
460 __entry->li_flags = bip->bli_item.li_flags;
462 TP_printk(
"dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
463 "lock %d flags %s recur %d refcount %d bliflags %s "
464 "lidesc 0x%p liflags %s",
466 (
unsigned long long)
__entry->buf_bno,
479 #define DEFINE_BUF_ITEM_EVENT(name) \
480 DEFINE_EVENT(xfs_buf_item_class, name, \
481 TP_PROTO(struct xfs_buf_log_item *bip), \
509 unsigned long caller_ip),
510 TP_ARGS(ip, lock_flags, caller_ip),
515 __field(
unsigned long, caller_ip)
518 __entry->dev = VFS_I(ip)->i_sb->s_dev;
520 __entry->lock_flags = lock_flags;
521 __entry->caller_ip = caller_ip;
523 TP_printk(
"dev %d:%d ino 0x%llx flags %s caller %pf",
530 #define DEFINE_LOCK_EVENT(name) \
531 DEFINE_EVENT(xfs_lock_class, name, \
532 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
533 unsigned long caller_ip), \
534 TP_ARGS(ip, lock_flags, caller_ip))
548 __entry->dev = VFS_I(ip)->i_sb->s_dev;
556 #define DEFINE_INODE_EVENT(name) \
557 DEFINE_EVENT(xfs_inode_class, name, \
558 TP_PROTO(struct xfs_inode *ip), \
572 #ifdef CONFIG_XFS_POSIX_ACL
589 TP_PROTO(
struct xfs_inode *ip,
unsigned long caller_ip),
596 __field(
unsigned long, caller_ip)
599 __entry->dev = VFS_I(ip)->i_sb->s_dev;
603 __entry->caller_ip = caller_ip;
605 TP_printk(
"dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
614 DEFINE_EVENT(xfs_iref_class,
name, \
615 TP_PROTO(
struct xfs_inode *ip,
unsigned long caller_ip), \
617 DEFINE_IREF_EVENT(xfs_ihold);
618 DEFINE_IREF_EVENT(xfs_irele);
619 DEFINE_IREF_EVENT(xfs_inode_pin);
620 DEFINE_IREF_EVENT(xfs_inode_unpin);
621 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
633 __entry->dev = VFS_I(dp)->i_sb->s_dev;
645 #define DEFINE_NAMESPACE_EVENT(name) \
646 DEFINE_EVENT(xfs_namespace_class, name, \
647 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
656 TP_PROTO(
struct xfs_inode *src_dp,
struct xfs_inode *target_dp,
658 TP_ARGS(src_dp, target_dp, src_name, target_name),
662 __field(xfs_ino_t, target_dp_ino)
669 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
670 __entry->src_dp_ino = src_dp->i_ino;
671 __entry->target_dp_ino = target_dp->i_ino;
678 TP_printk(
"dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
679 " src name %.*s target name %.*s",
697 __field(
unsigned long long, res_bcount)
699 __field(
unsigned long long, icount)
700 __field(
unsigned long long, blk_hardlimit)
701 __field(
unsigned long long, blk_softlimit)
702 __field(
unsigned long long, ino_hardlimit)
703 __field(
unsigned long long, ino_softlimit)
706 __entry->dev = dqp->q_mount->m_super->s_dev;
708 __entry->flags = dqp->dq_flags;
710 __entry->res_bcount = dqp->q_res_bcount;
723 "bcnt 0
x%llx bhardlimit 0
x%llx bsoftlimit 0
x%llx "
724 "
icnt 0
x%llx ihardlimit 0
x%llx isoftlimit 0
x%llx]",
738 #define DEFINE_DQUOT_EVENT(name) \
739 DEFINE_EVENT(xfs_dquot_class, name, \
740 TP_PROTO(struct xfs_dquot *dqp), \
766 TP_PROTO(
struct xlog *
log,
struct xlog_ticket *tic),
778 __field(
int, grant_reserve_cycle)
779 __field(
int, grant_reserve_bytes)
780 __field(
int, grant_write_cycle)
781 __field(
int, grant_write_bytes)
787 __entry->dev = log->l_mp->m_super->s_dev;
788 __entry->trans_type = tic->t_trans_type;
791 __entry->curr_res = tic->t_curr_res;
792 __entry->unit_res = tic->t_unit_res;
794 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
795 __entry->writeq = list_empty(&log->l_write_head.waiters);
796 xlog_crack_grant_head(&log->l_reserve_head.grant,
798 &
__entry->grant_reserve_bytes);
799 xlog_crack_grant_head(&log->l_write_head.grant,
802 __entry->curr_cycle = log->l_curr_cycle;
803 __entry->curr_block = log->l_curr_block;
806 TP_printk(
"dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
807 "t_unit_res %u t_flags %s reserveq %s "
808 "writeq %s grant_reserve_cycle %d "
809 "grant_reserve_bytes %d grant_write_cycle %d "
810 "grant_write_bytes %d curr_cycle %d curr_block %d "
811 "tail_cycle %d tail_block %d",
819 __entry->reserveq ?
"empty" :
"active",
820 __entry->writeq ?
"empty" :
"active",
832 #define DEFINE_LOGGRANT_EVENT(name) \
833 DEFINE_EVENT(xfs_loggrant_class, name, \
834 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
864 __entry->dev = lip->li_mountp->m_super->s_dev;
867 __entry->flags = lip->li_flags;
870 TP_printk(
"dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
886 __entry->dev = mp->m_super->s_dev;
894 #define DEFINE_LOG_ITEM_EVENT(name) \
895 DEFINE_EVENT(xfs_log_item_class, name, \
896 TP_PROTO(struct xfs_log_item *lip), \
905 TP_PROTO(
struct xfs_inode *ip,
size_t count, loff_t
offset,
int flags),
906 TP_ARGS(ip, count, offset, flags),
916 __entry->dev = VFS_I(ip)->i_sb->s_dev;
918 __entry->size = ip->i_d.di_size;
923 TP_printk(
"dev %d:%d ino 0x%llx size 0x%llx "
924 "offset 0x%llx count 0x%zx ioflags %s",
933 #define DEFINE_RW_EVENT(name) \
934 DEFINE_EVENT(xfs_file_class, name, \
935 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
936 TP_ARGS(ip, count, offset, flags))
956 int delalloc = -1, unwritten = -1;
958 if (page_has_buffers(page))
961 __entry->ino = XFS_I(inode)->i_ino;
963 __entry->size = i_size_read(inode);
966 __entry->unwritten = unwritten;
968 TP_printk(
"dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
969 "delalloc %d unwritten %d",
979 #define DEFINE_PAGE_EVENT(name) \
980 DEFINE_EVENT(xfs_page_class, name, \
981 TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \
982 TP_ARGS(inode, page, off))
990 TP_ARGS(ip, offset, count, type, irec),
1003 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1005 __entry->size = ip->i_d.di_size;
1013 TP_printk(
"dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1014 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1022 (__int64_t)
__entry->startblock,
1026 #define DEFINE_IOMAP_EVENT(name) \
1027 DEFINE_EVENT(xfs_imap_class, name, \
1028 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1029 int type, struct xfs_bmbt_irec *irec), \
1030 TP_ARGS(ip, offset, count, type, irec))
1048 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1050 __entry->isize = VFS_I(ip)->i_size;
1051 __entry->disize = ip->i_d.di_size;
1055 TP_printk(
"dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1056 "offset 0x%llx count %zd",
1065 #define DEFINE_SIMPLE_IO_EVENT(name) \
1066 DEFINE_EVENT(xfs_simple_io_class, name, \
1067 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1068 TP_ARGS(ip, offset, count))
1084 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1086 __entry->size = ip->i_d.di_size;
1089 TP_printk(
"dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1096 #define DEFINE_ITRUNC_EVENT(name) \
1097 DEFINE_EVENT(xfs_itrunc_class, name, \
1098 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1099 TP_ARGS(ip, new_size))
1104 TP_PROTO(
struct xfs_inode *ip, xfs_off_t
start, xfs_off_t finish),
1114 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1116 __entry->size = ip->i_d.di_size;
1120 TP_printk(
"dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1130 int flags,
unsigned long caller_ip),
1131 TP_ARGS(ip, bno, len, flags, caller_ip),
1138 __field(
unsigned long, caller_ip)
1142 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1144 __entry->size = ip->i_d.di_size;
1147 __entry->caller_ip = caller_ip;
1150 TP_printk(
"dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1151 "flags %s caller %pf",
1165 TP_ARGS(mp, agno, agbno, len),
1173 __entry->dev = mp->m_super->s_dev;
1178 TP_printk(
"dev %d:%d agno %u agbno %u len %u",
1184 #define DEFINE_BUSY_EVENT(name) \
1185 DEFINE_EVENT(xfs_extent_busy_class, name, \
1186 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1187 xfs_agblock_t agbno, xfs_extlen_t len), \
1188 TP_ARGS(mp, agno, agbno, len))
1199 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1209 __entry->dev = mp->m_super->s_dev;
1216 TP_printk(
"dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1230 __field(
struct xfs_trans *, tp)
1234 __entry->dev = trans->t_mountp->m_super->s_dev;
1236 __entry->lsn = trans->t_commit_lsn;
1238 TP_printk(
"dev %d:%d trans 0x%p commit_lsn 0x%llx",
1246 unsigned long caller_ip),
1247 TP_ARGS(mp, agf, flags, caller_ip),
1262 __field(
unsigned long, caller_ip)
1265 __entry->dev = mp->m_super->s_dev;
1280 __entry->caller_ip = caller_ip;
1282 TP_printk(
"dev %d:%d agno %u flags %s length %u roots b %u c %u "
1283 "levels b %u c %u flfirst %u fllast %u flcount %u "
1284 "freeblks %u longest %u caller %pf",
1303 xfs_extlen_t len,
bool isfl,
int haveleft,
int haveright),
1304 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1315 __entry->dev = mp->m_super->s_dev;
1321 __entry->haveright = haveright;
1323 TP_printk(
"dev %d:%d agno %u agbno %u len %u isfl %d %s",
1330 (
__entry->haveright ?
"both" :
"left") :
1331 (
__entry->haveright ?
"right" :
"none"))
1360 __entry->dev = args->
mp->m_super->s_dev;
1380 TP_printk(
"dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1381 "prod %u minleft %u total %u alignment %u minalignslop %u "
1382 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1383 "userdata %d firstblock 0x%llx",
1402 (
unsigned long long)
__entry->firstblock)
1405 #define DEFINE_ALLOC_EVENT(name) \
1406 DEFINE_EVENT(xfs_alloc_class, name, \
1407 TP_PROTO(struct xfs_alloc_arg *args), \
1448 __entry->dev = VFS_I(args->
dp)->i_sb->s_dev;
1457 TP_printk(
"dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1458 "inumber 0x%llx op_flags %s",
1469 #define DEFINE_DIR2_EVENT(name) \
1470 DEFINE_EVENT(xfs_da_class, name, \
1471 TP_PROTO(struct xfs_da_args *args), \
1499 #define DEFINE_ATTR_EVENT(name) \
1500 DEFINE_EVENT(xfs_da_class, name, \
1501 TP_PROTO(struct xfs_da_args *args), \
1535 #define DEFINE_DA_EVENT(name) \
1536 DEFINE_EVENT(xfs_da_class, name, \
1537 TP_PROTO(struct xfs_da_args *args), \
1567 __entry->dev = VFS_I(args->
dp)->i_sb->s_dev;
1572 TP_printk(
"dev %d:%d ino 0x%llx op_flags %s index %d",
1579 #define DEFINE_DIR2_SPACE_EVENT(name) \
1580 DEFINE_EVENT(xfs_dir2_space_class, name, \
1581 TP_PROTO(struct xfs_da_args *args, int idx), \
1590 TP_ARGS(args, src_idx, dst_idx, count),
1600 __entry->dev = VFS_I(args->
dp)->i_sb->s_dev;
1607 TP_printk(
"dev %d:%d ino 0x%llx op_flags %s "
1608 "src_idx %d dst_idx %d count %d",
1617 #define XFS_SWAPEXT_INODES \
1621 #define XFS_INODE_FORMAT_STR \
1628 TP_PROTO(
struct xfs_inode *ip,
int which),
1640 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1643 __entry->format = ip->i_d.di_format;
1644 __entry->nex = ip->i_d.di_nextents;
1645 __entry->broot_size = ip->i_df.if_broot_bytes;
1648 TP_printk(
"dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1649 "broot size %d, fork offset %d",
1659 #define DEFINE_SWAPEXT_EVENT(name) \
1660 DEFINE_EVENT(xfs_swap_extent_class, name, \
1661 TP_PROTO(struct xfs_inode *ip, int which), \
1670 TP_ARGS(log, trans, item, pass),
1681 __entry->dev = log->l_mp->m_super->s_dev;
1682 __entry->item = (
unsigned long)item;
1689 TP_printk(
"dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1690 "item region count/total %d/%d",
1700 #define DEFINE_LOG_RECOVER_ITEM(name) \
1701 DEFINE_EVENT(xfs_log_recover_item_class, name, \
1702 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
1703 struct xlog_recover_item *item, int pass), \
1704 TP_ARGS(log, trans, item, pass))
1719 __field(
unsigned short, flags)
1721 __field(
unsigned int, map_size)
1724 __entry->dev = log->l_mp->m_super->s_dev;
1731 TP_printk(
"dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1741 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1742 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
1743 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
1744 TP_ARGS(log, buf_f))
1763 __field(
unsigned short, asize)
1764 __field(
unsigned short, dsize)
1770 __entry->dev = log->l_mp->m_super->s_dev;
1780 TP_printk(
"dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1781 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1792 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1793 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
1794 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
1804 TP_ARGS(mp, agno, agbno, len),
1812 __entry->dev = mp->m_super->s_dev;
1817 TP_printk(
"dev %d:%d agno %u agbno %u len %u\n",
1824 #define DEFINE_DISCARD_EVENT(name) \
1825 DEFINE_EVENT(xfs_discard_class, name, \
1826 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1827 xfs_agblock_t agbno, xfs_extlen_t len), \
1828 TP_ARGS(mp, agno, agbno, len))
1836 #undef TRACE_INCLUDE_PATH
1837 #define TRACE_INCLUDE_PATH .
1838 #define TRACE_INCLUDE_FILE xfs_trace