public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 01/10] xfs: add trace points for log forces
Date: Tue, 24 Apr 2012 16:33:31 +1000	[thread overview]
Message-ID: <1335249220-22274-2-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1335249220-22274-1-git-send-email-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

To enable easy tracing of the location of log forces and the
frequency of them via perf, add a pair of trace points to the log
force functions.  This will help debug where excessive log forces
are being issued from by simple perf commands like:

# ~/perf/perf top -e xfs:xfs_log_force -G -U

Which gives this sort of output:

Events: 141  xfs:xfs_log_force
-  100.00%  [kernel]  [k] xfs_log_force
   - xfs_log_force
        87.04% xfsaild
           kthread
           kernel_thread_helper
      - 12.87% xfs_buf_lock
           _xfs_buf_find
           xfs_buf_get
           xfs_trans_get_buf
           xfs_da_do_buf
           xfs_da_get_buf
           xfs_dir2_data_init
           xfs_dir2_leaf_addname
           xfs_dir_createname
           xfs_create
           xfs_vn_mknod
           xfs_vn_create
           vfs_create
           do_last.isra.41
           path_openat
           do_filp_open
           do_sys_open
           sys_open
           system_call_fastpath

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 fs/xfs/xfs_log.c   |    2 ++
 fs/xfs/xfs_trace.h |   16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 9b10a15..6b965bf 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2941,6 +2941,7 @@ xfs_log_force(
 {
 	int	error;
 
+	trace_xfs_log_force(mp, 0);
 	error = _xfs_log_force(mp, flags, NULL);
 	if (error)
 		xfs_warn(mp, "%s: error %d returned.", __func__, error);
@@ -3089,6 +3090,7 @@ xfs_log_force_lsn(
 {
 	int	error;
 
+	trace_xfs_log_force(mp, lsn);
 	error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
 	if (error)
 		xfs_warn(mp, "%s: error %d returned.", __func__, error);
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index febff43..7cf9d35 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -874,6 +874,22 @@ DECLARE_EVENT_CLASS(xfs_log_item_class,
 		  __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
 )
 
+TRACE_EVENT(xfs_log_force,
+	TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
+	TP_ARGS(mp, lsn),
+	TP_STRUCT__entry(
+		__field(dev_t, dev)
+		__field(xfs_lsn_t, lsn)
+	),
+	TP_fast_assign(
+		__entry->dev = mp->m_super->s_dev;
+		__entry->lsn = lsn;
+	),
+	TP_printk("dev %d:%d lsn 0x%llx",
+		  MAJOR(__entry->dev), MINOR(__entry->dev),
+		  __entry->lsn)
+)
+
 #define DEFINE_LOG_ITEM_EVENT(name) \
 DEFINE_EVENT(xfs_log_item_class, name, \
 	TP_PROTO(struct xfs_log_item *lip), \
-- 
1.7.9.5

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-04-24  6:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24  6:33 [PATCH 00/10] xfs: discontiguous buffer support a.k.a. die xfs_dabuf die Dave Chinner
2012-04-24  6:33 ` Dave Chinner [this message]
2012-04-30 19:25   ` [PATCH 01/10] xfs: add trace points for log forces Mark Tinguely
2012-04-24  6:33 ` [PATCH 02/10] xfs: separate buffer indexing from block map Dave Chinner
2012-04-30 19:28   ` Mark Tinguely
2012-04-30 23:24     ` Dave Chinner
2012-05-01 13:16       ` Mark Tinguely
2012-05-02  1:16         ` Dave Chinner
2012-04-24  6:33 ` [PATCH 03/10] xfs: convert internal buffer functions to pass maps Dave Chinner
2012-05-01 15:13   ` Mark Tinguely
2012-04-24  6:33 ` [PATCH 04/10] xfs: add discontiguous buffer map interface Dave Chinner
2012-05-01 18:10   ` Mark Tinguely
2012-04-24  6:33 ` [PATCH 05/10] xfs: add discontiguous buffer support to transactions Dave Chinner
2012-05-03 19:41   ` Mark Tinguely
2012-04-24  6:33 ` [PATCH 06/10] xfs: struct xfs_buf_log_format isn't variable sized Dave Chinner
2012-05-02 13:39   ` Mark Tinguely
2012-04-24  6:33 ` [PATCH 07/10] xfs: support discontiguous buffers in the xfs_buf_log_item Dave Chinner
2012-05-03 19:42   ` Mark Tinguely
2012-04-24  6:33 ` [PATCH 08/10] xfs: use multiple irec xfs buf support in dabuf Dave Chinner
2012-05-03 19:43   ` Mark Tinguely
2012-04-24  6:33 ` [PATCH 09/10] xfs: remove struct xfs_dabuf and infrastructure Dave Chinner
2012-05-04 19:54   ` Mark Tinguely
2012-04-24  6:33 ` [PATCH 10/10] xfs: factor buffer reading from xfs_dir2_leaf_getdents Dave Chinner
2012-05-04 12:42   ` Mark Tinguely
2012-05-16 17:40 ` [PATCH 00/10] xfs: discontiguous buffer support a.k.a. die xfs_dabuf die Ben Myers
2012-05-23  9:27   ` Dave Chinner
2012-05-30 14:48     ` Ben Myers
2012-05-30 19:48       ` Ben Myers

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=1335249220-22274-2-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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