From: Darrick J. Wong Date: Thu, 16 Mar 2023 17:29:43 +0000 (-0700) Subject: xfs: add tracepoints for each of the externally visible allocators X-Git-Tag: libxfs-sync-6.3_2023-04-05~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a6f8126986b3ce1691c7a2de15d0d7cfc4be1ab8;p=xfsprogs-dev.git xfs: add tracepoints for each of the externally visible allocators 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 --- diff --git a/include/xfs_trace.h b/include/xfs_trace.h index b34e5592..6365aa62 100644 --- a/include/xfs_trace.h +++ b/include/xfs_trace.h @@ -39,6 +39,12 @@ #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) diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index bd78e1bd..daae044e 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -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)