aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-05-09 11:32:43 +0200
committerCarlos Maiolino <cem@kernel.org>2023-05-10 15:03:25 +0200
commit6904abced9f0698dba679b081f757aa6882fa52a (patch)
tree2e16c3faec49f2dfc50dababde082a76f131b881
parentc2337664c80a4458865d02454ead036acc876c51 (diff)
downloadxfsprogs-dev-6904abced9f0698dba679b081f757aa6882fa52a.tar.gz
xfs: add tracepoints for each of the externally visible allocators
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>
-rw-r--r--include/xfs_trace.h6
-rw-r--r--libxfs/xfs_alloc.c17
2 files changed, 23 insertions, 0 deletions
diff --git a/include/xfs_trace.h b/include/xfs_trace.h
index c9398c4d89..4facca264c 100644
--- a/include/xfs_trace.h
+++ b/include/xfs_trace.h
@@ -35,6 +35,12 @@
#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)
diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c
index bd78e1bd4f..daae044e29 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)