]> 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>
Tue, 9 May 2023 09:32:43 +0000 (11:32 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 10 May 2023 13:03:25 +0000 (15:03 +0200)
Source kernel commit: e6fbb7167ed005783ac5aef3e75699f45ffe2af8

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>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
include/xfs_trace.h
libxfs/xfs_alloc.c

index c9398c4d8997c3622c69d6c81b67ab9ae0f52958..4facca264c1b05d93c7ab78f7fc0a4f44a82b5c1 100644 (file)
 #define trace_xfs_alloc_small_error(a)         ((void) 0)
 #define trace_xfs_alloc_vextent_badargs(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_alloc_vextent_nofix(a)       ((void) 0)
 #define trace_xfs_alloc_vextent_noagbp(a)      ((void) 0)
 #define trace_xfs_alloc_vextent_loopfailed(a)  ((void) 0)
index bd78e1bd4f52200c6550c21aaafa9b551baf6ba6..daae044e29bb32c4eeb87de7a9abc7636f4a5459 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_first_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_start_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_near_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_exact_bno(args);
+
        error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
        if (error) {
                if (error == -ENOSPC)