Skip to contentSkip to conversation

xfs: event tracing support

PATCH In review Christoph Hellwig 2 participants 4 messages Nov 24, 2009 – Dec 15, 2009 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 xfs: event tracing support

Convert the old xfs tracing support that could only be used with the out of tree kdb and xfsidbg patches to use the generic event tracer.

To use it make sure CONFIG_EVENT_TRACING is enabled and then enable all xfs trace channels by:

echo 1 > /sys/kernel/debug/tracing/events/xfs/enable

or alternatively enable single events by just doing the same in one event subdirectory, e.g.

echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_ihold/enable

or set more complex filters, etc. In Documentation/trace/events.txt all this is desctribed in more detail. To reads the events do a

cat /sys/kernel/debug/tracing/trace

Compared to the last posting this patch converts the tracing mostly to the one tracepoint per callsite model that other users of the new tracing facility also employ. This allows a very fine-grained control of the tracing, a cleaner output of the traces and also enables the perf tool to use each tracepoint as a virtual performance counter, allowing us to e.g. count how often certain workloads git various spots in XFS. Take a look at

    http://lwn.net/Articles/346470/

for some examples.

Also the btree tracing isn't included at all yet, as it will require additional core tracing features not in mainline yet, I plan to deliver it later.

And the really nice thing about this patch is that it actually removes many lines of code while adding this nice functionality:

 70 files changed, 2148 insertions(+), 2563 deletions(-)
fs/xfs/Makefile +3 -5
Index: linux-2.6/fs/xfs/Makefile
===================================================================
@@ -26,6 +26,8 @@ endif
 
 obj-$(CONFIG_XFS_FS)		+= xfs.o
 
