xfs: give rmap btree cursor error tracepoints their own class
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:21:39 +0000 (14:21 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:13:14 +0000 (17:13 -0700)
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 c3195e53236601c5b1f3ec89701f78608dca284f..74a30ed81e7a4cca259b19128c1f17fffe49ddc4 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;
 }
 
@@ -1147,8 +1143,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;
 }
 
@@ -1343,8 +1338,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);
@@ -1697,8 +1691,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;
 }
 
@@ -1821,8 +1814,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.
         */
@@ -2124,8 +2116,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;
 }
 
@@ -2324,8 +2315,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;
 }
 
@@ -2485,8 +2475,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;
 }