Skip to content

Commit e6fbb71

Browse files
author
Darrick J. Wong
committed
xfs: add tracepoints for each of the externally visible allocators
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>
1 parent 9eb7759 commit e6fbb71

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3255,6 +3255,8 @@ xfs_alloc_vextent_finish(
32553255
XFS_STATS_INC(mp, xs_allocx);
32563256
XFS_STATS_ADD(mp, xs_allocb, args->len);
32573257

3258+
trace_xfs_alloc_vextent_finish(args);
3259+
32583260
out_drop_perag:
32593261
if (drop_perag && args->pag) {
32603262
xfs_perag_rele(args->pag);
@@ -3284,6 +3286,9 @@ xfs_alloc_vextent_this_ag(
32843286

32853287
args->agno = agno;
32863288
args->agbno = 0;
3289+
3290+
trace_xfs_alloc_vextent_this_ag(args);
3291+
32873292
error = xfs_alloc_vextent_check_args(args, XFS_AGB_TO_FSB(mp, agno, 0),
32883293
&minimum_agno);
32893294
if (error) {
@@ -3405,6 +3410,9 @@ xfs_alloc_vextent_start_ag(
34053410

34063411
args->agno = NULLAGNUMBER;
34073412
args->agbno = NULLAGBLOCK;
3413+
3414+
trace_xfs_alloc_vextent_first_ag(args);
3415+
34083416
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
34093417
if (error) {
34103418
if (error == -ENOSPC)
@@ -3455,6 +3463,9 @@ xfs_alloc_vextent_first_ag(
34553463

34563464
args->agno = NULLAGNUMBER;
34573465
args->agbno = NULLAGBLOCK;
3466+
3467+
trace_xfs_alloc_vextent_start_ag(args);
3468+
34583469
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
34593470
if (error) {
34603471
if (error == -ENOSPC)
@@ -3486,6 +3497,9 @@ xfs_alloc_vextent_exact_bno(
34863497

34873498
args->agno = XFS_FSB_TO_AGNO(mp, target);
34883499
args->agbno = XFS_FSB_TO_AGBNO(mp, target);
3500+
3501+
trace_xfs_alloc_vextent_near_bno(args);
3502+
34893503
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
34903504
if (error) {
34913505
if (error == -ENOSPC)
@@ -3521,6 +3535,9 @@ xfs_alloc_vextent_near_bno(
35213535

35223536
args->agno = XFS_FSB_TO_AGNO(mp, target);
35233537
args->agbno = XFS_FSB_TO_AGBNO(mp, target);
3538+
3539+
trace_xfs_alloc_vextent_exact_bno(args);
3540+
35243541
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
35253542
if (error) {
35263543
if (error == -ENOSPC)

fs/xfs/xfs_trace.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,6 +1883,13 @@ DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
18831883
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
18841884
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
18851885

1886+
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_this_ag);
1887+
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_start_ag);
1888+
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_first_ag);
1889+
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_exact_bno);
1890+
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_near_bno);
1891+
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_finish);
1892+
18861893
TRACE_EVENT(xfs_alloc_cur_check,
18871894
TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
18881895
xfs_extlen_t len, xfs_extlen_t diff, bool new),

0 commit comments

Comments
 (0)