+xfs-y				+= linux-2.6/xfs_trace.o
+
 xfs-$(CONFIG_XFS_QUOTA)		+= $(addprefix quota/, \
 				   xfs_dquot.o \
 				   xfs_dquot_item.o \
@@ -90,8 +92,7 @@ xfs-y				+= xfs_alloc.o \
 				   xfs_rw.o \
 				   xfs_dmops.o
 
-xfs-$(CONFIG_XFS_TRACE)		+= xfs_btree_trace.o \
-				   xfs_dir2_trace.o
+xfs-$(CONFIG_XFS_TRACE)		+= xfs_btree_trace.o
 
 # Objects in linux/
 xfs-y				+= $(addprefix $(XFS_LINUX)/, \
@@ -113,6 +114,3 @@ xfs-y				+= $(addprefix $(XFS_LINUX)/, \
 xfs-y				+= $(addprefix support/, \
 				   debug.o \
 				   uuid.o)
-
-xfs-$(CONFIG_XFS_TRACE)		+= support/ktrace.o
-
fs/xfs/linux-2.6/xfs_acl.c +1 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_acl.c
===================================================================
@@ -21,6 +21,7 @@
 #include "xfs_bmap_btree.h"
 #include "xfs_inode.h"
 #include "xfs_vnodeops.h"
+#include "xfs_trace.h"
 #include <linux/xattr.h>
 #include <linux/posix_acl_xattr.h>
 
fs/xfs/linux-2.6/xfs_aops.c +5 -47

88 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_buf.c +41 -76

341 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_buf.h +22 -11
Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.h
===================================================================
@@ -95,6 +95,28 @@ typedef enum {
 	_XFS_BARRIER_FAILED = (1 << 23),
 } xfs_buf_flags_t;
 
+#define XFS_BUF_FLAGS \
+	{ XBF_READ,		"READ" }, \
+	{ XBF_WRITE,		"WRITE" }, \
+	{ XBF_MAPPED,		"MAPPED" }, \
+	{ XBF_ASYNC,		"ASYNC" }, \
+	{ XBF_DONE,		"DONE" }, \
+	{ XBF_DELWRI,		"DELWRI" }, \
+	{ XBF_STALE,		"STALE" }, \
+	{ XBF_FS_MANAGED,	"FS_MANAGED" }, \
+	{ XBF_ORDERED,		"ORDERED" }, \
+	{ XBF_READ_AHEAD,	"READ_AHEAD" }, \
+	{ XBF_LOCK,		"LOCK" },  	/* should never be set */\
+	{ XBF_TRYLOCK,		"TRYLOCK" }, 	/* ditto */\
+	{ XBF_DONT_BLOCK,	"DONT_BLOCK" },	/* ditto */\
+	{ _XBF_PAGE_CACHE,	"PAGE_CACHE" }, \
+	{ _XBF_PAGES,		"PAGES" }, \
+	{ _XBF_RUN_QUEUES,	"RUN_QUEUES" }, \
+	{ _XBF_DELWRI_Q,	"DELWRI_Q" }, \
+	{ _XBF_PAGE_LOCKED,	"PAGE_LOCKED" }, \
+	{ _XFS_BARRIER_FAILED,	"BARRIER_FAILED" }
+
+
 typedef enum {
 	XBT_FORCE_SLEEP = 0,
 	XBT_FORCE_FLUSH = 1,
@@ -248,13 +270,6 @@ extern void xfs_buf_delwri_dequeue(xfs_b
 extern int xfs_buf_init(void);
 extern void xfs_buf_terminate(void);
 
-#ifdef XFS_BUF_TRACE
-extern ktrace_t *xfs_buf_trace_buf;
-extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
-#else
-#define xfs_buf_trace(bp,id,ptr,ra)	do { } while (0)
-#endif
-
 #define xfs_buf_target_name(target)	\
 	({ char __b[BDEVNAME_SIZE]; bdevname((target)->bt_bdev, __b); __b; })
 
@@ -370,10 +385,6 @@ static inline void xfs_buf_relse(xfs_buf
 
 #define xfs_bpin(bp)		xfs_buf_pin(bp)
 #define xfs_bunpin(bp)		xfs_buf_unpin(bp)
-
-#define xfs_buftrace(id, bp)	\
-	    xfs_buf_trace(bp, id, NULL, (void *)__builtin_return_address(0))
-
 #define xfs_biodone(bp)		xfs_buf_ioend(bp, 0)
 
 #define xfs_biomove(bp, off, len, data, rw) \
fs/xfs/linux-2.6/xfs_fs_subr.c +3 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_fs_subr.c
===================================================================
@@ -19,6 +19,7 @@
 #include "xfs_vnodeops.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_inode.h"
+#include "xfs_trace.h"
 
 int  fs_noerr(void) { return 0; }
 int  fs_nosys(void) { return ENOSYS; }
@@ -51,6 +52,8 @@ xfs_flushinval_pages(
 	struct address_space *mapping = VFS_I(ip)->i_mapping;
 	int		ret = 0;
 
+	trace_xfs_pagecache_inval(ip, first, last);
+
 	if (mapping->nrpages) {
 		xfs_iflags_clear(ip, XFS_ITRUNCATED);
 		ret = filemap_write_and_wait(mapping);
fs/xfs/linux-2.6/xfs_ioctl.c +1 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl.c
===================================================================
@@ -51,6 +51,7 @@
 #include "xfs_quota.h"
 #include "xfs_inode_item.h"
 #include "xfs_export.h"
+#include "xfs_trace.h"
 
 #include <linux/capability.h>
 #include <linux/dcache.h>
fs/xfs/linux-2.6/xfs_ioctl32.c +1 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================
@@ -46,6 +46,7 @@
 #include "xfs_attr.h"
 #include "xfs_ioctl.h"
 #include "xfs_ioctl32.h"
+#include "xfs_trace.h"
 
 #define  _NATIVE_IOC(cmd, type) \
 	  _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type))
fs/xfs/linux-2.6/xfs_iops.c +1 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
@@ -47,6 +47,7 @@
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
 #include "xfs_vnodeops.h"
+#include "xfs_trace.h"
 
 #include <linux/capability.h>
 #include <linux/xattr.h>
fs/xfs/linux-2.6/xfs_linux.h +0 -1
Index: linux-2.6/fs/xfs/linux-2.6/xfs_linux.h
===================================================================
@@ -40,7 +40,6 @@
 #include <sv.h>
 #include <time.h>
 
-#include <support/ktrace.h>
 #include <support/debug.h>
 #include <support/uuid.h>
 
fs/xfs/linux-2.6/xfs_lrw.c +11 -76

146 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_lrw.h +0 -45

52 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_super.c +3 -101

159 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_super.h +0 -7
Index: linux-2.6/fs/xfs/linux-2.6/xfs_super.h
===================================================================
@@ -56,12 +56,6 @@ extern void xfs_qm_exit(void);
 # define XFS_BIGFS_STRING
 #endif
 
-#ifdef CONFIG_XFS_TRACE
-# define XFS_TRACE_STRING	"tracing, "
-#else
-# define XFS_TRACE_STRING
-#endif
-
 #ifdef CONFIG_XFS_DMAPI
 # define XFS_DMAPI_STRING	"dmapi support, "
 #else
@@ -78,7 +72,6 @@ extern void xfs_qm_exit(void);
 				XFS_SECURITY_STRING \
 				XFS_REALTIME_STRING \
 				XFS_BIGFS_STRING \
-				XFS_TRACE_STRING \
 				XFS_DMAPI_STRING \
 				XFS_DBG_STRING /* DBG must be last */
 
fs/xfs/linux-2.6/xfs_sync.c +1 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_sync.c
===================================================================
@@ -44,6 +44,7 @@
 #include "xfs_inode_item.h"
 #include "xfs_rw.h"
 #include "xfs_quota.h"
+#include "xfs_trace.h"
 
 #include <linux/kthread.h>
 #include <linux/freezer.h>
fs/xfs/linux-2.6/xfs_trace.h new file +1368 -0

1,368 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_vnode.h +5 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_vnode.h
===================================================================
@@ -40,6 +40,11 @@ struct attrlist_cursor_kern;
 #define IO_ISDIRECT	0x00004		/* bypass page cache */
 #define IO_INVIS	0x00020		/* don't update inode timestamps */
 
+#define XFS_IO_FLAGS \
+	{ IO_ISAIO,	"AIO" }, \
+	{ IO_ISDIRECT,	"DIRECT" }, \
+	{ IO_INVIS,	"INVIS"}
+
 /*
  * Flush/Invalidate options for vop_toss/flush/flushinval_pages.
  */
fs/xfs/quota/xfs_dquot.c +31 -79

265 lines not on this page · raw message

fs/xfs/quota/xfs_dquot.h +0 -21
Index: linux-2.6/fs/xfs/quota/xfs_dquot.h
===================================================================
@@ -85,9 +85,6 @@ typedef struct xfs_dquot {
 	struct completion q_flush;	/* flush completion queue */
 	atomic_t          q_pincount;	/* dquot pin count */
 	wait_queue_head_t q_pinwait;	/* dquot pinning wait queue */
-#ifdef XFS_DQUOT_TRACE
-	struct ktrace	*q_trace;	/* trace header structure */
-#endif
 } xfs_dquot_t;
 
 
@@ -144,24 +141,6 @@ static inline void xfs_dqfunlock(xfs_dqu
 				     (XFS_IS_UQUOTA_ON((d)->q_mount)) : \
 				     (XFS_IS_OQUOTA_ON((d)->q_mount))))
 
-#ifdef XFS_DQUOT_TRACE
-/*
- * Dquot Tracing stuff.
- */
-#define DQUOT_TRACE_SIZE	64
-#define DQUOT_KTRACE_ENTRY	1
-
-extern void		__xfs_dqtrace_entry(xfs_dquot_t *dqp, char *func,
-					    void *, xfs_inode_t *);
-#define xfs_dqtrace_entry_ino(a,b,ip) \
-		__xfs_dqtrace_entry((a), (b), (void*)__return_address, (ip))
-#define xfs_dqtrace_entry(a,b) \
-		__xfs_dqtrace_entry((a), (b), (void*)__return_address, NULL)
-#else
-#define xfs_dqtrace_entry(a,b)
-#define xfs_dqtrace_entry_ino(a,b,ip)
-#endif
-
 #ifdef QUOTADEBUG
 extern void		xfs_qm_dqprint(xfs_dquot_t *);
 #else
fs/xfs/quota/xfs_qm.c +26 -14
Index: linux-2.6/fs/xfs/quota/xfs_qm.c
===================================================================
@@ -47,6 +47,7 @@
 #include "xfs_trans_space.h"
 #include "xfs_utils.h"
 #include "xfs_qm.h"
+#include "xfs_trace.h"
 
 /*
  * The global quota manager. There is only one of these for the entire
@@ -453,7 +454,7 @@ again:
 			xfs_dqunlock(dqp);
 			continue;
 		}
-		xfs_dqtrace_entry(dqp, "FLUSHALL: DQDIRTY");
+
 		/* XXX a sentinel would be better */
 		recl = XFS_QI_MPLRECLAIMS(mp);
 		if (!xfs_dqflock_nowait(dqp)) {
@@ -651,7 +652,7 @@ xfs_qm_dqattach_one(
 	 */
 	dqp = *IO_idqpp;
 	if (dqp) {
-		xfs_dqtrace_entry(dqp, "DQATTACH: found in ip");
+		trace_xfs_dqattach_found(dqp);
 		return 0;
 	}
 
@@ -704,7 +705,7 @@ xfs_qm_dqattach_one(
 	if (error)
 		return error;
 
-	xfs_dqtrace_entry(dqp, "DQATTACH: found by dqget");
+	trace_xfs_dqattach_get(dqp);
 
 	/*
 	 * dqget may have dropped and re-acquired the ilock, but it guarantees
@@ -890,15 +891,15 @@ xfs_qm_dqdetach(
 	if (!(ip->i_udquot || ip->i_gdquot))
 		return;
 
+	trace_xfs_dquot_dqdetach(ip);
+
 	ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_uquotino);
 	ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_gquotino);
 	if (ip->i_udquot) {
-		xfs_dqtrace_entry_ino(ip->i_udquot, "DQDETTACH", ip);
 		xfs_qm_dqrele(ip->i_udquot);
 		ip->i_udquot = NULL;
 	}
 	if (ip->i_gdquot) {
-		xfs_dqtrace_entry_ino(ip->i_gdquot, "DQDETTACH", ip);
 		xfs_qm_dqrele(ip->i_gdquot);
 		ip->i_gdquot = NULL;
 	}
@@ -977,7 +978,6 @@ xfs_qm_sync(
 		 * across a disk write
 		 */
 		xfs_qm_mplist_unlock(mp);
-		xfs_dqtrace_entry(dqp, "XQM_SYNC: DQFLUSH");
 		error = xfs_qm_dqflush(dqp, flush_flags);
 		xfs_dqunlock(dqp);
 		if (error && XFS_FORCED_SHUTDOWN(mp))
@@ -1350,7 +1350,8 @@ xfs_qm_reset_dqcounts(
 	xfs_disk_dquot_t	*ddq;
 	int			j;
 
-	xfs_buftrace("RESET DQUOTS", bp);
+	trace_xfs_reset_dqcounts(bp, _RET_IP_);
+
 	/*
 	 * Reset all counters and timers. They'll be
 	 * started afresh by xfs_qm_quotacheck.
@@ -1543,7 +1544,9 @@ xfs_qm_quotacheck_dqadjust(
 	xfs_qcnt_t		rtblks)
 {
 	ASSERT(XFS_DQ_IS_LOCKED(dqp));
-	xfs_dqtrace_entry(dqp, "QCHECK DQADJUST");
+
+	trace_xfs_dqadjust(dqp);
+
 	/*
 	 * Adjust the inode count and the block count to reflect this inode's
 	 * resource usage.
@@ -1994,7 +1997,9 @@ xfs_qm_shake_freelist(
 		 */
 		if (XFS_DQ_IS_DIRTY(dqp)) {
 			int	error;
-			xfs_dqtrace_entry(dqp, "DQSHAKE: DQDIRTY");
+
+			trace_xfs_dqshake_dirty(dqp);
+
 			/*
 			 * We flush it delayed write, so don't bother
 			 * releasing the mplock.
@@ -2038,7 +2043,9 @@ xfs_qm_shake_freelist(
 				return nreclaimed;
 			goto tryagain;
 		}
-		xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING");
+
+		trace_xfs_dqshake_unlink(dqp);
+
 #ifdef QUOTADEBUG
 		cmn_err(CE_DEBUG, "Shake 0x%p, ID 0x%x\n",
 			dqp, be32_to_cpu(dqp->q_core.d_id));
@@ -2125,7 +2132,9 @@ xfs_qm_dqreclaim_one(void)
 		 */
 		if (dqp->dq_flags & XFS_DQ_WANT) {
 			ASSERT(! (dqp->dq_flags & XFS_DQ_INACTIVE));
-			xfs_dqtrace_entry(dqp, "DQRECLAIM: DQWANT");
+
+			trace_xfs_dqreclaim_want(dqp);
+
 			xfs_dqunlock(dqp);
 			xfs_qm_freelist_unlock(xfs_Gqm);
 			if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
@@ -2171,7 +2180,9 @@ xfs_qm_dqreclaim_one(void)
 		 */
 		if (XFS_DQ_IS_DIRTY(dqp)) {
 			int	error;
-			xfs_dqtrace_entry(dqp, "DQRECLAIM: DQDIRTY");
+
+			trace_xfs_dqreclaim_dirty(dqp);
+
 			/*
 			 * We flush it delayed write, so don't bother
 			 * releasing the freelist lock.
@@ -2194,8 +2205,9 @@ xfs_qm_dqreclaim_one(void)
 		if (!mutex_trylock(&dqp->q_hash->qh_lock))
 			goto mplistunlock;
 
+		trace_xfs_dqreclaim_unlink(dqp);
+
 		ASSERT(dqp->q_nrefs == 0);
-		xfs_dqtrace_entry(dqp, "DQRECLAIM: UNLINKING");
 		XQM_MPLIST_REMOVE(&(XFS_QI_MPL_LIST(dqp->q_mount)), dqp);
 		XQM_HASHLIST_REMOVE(dqp->q_hash, dqp);
 		XQM_FREELIST_REMOVE(dqp);
@@ -2430,7 +2442,7 @@ xfs_qm_vop_dqalloc(
 		}
 	}
 	if (uq)
-		xfs_dqtrace_entry_ino(uq, "DQALLOC", ip);
+		trace_xfs_dquot_dqalloc(ip);
 
 	xfs_iunlock(ip, lockflags);
 	if (O_udqpp)
fs/xfs/quota/xfs_qm_syscalls.c +1 -3
Index: linux-2.6/fs/xfs/quota/xfs_qm_syscalls.c
===================================================================
@@ -49,6 +49,7 @@
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
 #include "xfs_qm.h"
+#include "xfs_trace.h"
 
 #ifdef DEBUG
 # define qdprintk(s, args...)	cmn_err(CE_DEBUG, s, ## args)
@@ -496,7 +497,6 @@ xfs_qm_scall_setqlim(
 		ASSERT(error != ENOENT);
 		return (error);
 	}
-	xfs_dqtrace_entry(dqp, "Q_SETQLIM: AFT DQGET");
 	xfs_trans_dqjoin(tp, dqp);
 	ddq = &dqp->q_core;
 
@@ -602,7 +602,6 @@ xfs_qm_scall_setqlim(
 	dqp->dq_flags |= XFS_DQ_DIRTY;
 	xfs_trans_log_dquot(tp, dqp);
 
-	xfs_dqtrace_entry(dqp, "Q_SETQLIM: COMMIT");
 	error = xfs_trans_commit(tp, 0);
 	xfs_qm_dqprint(dqp);
 	xfs_qm_dqrele(dqp);
@@ -630,7 +629,6 @@ xfs_qm_scall_getquota(
 		return (error);
 	}
 
-	xfs_dqtrace_entry(dqp, "Q_GETQUOTA SUCCESS");
 	/*
 	 * If everything's NULL, this dquot doesn't quite exist as far as
 	 * our utility programs are concerned.
fs/xfs/support/ktrace.c deleted +0 -323

227 lines not on this page · raw message

fs/xfs/support/ktrace.h deleted +0 -85

85 lines not on this page · raw message

fs/xfs/xfs.h +0 -16
Index: linux-2.6/fs/xfs/xfs.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_ag.h +14 -0
Index: linux-2.6/fs/xfs/xfs_ag.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_alloc.c +44 -186

230 lines not on this page · raw message

fs/xfs/xfs_alloc.h +9 -18
Index: linux-2.6/fs/xfs/xfs_alloc.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_alloc_btree.c +1 -0
Index: linux-2.6/fs/xfs/xfs_alloc_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_attr.c +9 -98

107 lines not on this page · raw message

fs/xfs/xfs_attr.h +10 -0
Index: linux-2.6/fs/xfs/xfs_attr.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_attr_sf.h +0 -40
Index: linux-2.6/fs/xfs/xfs_attr_sf.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_bmap.c +101 -391

492 lines not on this page · raw message

fs/xfs/xfs_bmap.h +26 -17

43 lines not on this page · raw message

fs/xfs/xfs_bmap_btree.c +0 -6
Index: linux-2.6/fs/xfs/xfs_bmap_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_btree.c +3 -2
Index: linux-2.6/fs/xfs/xfs_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_btree_trace.h +0 -17
Index: linux-2.6/fs/xfs/xfs_btree_trace.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_buf_item.c +25 -62

87 lines not on this page · raw message

fs/xfs/xfs_buf_item.h +8 -12
Index: linux-2.6/fs/xfs/xfs_buf_item.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_da_btree.c +2 -1
Index: linux-2.6/fs/xfs/xfs_da_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_da_btree.h +7 -0
Index: linux-2.6/fs/xfs/xfs_da_btree.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dfrag.c +1 -1
Index: linux-2.6/fs/xfs/xfs_dfrag.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2.c +5 -3
Index: linux-2.6/fs/xfs/xfs_dir2.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_block.c +13 -7
Index: linux-2.6/fs/xfs/xfs_dir2_block.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_leaf.c +14 -7
Index: linux-2.6/fs/xfs/xfs_dir2_leaf.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_node.c +17 -10
Index: linux-2.6/fs/xfs/xfs_dir2_node.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_sf.c +17 -9
Index: linux-2.6/fs/xfs/xfs_dir2_sf.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_trace.c deleted +0 -216

216 lines not on this page · raw message

fs/xfs/xfs_dir2_trace.h deleted +0 -72

72 lines not on this page · raw message

fs/xfs/xfs_filestream.c +2 -6
Index: linux-2.6/fs/xfs/xfs_filestream.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_fsops.c +2 -0
Index: linux-2.6/fs/xfs/xfs_fsops.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_iget.c +14 -97

111 lines not on this page · raw message

fs/xfs/xfs_inode.c +9 -58

67 lines not on this page · raw message

fs/xfs/xfs_inode.h +14 -62

76 lines not on this page · raw message

fs/xfs/xfs_inode_item.c +4 -1
Index: linux-2.6/fs/xfs/xfs_inode_item.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_iomap.c +8 -77

85 lines not on this page · raw message

fs/xfs/xfs_iomap.h +8 -0
Index: linux-2.6/fs/xfs/xfs_iomap.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_log.c +53 -128

181 lines not on this page · raw message

fs/xfs/xfs_log_priv.h +6 -14
Index: linux-2.6/fs/xfs/xfs_log_priv.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_log_recover.c +1 -0
Index: linux-2.6/fs/xfs/xfs_log_recover.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_mount.c +2 -0
Index: linux-2.6/fs/xfs/xfs_mount.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_quota.h +8 -0
Index: linux-2.6/fs/xfs/xfs_quota.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_rename.c +1 -0
Index: linux-2.6/fs/xfs/xfs_rename.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_rtalloc.c +1 -0
Index: linux-2.6/fs/xfs/xfs_rtalloc.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_rw.c +1 -2
Index: linux-2.6/fs/xfs/xfs_rw.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_trans.h +47 -0

47 lines not on this page · raw message

fs/xfs/xfs_trans_buf.c +26 -36

62 lines not on this page · raw message

fs/xfs/xfs_vnodeops.c +1 -7
Index: linux-2.6/fs/xfs/xfs_vnodeops.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_attr_leaf.c +6 -8
Index: linux-2.6/fs/xfs/xfs_attr_leaf.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/linux-2.6/xfs_trace.c new file +75 -0

75 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_aops.h +2 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_aops.h
===================================================================

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Part of the diff is not shown here. View the raw message.

#1 lore raw

There is a problem with trace_xfs_bmap_insert(). It is referenced once (in xfs_bmap_trace_exlist()), but never defined. The reference does not match the prototype defined for the other bmap tracepoints either.

Rather than trying to figure out what you intended I thought I'd give you a chance to offer a fix. If you do, please just send me an update of that portion of the code if possible. Meanwhile I've commented out that reference and am going to try to complete my review of this patch shortly.

Details are in the excerpts below. I didn't add any commentary, I'm just calling attention to the code I'm referring to.

-Alex

Quoted 93 lines

Convert the old xfs tracing support that could only be used with the out of tree kdb and xfsidbg patches to use the generic event tracer.

. . .

 70 files changed, 2148 insertions(+), 2563 deletions(-)

. . .

Index: linux-2.6/fs/xfs/linux-2.6/xfs_trace.h
===================================================================

fs/xfs/linux-2.6/xfs_trace.h new file +3 -0
@@ -0,0 +1,1368 @@
+/*
+ * Copyright (c) 2009, Christoph Hellwig
+ * All Rights Reserved.

. . .

fs/xfs/linux-2.6/xfs_trace.h new file +50 -0
+
+#define DEFINE_BMAP_EVENT(name) \
+TRACE_EVENT(name, \
+	TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
+		 unsigned long caller_ip), \
+	TP_ARGS(ip, idx, state, caller_ip), \
+	TP_STRUCT__entry( \
+		__field(dev_t, dev) \
+		__field(xfs_ino_t, ino) \
+		__field(xfs_extnum_t, idx) \
+		__field(xfs_fileoff_t, startoff) \
+		__field(xfs_fsblock_t, startblock) \
+		__field(xfs_filblks_t, blockcount) \
+		__field(xfs_exntst_t, state) \
+		__field(int, bmap_state) \
+		__field(unsigned long, caller_ip) \
+	), \
+	TP_fast_assign( \
+		struct xfs_ifork	*ifp = (state & BMAP_ATTRFORK) ? \
+						ip->i_afp : &ip->i_df; \
+		struct xfs_bmbt_irec	r; \
+	\
+		xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r); \
+		__entry->dev = VFS_I(ip)->i_sb->s_dev; \
+		__entry->ino = ip->i_ino; \
+		__entry->idx = idx; \
+		__entry->startoff = r.br_startoff; \
+		__entry->startblock = r.br_startblock; \
+		__entry->blockcount = r.br_blockcount; \
+		__entry->state = r.br_state; \
+		__entry->bmap_state = state; \
+		__entry->caller_ip = caller_ip; \
+	), \
+	TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " \
+		  "offset %lld block %s count %lld flag %d caller %pf", \
+		  MAJOR(__entry->dev), MINOR(__entry->dev), \
+		  __entry->ino, \
+		  __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), \
+		  (long)__entry->idx, \
+		  __entry->startoff, \
+		  xfs_fmtfsblock(__entry->startblock), \
+		  __entry->blockcount, \
+		  __entry->state, \
+		  (char *)__entry->caller_ip) \
+)
+
+DEFINE_BMAP_EVENT(xfs_iext_remove);
+DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
+DEFINE_BMAP_EVENT(xfs_bmap_post_update);
+

. . .

Index: linux-2.6/fs/xfs/xfs_bmap.c
===================================================================

fs/xfs/xfs_bmap.c +0 -0

. . .

fs/xfs/xfs_bmap.c +1 -4
@@ -4680,13 +4392,10 @@ xfs_bmap_trace_exlist(
 	for (idx = 0; idx < cnt; idx++) {
 		ep = xfs_iext_get_ext(ifp, idx);
 		xfs_bmbt_get_all(ep, &s);
-		XFS_BMAP_TRACE_INSERT("exlist", ip, idx, 1, &s, NULL,
-			whichfork);
+		trace_xfs_bmap_insert(ip, idx, &s, whichfork, "extlist");
 	}
 }
-#endif
 
-#ifdef DEBUG
 /*
  * Validate that the bmbt_irecs being returned from bmapi are valid
  * given the callers original parameters.  Specifically check the
@@ -5435,7 +5144,8 @@ xfs_bunmapi(
Quoted 1 line

. . .

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 5 lines · Alex Elder

There is a problem with trace_xfs_bmap_insert(). It is referenced once (in xfs_bmap_trace_exlist()), but never defined. The reference does not match the prototype defined for the other bmap tracepoints either.

Quoted 8 lines

Rather than trying to figure out what you intended I thought I'd give you a chance to offer a fix. If you do, please just send me an update of that portion of the code if possible. Meanwhile I've commented out that reference and am going to try to complete my review of this patch shortly.

Details are in the excerpts below. I didn't add any commentary, I'm just calling attention to the code I'm referring to.

Yeah, that was some debug build that got missed in the last iteration of the patch. Updated version below:

Subject: xfs: event tracing support
From: Christoph Hellwig <[email protected]>

Convert the old xfs tracing support that could only be used with the out of tree kdb and xfsidbg patches to use the generic event tracer.

To use it make sure CONFIG_EVENT_TRACING is enabled and then enable all xfs trace channels by:

echo 1 > /sys/kernel/debug/tracing/events/xfs/enable

or alternatively enable single events by just doing the same in one event subdirectory, e.g.

echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_ihold/enable

or set more complex filters, etc. In Documentation/trace/events.txt all this is desctribed in more detail. To reads the events do a

cat /sys/kernel/debug/tracing/trace

Compared to the last posting this patch converts the tracing mostly to the one tracepoint per callsite model that other users of the new tracing facility also employ. This allows a very fine-grained control of the tracing, a cleaner output of the traces and also enables the perf tool to use each tracepoint as a virtual performance counter, allowing us to e.g. count how often certain workloads git various spots in XFS. Take a look at

    http://lwn.net/Articles/346470/

for some examples.

Also the btree tracing isn't included at all yet, as it will require additional core tracing features not in mainline yet, I plan to deliver it later.

And the really nice thing about this patch is that it actually removes many lines of code while adding this nice functionality:

 70 files changed, 2148 insertions(+), 2563 deletions(-)
fs/xfs/Makefile +3 -5
Index: xfs/fs/xfs/Makefile
===================================================================
@@ -26,6 +26,8 @@ endif
 
 obj-$(CONFIG_XFS_FS)		+= xfs.o
 
+xfs-y				+= linux-2.6/xfs_trace.o
+
 xfs-$(CONFIG_XFS_QUOTA)		+= $(addprefix quota/, \
 				   xfs_dquot.o \
 				   xfs_dquot_item.o \
@@ -90,8 +92,7 @@ xfs-y				+= xfs_alloc.o \
 				   xfs_rw.o \
 				   xfs_dmops.o
 
-xfs-$(CONFIG_XFS_TRACE)		+= xfs_btree_trace.o \
-				   xfs_dir2_trace.o
+xfs-$(CONFIG_XFS_TRACE)		+= xfs_btree_trace.o
 
 # Objects in linux/
 xfs-y				+= $(addprefix $(XFS_LINUX)/, \
@@ -113,6 +114,3 @@ xfs-y				+= $(addprefix $(XFS_LINUX)/, \
 xfs-y				+= $(addprefix support/, \
 				   debug.o \
 				   uuid.o)
-
-xfs-$(CONFIG_XFS_TRACE)		+= support/ktrace.o
-
fs/xfs/linux-2.6/xfs_acl.c +1 -0
Index: xfs/fs/xfs/linux-2.6/xfs_acl.c
===================================================================
@@ -21,6 +21,7 @@
 #include "xfs_bmap_btree.h"
 #include "xfs_inode.h"
 #include "xfs_vnodeops.h"
+#include "xfs_trace.h"
 #include <linux/xattr.h>
 #include <linux/posix_acl_xattr.h>
 
fs/xfs/linux-2.6/xfs_aops.c +5 -47

88 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_buf.c +41 -76

341 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_buf.h +22 -11
Index: xfs/fs/xfs/linux-2.6/xfs_buf.h
===================================================================
@@ -95,6 +95,28 @@ typedef enum {
 	_XFS_BARRIER_FAILED = (1 << 23),
 } xfs_buf_flags_t;
 
+#define XFS_BUF_FLAGS \
+	{ XBF_READ,		"READ" }, \
+	{ XBF_WRITE,		"WRITE" }, \
+	{ XBF_MAPPED,		"MAPPED" }, \
+	{ XBF_ASYNC,		"ASYNC" }, \
+	{ XBF_DONE,		"DONE" }, \
+	{ XBF_DELWRI,		"DELWRI" }, \
+	{ XBF_STALE,		"STALE" }, \
+	{ XBF_FS_MANAGED,	"FS_MANAGED" }, \
+	{ XBF_ORDERED,		"ORDERED" }, \
+	{ XBF_READ_AHEAD,	"READ_AHEAD" }, \
+	{ XBF_LOCK,		"LOCK" },  	/* should never be set */\
+	{ XBF_TRYLOCK,		"TRYLOCK" }, 	/* ditto */\
+	{ XBF_DONT_BLOCK,	"DONT_BLOCK" },	/* ditto */\
+	{ _XBF_PAGE_CACHE,	"PAGE_CACHE" }, \
+	{ _XBF_PAGES,		"PAGES" }, \
+	{ _XBF_RUN_QUEUES,	"RUN_QUEUES" }, \
+	{ _XBF_DELWRI_Q,	"DELWRI_Q" }, \
+	{ _XBF_PAGE_LOCKED,	"PAGE_LOCKED" }, \
+	{ _XFS_BARRIER_FAILED,	"BARRIER_FAILED" }
+
+
 typedef enum {
 	XBT_FORCE_SLEEP = 0,
 	XBT_FORCE_FLUSH = 1,
@@ -243,13 +265,6 @@ extern void xfs_buf_delwri_dequeue(xfs_b
 extern int xfs_buf_init(void);
 extern void xfs_buf_terminate(void);
 
-#ifdef XFS_BUF_TRACE
-extern ktrace_t *xfs_buf_trace_buf;
-extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
-#else
-#define xfs_buf_trace(bp,id,ptr,ra)	do { } while (0)
-#endif
-
 #define xfs_buf_target_name(target)	\
 	({ char __b[BDEVNAME_SIZE]; bdevname((target)->bt_bdev, __b); __b; })
 
@@ -365,10 +380,6 @@ static inline void xfs_buf_relse(xfs_buf
 
 #define xfs_bpin(bp)		xfs_buf_pin(bp)
 #define xfs_bunpin(bp)		xfs_buf_unpin(bp)
-
-#define xfs_buftrace(id, bp)	\
-	    xfs_buf_trace(bp, id, NULL, (void *)__builtin_return_address(0))
-
 #define xfs_biodone(bp)		xfs_buf_ioend(bp, 0)
 
 #define xfs_biomove(bp, off, len, data, rw) \
fs/xfs/linux-2.6/xfs_fs_subr.c +3 -0
Index: xfs/fs/xfs/linux-2.6/xfs_fs_subr.c
===================================================================
@@ -19,6 +19,7 @@
 #include "xfs_vnodeops.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_inode.h"
+#include "xfs_trace.h"
 
 int  fs_noerr(void) { return 0; }
 int  fs_nosys(void) { return ENOSYS; }
@@ -51,6 +52,8 @@ xfs_flushinval_pages(
 	struct address_space *mapping = VFS_I(ip)->i_mapping;
 	int		ret = 0;
 
+	trace_xfs_pagecache_inval(ip, first, last);
+
 	if (mapping->nrpages) {
 		xfs_iflags_clear(ip, XFS_ITRUNCATED);
 		ret = filemap_write_and_wait(mapping);
fs/xfs/linux-2.6/xfs_ioctl.c +1 -0
Index: xfs/fs/xfs/linux-2.6/xfs_ioctl.c
===================================================================
@@ -51,6 +51,7 @@
 #include "xfs_quota.h"
 #include "xfs_inode_item.h"
 #include "xfs_export.h"
+#include "xfs_trace.h"
 
 #include <linux/capability.h>
 #include <linux/dcache.h>
fs/xfs/linux-2.6/xfs_ioctl32.c +1 -0
Index: xfs/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================
@@ -46,6 +46,7 @@
 #include "xfs_attr.h"
 #include "xfs_ioctl.h"
 #include "xfs_ioctl32.h"
+#include "xfs_trace.h"
 
 #define  _NATIVE_IOC(cmd, type) \
 	  _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type))
fs/xfs/linux-2.6/xfs_iops.c +1 -0
Index: xfs/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
@@ -47,6 +47,7 @@
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
 #include "xfs_vnodeops.h"
+#include "xfs_trace.h"
 
 #include <linux/capability.h>
 #include <linux/xattr.h>
fs/xfs/linux-2.6/xfs_linux.h +0 -1
Index: xfs/fs/xfs/linux-2.6/xfs_linux.h
===================================================================
@@ -40,7 +40,6 @@
 #include <sv.h>
 #include <time.h>
 
-#include <support/ktrace.h>
 #include <support/debug.h>
 #include <support/uuid.h>
 
fs/xfs/linux-2.6/xfs_lrw.c +11 -76

146 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_lrw.h +0 -45

52 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_super.c +3 -101

159 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_super.h +0 -7
Index: xfs/fs/xfs/linux-2.6/xfs_super.h
===================================================================
@@ -56,12 +56,6 @@ extern void xfs_qm_exit(void);
 # define XFS_BIGFS_STRING
 #endif
 
-#ifdef CONFIG_XFS_TRACE
-# define XFS_TRACE_STRING	"tracing, "
-#else
-# define XFS_TRACE_STRING
-#endif
-
 #ifdef CONFIG_XFS_DMAPI
 # define XFS_DMAPI_STRING	"dmapi support, "
 #else
@@ -78,7 +72,6 @@ extern void xfs_qm_exit(void);
 				XFS_SECURITY_STRING \
 				XFS_REALTIME_STRING \
 				XFS_BIGFS_STRING \
-				XFS_TRACE_STRING \
 				XFS_DMAPI_STRING \
 				XFS_DBG_STRING /* DBG must be last */
 
fs/xfs/linux-2.6/xfs_sync.c +1 -0
Index: xfs/fs/xfs/linux-2.6/xfs_sync.c
===================================================================
@@ -44,6 +44,7 @@
 #include "xfs_inode_item.h"
 #include "xfs_rw.h"
 #include "xfs_quota.h"
+#include "xfs_trace.h"
 
 #include <linux/kthread.h>
 #include <linux/freezer.h>
fs/xfs/linux-2.6/xfs_trace.h new file +1369 -0

1,369 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_vnode.h +4 -0
Index: xfs/fs/xfs/linux-2.6/xfs_vnode.h
===================================================================
@@ -39,6 +39,10 @@ struct attrlist_cursor_kern;
 #define IO_ISDIRECT	0x00004		/* bypass page cache */
 #define IO_INVIS	0x00020		/* don't update inode timestamps */
 
+#define XFS_IO_FLAGS \
+	{ IO_ISDIRECT,	"DIRECT" }, \
+	{ IO_INVIS,	"INVIS"}
+
 /*
  * Flush/Invalidate options for vop_toss/flush/flushinval_pages.
  */
fs/xfs/quota/xfs_dquot.c +31 -79

265 lines not on this page · raw message

fs/xfs/quota/xfs_dquot.h +0 -21
Index: xfs/fs/xfs/quota/xfs_dquot.h
===================================================================
@@ -85,9 +85,6 @@ typedef struct xfs_dquot {
 	struct completion q_flush;	/* flush completion queue */
 	atomic_t          q_pincount;	/* dquot pin count */
 	wait_queue_head_t q_pinwait;	/* dquot pinning wait queue */
-#ifdef XFS_DQUOT_TRACE
-	struct ktrace	*q_trace;	/* trace header structure */
-#endif
 } xfs_dquot_t;
 
 
@@ -144,24 +141,6 @@ static inline void xfs_dqfunlock(xfs_dqu
 				     (XFS_IS_UQUOTA_ON((d)->q_mount)) : \
 				     (XFS_IS_OQUOTA_ON((d)->q_mount))))
 
-#ifdef XFS_DQUOT_TRACE
-/*
- * Dquot Tracing stuff.
- */
-#define DQUOT_TRACE_SIZE	64
-#define DQUOT_KTRACE_ENTRY	1
-
-extern void		__xfs_dqtrace_entry(xfs_dquot_t *dqp, char *func,
-					    void *, xfs_inode_t *);
-#define xfs_dqtrace_entry_ino(a,b,ip) \
-		__xfs_dqtrace_entry((a), (b), (void*)__return_address, (ip))
-#define xfs_dqtrace_entry(a,b) \
-		__xfs_dqtrace_entry((a), (b), (void*)__return_address, NULL)
-#else
-#define xfs_dqtrace_entry(a,b)
-#define xfs_dqtrace_entry_ino(a,b,ip)
-#endif
-
 #ifdef QUOTADEBUG
 extern void		xfs_qm_dqprint(xfs_dquot_t *);
 #else
fs/xfs/quota/xfs_qm.c +26 -14
Index: xfs/fs/xfs/quota/xfs_qm.c
===================================================================
@@ -47,6 +47,7 @@
 #include "xfs_trans_space.h"
 #include "xfs_utils.h"
 #include "xfs_qm.h"
+#include "xfs_trace.h"
 
 /*
  * The global quota manager. There is only one of these for the entire
@@ -453,7 +454,7 @@ again:
 			xfs_dqunlock(dqp);
 			continue;
 		}
-		xfs_dqtrace_entry(dqp, "FLUSHALL: DQDIRTY");
+
 		/* XXX a sentinel would be better */
 		recl = XFS_QI_MPLRECLAIMS(mp);
 		if (!xfs_dqflock_nowait(dqp)) {
@@ -651,7 +652,7 @@ xfs_qm_dqattach_one(
 	 */
 	dqp = *IO_idqpp;
 	if (dqp) {
-		xfs_dqtrace_entry(dqp, "DQATTACH: found in ip");
+		trace_xfs_dqattach_found(dqp);
 		return 0;
 	}
 
@@ -704,7 +705,7 @@ xfs_qm_dqattach_one(
 	if (error)
 		return error;
 
-	xfs_dqtrace_entry(dqp, "DQATTACH: found by dqget");
+	trace_xfs_dqattach_get(dqp);
 
 	/*
 	 * dqget may have dropped and re-acquired the ilock, but it guarantees
@@ -890,15 +891,15 @@ xfs_qm_dqdetach(
 	if (!(ip->i_udquot || ip->i_gdquot))
 		return;
 
+	trace_xfs_dquot_dqdetach(ip);
+
 	ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_uquotino);
 	ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_gquotino);
 	if (ip->i_udquot) {
-		xfs_dqtrace_entry_ino(ip->i_udquot, "DQDETTACH", ip);
 		xfs_qm_dqrele(ip->i_udquot);
 		ip->i_udquot = NULL;
 	}
 	if (ip->i_gdquot) {
-		xfs_dqtrace_entry_ino(ip->i_gdquot, "DQDETTACH", ip);
 		xfs_qm_dqrele(ip->i_gdquot);
 		ip->i_gdquot = NULL;
 	}
@@ -977,7 +978,6 @@ xfs_qm_sync(
 		 * across a disk write
 		 */
 		xfs_qm_mplist_unlock(mp);
-		xfs_dqtrace_entry(dqp, "XQM_SYNC: DQFLUSH");
 		error = xfs_qm_dqflush(dqp, flush_flags);
 		xfs_dqunlock(dqp);
 		if (error && XFS_FORCED_SHUTDOWN(mp))
@@ -1350,7 +1350,8 @@ xfs_qm_reset_dqcounts(
 	xfs_disk_dquot_t	*ddq;
 	int			j;
 
-	xfs_buftrace("RESET DQUOTS", bp);
+	trace_xfs_reset_dqcounts(bp, _RET_IP_);
+
 	/*
 	 * Reset all counters and timers. They'll be
 	 * started afresh by xfs_qm_quotacheck.
@@ -1543,7 +1544,9 @@ xfs_qm_quotacheck_dqadjust(
 	xfs_qcnt_t		rtblks)
 {
 	ASSERT(XFS_DQ_IS_LOCKED(dqp));
-	xfs_dqtrace_entry(dqp, "QCHECK DQADJUST");
+
+	trace_xfs_dqadjust(dqp);
+
 	/*
 	 * Adjust the inode count and the block count to reflect this inode's
 	 * resource usage.
@@ -1994,7 +1997,9 @@ xfs_qm_shake_freelist(
 		 */
 		if (XFS_DQ_IS_DIRTY(dqp)) {
 			int	error;
-			xfs_dqtrace_entry(dqp, "DQSHAKE: DQDIRTY");
+
+			trace_xfs_dqshake_dirty(dqp);
+
 			/*
 			 * We flush it delayed write, so don't bother
 			 * releasing the mplock.
@@ -2038,7 +2043,9 @@ xfs_qm_shake_freelist(
 				return nreclaimed;
 			goto tryagain;
 		}
-		xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING");
+
+		trace_xfs_dqshake_unlink(dqp);
+
 #ifdef QUOTADEBUG
 		cmn_err(CE_DEBUG, "Shake 0x%p, ID 0x%x\n",
 			dqp, be32_to_cpu(dqp->q_core.d_id));
@@ -2125,7 +2132,9 @@ xfs_qm_dqreclaim_one(void)
 		 */
 		if (dqp->dq_flags & XFS_DQ_WANT) {
 			ASSERT(! (dqp->dq_flags & XFS_DQ_INACTIVE));
-			xfs_dqtrace_entry(dqp, "DQRECLAIM: DQWANT");
+
+			trace_xfs_dqreclaim_want(dqp);
+
 			xfs_dqunlock(dqp);
 			xfs_qm_freelist_unlock(xfs_Gqm);
 			if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
@@ -2171,7 +2180,9 @@ xfs_qm_dqreclaim_one(void)
 		 */
 		if (XFS_DQ_IS_DIRTY(dqp)) {
 			int	error;
-			xfs_dqtrace_entry(dqp, "DQRECLAIM: DQDIRTY");
+
+			trace_xfs_dqreclaim_dirty(dqp);
+
 			/*
 			 * We flush it delayed write, so don't bother
 			 * releasing the freelist lock.
@@ -2194,8 +2205,9 @@ xfs_qm_dqreclaim_one(void)
 		if (!mutex_trylock(&dqp->q_hash->qh_lock))
 			goto mplistunlock;
 
+		trace_xfs_dqreclaim_unlink(dqp);
+
 		ASSERT(dqp->q_nrefs == 0);
-		xfs_dqtrace_entry(dqp, "DQRECLAIM: UNLINKING");
 		XQM_MPLIST_REMOVE(&(XFS_QI_MPL_LIST(dqp->q_mount)), dqp);
 		XQM_HASHLIST_REMOVE(dqp->q_hash, dqp);
 		XQM_FREELIST_REMOVE(dqp);
@@ -2430,7 +2442,7 @@ xfs_qm_vop_dqalloc(
 		}
 	}
 	if (uq)
-		xfs_dqtrace_entry_ino(uq, "DQALLOC", ip);
+		trace_xfs_dquot_dqalloc(ip);
 
 	xfs_iunlock(ip, lockflags);
 	if (O_udqpp)
fs/xfs/quota/xfs_qm_syscalls.c +1 -3
Index: xfs/fs/xfs/quota/xfs_qm_syscalls.c
===================================================================
@@ -49,6 +49,7 @@
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
 #include "xfs_qm.h"
+#include "xfs_trace.h"
 
 #ifdef DEBUG
 # define qdprintk(s, args...)	cmn_err(CE_DEBUG, s, ## args)
@@ -496,7 +497,6 @@ xfs_qm_scall_setqlim(
 		ASSERT(error != ENOENT);
 		return (error);
 	}
-	xfs_dqtrace_entry(dqp, "Q_SETQLIM: AFT DQGET");
 	xfs_trans_dqjoin(tp, dqp);
 	ddq = &dqp->q_core;
 
@@ -602,7 +602,6 @@ xfs_qm_scall_setqlim(
 	dqp->dq_flags |= XFS_DQ_DIRTY;
 	xfs_trans_log_dquot(tp, dqp);
 
-	xfs_dqtrace_entry(dqp, "Q_SETQLIM: COMMIT");
 	error = xfs_trans_commit(tp, 0);
 	xfs_qm_dqprint(dqp);
 	xfs_qm_dqrele(dqp);
@@ -630,7 +629,6 @@ xfs_qm_scall_getquota(
 		return (error);
 	}
 
-	xfs_dqtrace_entry(dqp, "Q_GETQUOTA SUCCESS");
 	/*
 	 * If everything's NULL, this dquot doesn't quite exist as far as
 	 * our utility programs are concerned.
fs/xfs/support/ktrace.c deleted +0 -323

227 lines not on this page · raw message

fs/xfs/support/ktrace.h deleted +0 -85

85 lines not on this page · raw message

fs/xfs/xfs.h +0 -16
Index: xfs/fs/xfs/xfs.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_ag.h +14 -0
Index: xfs/fs/xfs/xfs_ag.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_alloc.c +44 -186

230 lines not on this page · raw message

fs/xfs/xfs_alloc.h +9 -18
Index: xfs/fs/xfs/xfs_alloc.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_alloc_btree.c +1 -0
Index: xfs/fs/xfs/xfs_alloc_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_attr.c +9 -98

107 lines not on this page · raw message

fs/xfs/xfs_attr.h +10 -0
Index: xfs/fs/xfs/xfs_attr.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_attr_sf.h +0 -40
Index: xfs/fs/xfs/xfs_attr_sf.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_bmap.c +108 -399

507 lines not on this page · raw message

fs/xfs/xfs_bmap.h +29 -20

49 lines not on this page · raw message

fs/xfs/xfs_bmap_btree.c +0 -6
Index: xfs/fs/xfs/xfs_bmap_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_btree.c +3 -2
Index: xfs/fs/xfs/xfs_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_btree_trace.h +0 -17
Index: xfs/fs/xfs/xfs_btree_trace.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_buf_item.c +25 -62

87 lines not on this page · raw message

fs/xfs/xfs_buf_item.h +8 -12
Index: xfs/fs/xfs/xfs_buf_item.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_da_btree.c +2 -1
Index: xfs/fs/xfs/xfs_da_btree.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_da_btree.h +7 -0
Index: xfs/fs/xfs/xfs_da_btree.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dfrag.c +1 -1
Index: xfs/fs/xfs/xfs_dfrag.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2.c +5 -3
Index: xfs/fs/xfs/xfs_dir2.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_block.c +13 -7
Index: xfs/fs/xfs/xfs_dir2_block.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_leaf.c +14 -7
Index: xfs/fs/xfs/xfs_dir2_leaf.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_node.c +17 -10
Index: xfs/fs/xfs/xfs_dir2_node.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_sf.c +17 -9
Index: xfs/fs/xfs/xfs_dir2_sf.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dir2_trace.c deleted +0 -216

216 lines not on this page · raw message

fs/xfs/xfs_dir2_trace.h deleted +0 -72

72 lines not on this page · raw message

fs/xfs/xfs_filestream.c +2 -6
Index: xfs/fs/xfs/xfs_filestream.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_fsops.c +2 -0
Index: xfs/fs/xfs/xfs_fsops.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_iget.c +14 -97

111 lines not on this page · raw message

fs/xfs/xfs_inode.c +9 -58

67 lines not on this page · raw message

fs/xfs/xfs_inode.h +14 -62

76 lines not on this page · raw message

fs/xfs/xfs_inode_item.c +4 -1
Index: xfs/fs/xfs/xfs_inode_item.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_iomap.c +8 -77

85 lines not on this page · raw message

fs/xfs/xfs_iomap.h +8 -0
Index: xfs/fs/xfs/xfs_iomap.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_log.c +53 -128

181 lines not on this page · raw message

fs/xfs/xfs_log_priv.h +6 -14
Index: xfs/fs/xfs/xfs_log_priv.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_log_recover.c +1 -0
Index: xfs/fs/xfs/xfs_log_recover.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_mount.c +2 -0
Index: xfs/fs/xfs/xfs_mount.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_quota.h +8 -0
Index: xfs/fs/xfs/xfs_quota.h
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_rename.c +1 -0
Index: xfs/fs/xfs/xfs_rename.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_rtalloc.c +1 -0
Index: xfs/fs/xfs/xfs_rtalloc.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_rw.c +1 -2
Index: xfs/fs/xfs/xfs_rw.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_trans.h +47 -0

47 lines not on this page · raw message

fs/xfs/xfs_trans_buf.c +26 -36

62 lines not on this page · raw message

fs/xfs/xfs_vnodeops.c +1 -7
Index: xfs/fs/xfs/xfs_vnodeops.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_attr_leaf.c +6 -8
Index: xfs/fs/xfs/xfs_attr_leaf.c
===================================================================

Lines of this file are not shown. View the raw message.

fs/xfs/linux-2.6/xfs_trace.c new file +75 -0

75 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_aops.h +2 -0
Index: xfs/fs/xfs/linux-2.6/xfs_aops.h
===================================================================

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Part of the diff is not shown here. View the raw message.

#3 lore raw
Quoted 11 lines · Christoph Hellwig
Quoted 10 lines · Alex Elder

There is a problem with trace_xfs_bmap_insert(). It is
referenced once (in xfs_bmap_trace_exlist()), but never defined.
The reference does not match the prototype defined for the other bmap tracepoints either.

Rather than trying to figure out what you intended I thought I'd give you a chance to offer a fix. If you do, please just send me an update of that portion of the code if possible. Meanwhile I've commented out that reference and am going to try to complete my review of this patch shortly.

Quoted 5 lines
Quoted 2 lines

Details are in the excerpts below. I didn't add any commentary, I'm just calling attention to the code I'm referring to.

Yeah, that was some debug build that got missed in the last iteration of the patch. Updated version below:

OK, this looks good. Compared to the first time around, I gave it a very cursory review. But we'll get it in.

Quoted 9 lines

Subject: xfs: event tracing support
From: Christoph Hellwig <[email protected]>

Convert the old xfs tracing support that could only be used with the out of tree kdb and xfsidbg patches to use the generic event tracer.

To use it make sure CONFIG_EVENT_TRACING is enabled and then enable all xfs trace channels by:

Quoted 8 lines

echo 1 > /sys/kernel/debug/tracing/events/xfs/enable

or alternatively enable single events by just doing the same in one event subdirectory, e.g.

echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_ihold/enable

or set more complex filters, etc. In Documentation/trace/events.txt all

. . .

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs