Commit e6fbb716 authored by Darrick J. Wong's avatar Darrick J. Wong

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: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 9eb77596
...@@ -3255,6 +3255,8 @@ xfs_alloc_vextent_finish( ...@@ -3255,6 +3255,8 @@ xfs_alloc_vextent_finish(
XFS_STATS_INC(mp, xs_allocx); XFS_STATS_INC(mp, xs_allocx);
XFS_STATS_ADD(mp, xs_allocb, args->len); XFS_STATS_ADD(mp, xs_allocb, args->len);
trace_xfs_alloc_vextent_finish(args);
out_drop_perag: out_drop_perag:
if (drop_perag && args->pag) { if (drop_perag && args->pag) {
xfs_perag_rele(args->pag); xfs_perag_rele(args->pag);
...@@ -3284,6 +3286,9 @@ xfs_alloc_vextent_this_ag( ...@@ -3284,6 +3286,9 @@ xfs_alloc_vextent_this_ag(
args->agno = agno; args->agno = agno;
args->agbno = 0; args->agbno = 0;
trace_xfs_alloc_vextent_this_ag(args);
error = xfs_alloc_vextent_check_args(args, XFS_AGB_TO_FSB(mp, agno, 0), error = xfs_alloc_vextent_check_args(args, XFS_AGB_TO_FSB(mp, agno, 0),
&minimum_agno); &minimum_agno);
if (error) { if (error) {
...@@ -3405,6 +3410,9 @@ xfs_alloc_vextent_start_ag( ...@@ -3405,6 +3410,9 @@ xfs_alloc_vextent_start_ag(
args->agno = NULLAGNUMBER; args->agno = NULLAGNUMBER;
args->agbno = NULLAGBLOCK; args->agbno = NULLAGBLOCK;
trace_xfs_alloc_vextent_first_ag(args);
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno); error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
if (error) { if (error) {
if (error == -ENOSPC) if (error == -ENOSPC)
...@@ -3455,6 +3463,9 @@ xfs_alloc_vextent_first_ag( ...@@ -3455,6 +3463,9 @@ xfs_alloc_vextent_first_ag(
args->agno = NULLAGNUMBER; args->agno = NULLAGNUMBER;
args->agbno = NULLAGBLOCK; args->agbno = NULLAGBLOCK;
trace_xfs_alloc_vextent_start_ag(args);
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno); error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
if (error) { if (error) {
if (error == -ENOSPC) if (error == -ENOSPC)
...@@ -3486,6 +3497,9 @@ xfs_alloc_vextent_exact_bno( ...@@ -3486,6 +3497,9 @@ xfs_alloc_vextent_exact_bno(
args->agno = XFS_FSB_TO_AGNO(mp, target); args->agno = XFS_FSB_TO_AGNO(mp, target);
args->agbno = XFS_FSB_TO_AGBNO(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); error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
if (error) { if (error) {
if (error == -ENOSPC) if (error == -ENOSPC)
...@@ -3521,6 +3535,9 @@ xfs_alloc_vextent_near_bno( ...@@ -3521,6 +3535,9 @@ xfs_alloc_vextent_near_bno(
args->agno = XFS_FSB_TO_AGNO(mp, target); args->agno = XFS_FSB_TO_AGNO(mp, target);
args->agbno = XFS_FSB_TO_AGBNO(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); error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
if (error) { if (error) {
if (error == -ENOSPC) if (error == -ENOSPC)
......
...@@ -1883,6 +1883,13 @@ DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp); ...@@ -1883,6 +1883,13 @@ DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_this_ag);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_start_ag);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_first_ag);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_exact_bno);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_near_bno);
DEFINE_ALLOC_EVENT(xfs_alloc_vextent_finish);
TRACE_EVENT(xfs_alloc_cur_check, TRACE_EVENT(xfs_alloc_cur_check,
TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno, TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
xfs_extlen_t len, xfs_extlen_t diff, bool new), xfs_extlen_t len, xfs_extlen_t diff, bool new),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment