int                     error;
 
        ASSERT(VFS_I(ip)->i_mode != 0);
+       trace_xfs_iunlink(ip);
 
        /* Get the agi buffer first.  It ensures lock ordering on the list. */
        error = xfs_read_agi(mp, tp, agno, &agibp);
        short                   bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS;
        int                     error;
 
+       trace_xfs_iunlink_remove(ip);
+
        /* Get the agi buffer first.  It ensures lock ordering on the list. */
        error = xfs_read_agi(mp, tp, agno, &agibp);
        if (error)
 
                  __entry->new_ptr)
 );
 
+DECLARE_EVENT_CLASS(xfs_ag_inode_class,
+       TP_PROTO(struct xfs_inode *ip),
+       TP_ARGS(ip),
+       TP_STRUCT__entry(
+               __field(dev_t, dev)
+               __field(xfs_agnumber_t, agno)
+               __field(xfs_agino_t, agino)
+       ),
+       TP_fast_assign(
+               __entry->dev = VFS_I(ip)->i_sb->s_dev;
+               __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
+               __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
+       ),
+       TP_printk("dev %d:%d agno %u agino %u",
+                 MAJOR(__entry->dev), MINOR(__entry->dev),
+                 __entry->agno, __entry->agino)
+)
+
+#define DEFINE_AGINODE_EVENT(name) \
+DEFINE_EVENT(xfs_ag_inode_class, name, \
+       TP_PROTO(struct xfs_inode *ip), \
+       TP_ARGS(ip))
+DEFINE_AGINODE_EVENT(xfs_iunlink);
+DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
+
 #endif /* _TRACE_XFS_H */
 
 #undef TRACE_INCLUDE_PATH