linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 2/4] xfs: add more AGF/AGFL manipulation tracepoints
Date: Fri, 18 Nov 2016 10:55:33 +1100	[thread overview]
Message-ID: <1479426935-7112-3-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1479426935-7112-1-git-send-email-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

So we can see what blocks are added to or removed from the AGFL during
allocation.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 fs/xfs/libxfs/xfs_alloc.c |  8 ++++++--
 fs/xfs/xfs_trace.h        | 11 ++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index effb64cf714f..a5a9d8360e74 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -2264,10 +2264,12 @@ xfs_alloc_get_freelist(
 	xfs_mount_t	*mp = tp->t_mountp;
 	xfs_perag_t	*pag;	/* per allocation group data */
 
+	agf = XFS_BUF_TO_AGF(agbp);
+	trace_xfs_alloc_get_freelist(mp, agf, 0, _RET_IP_);
+
 	/*
 	 * Freelist is empty, give up.
 	 */
-	agf = XFS_BUF_TO_AGF(agbp);
 	if (!agf->agf_flcount) {
 		*bnop = NULLAGBLOCK;
 		return 0;
@@ -2392,8 +2394,9 @@ xfs_alloc_put_freelist(
 	__be32			*agfl_bno;
 	int			startoff;
 
-	agf = XFS_BUF_TO_AGF(agbp);
 	mp = tp->t_mountp;
+	agf = XFS_BUF_TO_AGF(agbp);
+	trace_xfs_alloc_put_freelist(mp, agf, 0, _RET_IP_);
 
 	if (!agflbp && (error = xfs_alloc_read_agfl(mp, tp,
 			be32_to_cpu(agf->agf_seqno), &agflbp)))
@@ -2555,6 +2558,7 @@ xfs_read_agf(
 	if (!*bpp)
 		return 0;
 
+	trace_xfs_read_agf_detail(mp, XFS_BUF_TO_AGF(*bpp), 0, _RET_IP_);
 	ASSERT(!(*bpp)->b_error);
 	xfs_buf_set_ref(*bpp, XFS_AGF_REF);
 	return 0;
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 0907752be62d..73e001d795ce 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -1516,7 +1516,7 @@ TRACE_EVENT(xfs_trans_commit_lsn,
 		  __entry->lsn)
 );
 
-TRACE_EVENT(xfs_agf,
+DECLARE_EVENT_CLASS(xfs_agf_class,
 	TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
 		 unsigned long caller_ip),
 	TP_ARGS(mp, agf, flags, caller_ip),
@@ -1572,6 +1572,15 @@ TRACE_EVENT(xfs_agf,
 		  __entry->longest,
 		  (void *)__entry->caller_ip)
 );
+#define DEFINE_AGF_EVENT(name) \
+DEFINE_EVENT(xfs_agf_class, name, \
+	TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
+		 unsigned long caller_ip), \
+	TP_ARGS(mp, agf, flags, caller_ip))
+DEFINE_AGF_EVENT(xfs_agf);
+DEFINE_AGF_EVENT(xfs_read_agf_detail);
+DEFINE_AGF_EVENT(xfs_alloc_get_freelist);
+DEFINE_AGF_EVENT(xfs_alloc_put_freelist);
 
 TRACE_EVENT(xfs_free_extent,
 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
-- 
2.8.0.rc3


  parent reply	other threads:[~2016-11-17 23:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 16:35 [BUG] dd doesn't return on ENOSPC and hang when fulfilling rmapbt XFS Eryu Guan
2016-11-17 17:36 ` Darrick J. Wong
2016-11-17 20:11   ` Darrick J. Wong
2016-11-17 21:32     ` Dave Chinner
2016-11-17 23:55       ` [PATCH 0/4] xfs: fix rmapbt ENOSPC hangs Dave Chinner
2016-11-17 23:55         ` [PATCH 1/4] xfs: factor rmap btree size into the indlen calculations Dave Chinner
2016-11-17 23:55         ` Dave Chinner [this message]
2016-11-17 23:55         ` [PATCH 3/4] xfs: hold AGF buffers over defer ops Dave Chinner
2016-11-18  0:53           ` Dave Chinner
2016-11-17 23:55         ` [PATCH 4/4] xfs: defer indirect delalloc rmap reservations Dave Chinner
2016-11-18  5:26     ` [BUG] dd doesn't return on ENOSPC and hang when fulfilling rmapbt XFS Eryu Guan
2016-11-18  5:46       ` Dave Chinner
2016-11-18  6:52         ` Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479426935-7112-3-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).