]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: give rmap btree cursor error tracepoints their own class
authorDarrick J. Wong <djwong@kernel.org>
Tue, 7 Mar 2023 03:55:43 +0000 (19:55 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 22 Nov 2023 23:03:37 +0000 (15:03 -0800)
Create a new tracepoint class for btree-related errors, then convert all
the rmap tracepoints to use it.  Also fix the one tracepoint that was
abusing the old class by making it a separate tracepoint.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_rmap.c

index 3a71053bee6ca66ef715e37022b7adecee5b8865..338afcbad591f97a7934bf089be7ee019fc39eb7 100644 (file)
@@ -110,8 +110,7 @@ xfs_rmap_update(
                        xfs_rmap_irec_offset_pack(irec));
        error = xfs_btree_update(cur, &rec);
        if (error)
-               trace_xfs_rmap_update_error(cur->bc_mp,
-                               cur->bc_ag.pag->pag_agno, error, _RET_IP_);
+               trace_xfs_rmap_update_error(cur, error, _RET_IP_);
        return error;
 }
 
@@ -154,8 +153,7 @@ xfs_rmap_insert(
        }
 done:
        if (error)
-               trace_xfs_rmap_insert_error(rcur->bc_mp,
-                               rcur->bc_ag.pag->pag_agno, error, _RET_IP_);
+               trace_xfs_rmap_insert_error(rcur, error, _RET_IP_);
        return error;
 }
 
@@ -193,8 +191,7 @@ xfs_rmap_delete(
        }
 done:
        if (error)
-               trace_xfs_rmap_delete_error(rcur->bc_mp,
-                               rcur->bc_ag.pag->pag_agno, error, _RET_IP_);
+               trace_xfs_rmap_delete_error(rcur, error, _RET_IP_);
        return error;
 }
 
@@ -815,8 +812,7 @@ out_done:
                        unwritten, oinfo);
 out_error:
        if (error)
-               trace_xfs_rmap_unmap_error(mp, cur->bc_ag.pag->pag_agno,
-                               error, _RET_IP_);
+               trace_xfs_rmap_unmap_error(cur, error, _RET_IP_);
        return error;
 }
 
@@ -1138,8 +1134,7 @@ xfs_rmap_map(
                        unwritten, oinfo);
 out_error:
        if (error)
-               trace_xfs_rmap_map_error(mp, cur->bc_ag.pag->pag_agno,
-                               error, _RET_IP_);
+               trace_xfs_rmap_map_error(cur, error, _RET_IP_);
        return error;
 }
 
@@ -1334,8 +1329,7 @@ xfs_rmap_convert(
             RIGHT.rm_blockcount > XFS_RMAP_LEN_MAX)
                state &= ~RMAP_RIGHT_CONTIG;
 
-       trace_xfs_rmap_convert_state(mp, cur->bc_ag.pag->pag_agno, state,
-                       _RET_IP_);
+       trace_xfs_rmap_convert_state(cur, state, _RET_IP_);
 
        /* reset the cursor back to PREV */
        error = xfs_rmap_lookup_le(cur, bno, owner, offset, oldext, NULL, &i);
@@ -1688,8 +1682,7 @@ xfs_rmap_convert(
                        unwritten, oinfo);
 done:
        if (error)
-               trace_xfs_rmap_convert_error(cur->bc_mp,
-                               cur->bc_ag.pag->pag_agno, error, _RET_IP_);
+               trace_xfs_rmap_convert_error(cur, error, _RET_IP_);
        return error;
 }
 
@@ -1812,8 +1805,7 @@ xfs_rmap_convert_shared(
             RIGHT.rm_blockcount > XFS_RMAP_LEN_MAX)
                state &= ~RMAP_RIGHT_CONTIG;
 
-       trace_xfs_rmap_convert_state(mp, cur->bc_ag.pag->pag_agno, state,
-                       _RET_IP_);
+       trace_xfs_rmap_convert_state(cur, state, _RET_IP_);
        /*
         * Switch out based on the FILLING and CONTIG state bits.
         */
@@ -2115,8 +2107,7 @@ xfs_rmap_convert_shared(
                        unwritten, oinfo);
 done:
        if (error)
-               trace_xfs_rmap_convert_error(cur->bc_mp,
-                               cur->bc_ag.pag->pag_agno, error, _RET_IP_);
+               trace_xfs_rmap_convert_error(cur, error, _RET_IP_);
        return error;
 }
 
@@ -2315,8 +2306,7 @@ xfs_rmap_unmap_shared(
                        unwritten, oinfo);
 out_error:
        if (error)
-               trace_xfs_rmap_unmap_error(cur->bc_mp,
-                               cur->bc_ag.pag->pag_agno, error, _RET_IP_);
+               trace_xfs_rmap_unmap_error(cur, error, _RET_IP_);
        return error;
 }
 
@@ -2476,8 +2466,7 @@ xfs_rmap_map_shared(
                        unwritten, oinfo);
 out_error:
        if (error)
-               trace_xfs_rmap_map_error(cur->bc_mp,
-                               cur->bc_ag.pag->pag_agno, error, _RET_IP_);
+               trace_xfs_rmap_map_error(cur, error, _RET_IP_);
        return error;
 }