]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: improve inode item tracing
authorDave Chinner <dchinner@redhat.com>
Fri, 23 May 2025 04:38:08 +0000 (06:38 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 23 May 2025 04:48:06 +0000 (06:48 +0200)
hch: split from a larger patch from Dave, needs a proper commit log.

fs/xfs/xfs_inode_item.c
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_trace.h
fs/xfs/xfs_trans.c

index c6cb0b6b9e4605655b9b4de62d5e94c257f9c81b..285e27ff89e296daa60e49d1b7cf0df163f75bac 100644 (file)
@@ -758,11 +758,14 @@ xfs_inode_item_push(
                 * completed and items removed from the AIL before the next push
                 * attempt.
                 */
+               trace_xfs_inode_push_stale(ip, _RET_IP_);
                return XFS_ITEM_PINNED;
        }
 
-       if (xfs_ipincount(ip) > 0 || xfs_buf_ispinned(bp))
+       if (xfs_ipincount(ip) > 0 || xfs_buf_ispinned(bp)) {
+               trace_xfs_inode_push_pinned(ip, _RET_IP_);
                return XFS_ITEM_PINNED;
+       }
 
        if (xfs_iflags_test(ip, XFS_IFLUSHING))
                return XFS_ITEM_FLUSHING;
index f66d2d430e4f375f658ed2a39348359625b0bdee..a80cb6b9969a81f53c53a2a90a6cf80cd15d2cd6 100644 (file)
@@ -793,8 +793,10 @@ xlog_cil_ail_insert(
                struct xfs_log_item     *lip = lv->lv_item;
                xfs_lsn_t               item_lsn;
 
-               if (aborted)
+               if (aborted) {
+                       trace_xlog_ail_insert_abort(lip);
                        set_bit(XFS_LI_ABORTED, &lip->li_flags);
+               }
 
                if (lip->li_ops->flags & XFS_ITEM_RELEASE_WHEN_COMMITTED) {
                        lip->li_ops->iop_release(lip);
index 01d284a1c75961a528dd4386a1c4ac9c005b535d..54597b4060ffaa4980479c3bf7ed7e87ea813c3c 100644 (file)
@@ -1147,6 +1147,7 @@ DECLARE_EVENT_CLASS(xfs_iref_class,
                __field(xfs_ino_t, ino)
                __field(int, count)
                __field(int, pincount)
+               __field(unsigned long, iflags)
                __field(unsigned long, caller_ip)
        ),
        TP_fast_assign(
@@ -1154,13 +1155,15 @@ DECLARE_EVENT_CLASS(xfs_iref_class,
                __entry->ino = ip->i_ino;
                __entry->count = atomic_read(&VFS_I(ip)->i_count);
                __entry->pincount = atomic_read(&ip->i_pincount);
+               __entry->iflags = ip->i_flags;
                __entry->caller_ip = caller_ip;
        ),
-       TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
+       TP_printk("dev %d:%d ino 0x%llx count %d pincount %d iflags 0x%lx caller %pS",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  __entry->ino,
                  __entry->count,
                  __entry->pincount,
+                 __entry->iflags,
                  (char *)__entry->caller_ip)
 )
 
@@ -1250,6 +1253,8 @@ DEFINE_IREF_EVENT(xfs_irele);
 DEFINE_IREF_EVENT(xfs_inode_pin);
 DEFINE_IREF_EVENT(xfs_inode_unpin);
 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
+DEFINE_IREF_EVENT(xfs_inode_push_pinned);
+DEFINE_IREF_EVENT(xfs_inode_push_stale);
 
 DECLARE_EVENT_CLASS(xfs_namespace_class,
        TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name),
@@ -1654,6 +1659,8 @@ DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_mark);
 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_skip);
 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_unpin);
+DEFINE_LOG_ITEM_EVENT(xlog_ail_insert_abort);
+DEFINE_LOG_ITEM_EVENT(xfs_trans_free_abort);
 
 DECLARE_EVENT_CLASS(xfs_ail_class,
        TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
index c6657072361a479ee5abfe2d5b22dc5a0335193c..b4a07af513bada591b2b974699e174b8dc87dda7 100644 (file)
@@ -742,8 +742,10 @@ xfs_trans_free_items(
 
        list_for_each_entry_safe(lip, next, &tp->t_items, li_trans) {
                xfs_trans_del_item(lip);
-               if (abort)
+               if (abort) {
+                       trace_xfs_trans_free_abort(lip);
                        set_bit(XFS_LI_ABORTED, &lip->li_flags);
+               }
                if (lip->li_ops->iop_release)
                        lip->li_ops->iop_release(lip);
        }