]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: add tracepoints for each of the externally visible allocators
authorDarrick J. Wong <djwong@kernel.org>
Thu, 16 Mar 2023 17:39:31 +0000 (10:39 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Apr 2023 00:13:34 +0000 (17:13 -0700)
Source kernel commit: af4be67e178328806654a98b67695589cf0b05da

There are now five separate space allocator interfaces exposed to the
rest of XFS for five different strategies to find space.  Add
tracepoints for each of them so that I can tell from a trace dump
exactly which ones got called and what happened underneath them.  Add a
sixth so it's more obvious if an allocation actually happened.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
include/xfs_trace.h
libxfs/xfs_alloc.c

index b34e55920da7a443a31ea5a4cfdd9e7573171049..6365aa6235c52ba85e2ba5950476c8b85920c4e7 100644 (file)
 #define trace_xfs_alloc_vextent_loopfailed(a)  ((void) 0)
 #define trace_xfs_alloc_vextent_allfailed(a)   ((void) 0)
 #define trace_xfs_alloc_vextent_skip_deadlock(...)     ((void)0)
+#define trace_xfs_alloc_vextent_finish(...)    ((void) 0)
+#define trace_xfs_alloc_vextent_this_ag(...)   ((void) 0)
+#define trace_xfs_alloc_vextent_first_ag(...)  ((void) 0)
+#define trace_xfs_alloc_vextent_start_ag(...)  ((void) 0)
+#define trace_xfs_alloc_vextent_near_bno(...)  ((void) 0)
+#define trace_xfs_alloc_vextent_exact_bno(...) ((void) 0)
 
 #define trace_xfs_attr_defer_add(...)          ((void) 0)
 #define trace_xfs_attr_defer_replace(...)      ((void) 0)
index bd78e1bd4f52200c6550c21aaafa9b551baf6ba6..cf19419023db23a3ec2ae11707ef78d4009098e7 100644 (file)
@@ -3251,6 +3251,8 @@ xfs_alloc_vextent_finish(
        XFS_STATS_INC(mp, xs_allocx);
        XFS_STATS_ADD(mp, xs_allocb, args->len);
 
+       trace_xfs_alloc_vextent_finish(args);
+
 out_drop_perag:
        if (drop_perag && args->pag) {
                xfs_perag_rele(args->pag);
@@ -3280,6 +3282,9 @@ xfs_alloc_vextent_this_ag(
 
        args->agno = agno;
        args->agbno = 0;
+
+       trace_xfs_alloc_vextent_this_ag(args);
+
        error = xfs_alloc_vextent_check_args(args, XFS_AGB_TO_FSB(mp, agno, 0),
                        &minimum_agno);
        if (error) {
@@ -3401,6 +3406,9 @@ xfs_alloc_vextent_start_ag(
 
        args->agno = NULLAGNUMBER;
        args->agbno = NULLAGBLOCK;
+
+       trace_xfs_alloc_vextent_start_ag(args);
+
        error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
        if (error) {
                if (error == -ENOSPC)
@@ -3451,6 +3459,9 @@ xfs_alloc_vextent_first_ag(
 
        args->agno = NULLAGNUMBER;
        args->agbno = NULLAGBLOCK;
+
+       trace_xfs_alloc_vextent_first_ag(args);
+
        error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
        if (error) {
                if (error == -ENOSPC)
@@ -3482,6 +3493,9 @@ xfs_alloc_vextent_exact_bno(
 
        args->agno = XFS_FSB_TO_AGNO(mp, target);
        args->agbno = XFS_FSB_TO_AGBNO(mp, target);
+
+       trace_xfs_alloc_vextent_exact_bno(args);
+
        error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
        if (error) {
                if (error == -ENOSPC)
@@ -3517,6 +3531,9 @@ xfs_alloc_vextent_near_bno(
 
        args->agno = XFS_FSB_TO_AGNO(mp, target);
        args->agbno = XFS_FSB_TO_AGBNO(mp, target);
+
+       trace_xfs_alloc_vextent_near_bno(args);
+
        error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
        if (error) {
                if (error == -ENOSPC)