xfs: event tracing support
PATCH 1/1 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. A few areas are not converted to this model yet, most significantly the buffer and but item tracing, quota and parts of the allocator. I will continue to work on this but really want to get this out for review and testing ASAP so it can go into 2.6.32.
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 in the 2.6.32 cycle.
And the really nice thing about this patch is that it actually removes many lines of code while adding this nice functionality:
69 files changed, 1893 insertions(+), 2451 deletions(-)
fs/xfs/Makefile +1 -5
@@ -90,8 +90,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 +112,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
@@ -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 +38 -73
325 lines not on this page · raw message
fs/xfs/linux-2.6/xfs_buf.h +22 -11
@@ -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_bextern 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 +6 -101
168 lines not on this page · raw message
fs/xfs/linux-2.6/xfs_super.h +0 -7
@@ -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
@@ -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 +1255 -0
1,255 lines not on this page · raw message
fs/xfs/linux-2.6/xfs_vnode.h +5 -0
@@ -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 +2 -55
90 lines not on this page · raw message
fs/xfs/quota/xfs_dquot.h +0 -21
@@ -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 +3 -1
@@ -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
@@ -1350,7 +1351,8 @@ xfs_qm_reset_dqcounts(xfs_disk_dquot_t *ddq;int j; -xfs_buftrace ("RESET DQUOTS" , bp); +xfs_buftrace (bp,"reset_dquots" ); +/* * Reset all counters and timers. They'll be * started afresh by xfs_qm_quotacheck.
fs/xfs/quota/xfs_qm_syscalls.c +1 -0
@@ -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)
fs/xfs/support/ktrace.c deleted +0 -323
323 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
@@ -25,21 +25,5 @@/* #define QUOTADEBUG 1 */ #endif -#ifdef CONFIG_XFS_TRACE -#define XFS_ALLOC_TRACE 1 -#define XFS_ATTR_TRACE 1 -#define XFS_BLI_TRACE 1 -#define XFS_BMAP_TRACE 1 -#define XFS_BTREE_TRACE 1 -#define XFS_DIR2_TRACE 1 -#define XFS_DQUOT_TRACE 1 -#define XFS_ILOCK_TRACE 1 -#define XFS_LOG_TRACE 1 -#define XFS_RW_TRACE 1 -#define XFS_BUF_TRACE 1 -#define XFS_INODE_TRACE 1 -#define XFS_FILESTREAMS_TRACE 1 -#endif -#include <linux-2.6/xfs_linux.h> #endif /* __XFS_H__ */
fs/xfs/xfs_ag.h +14 -0
@@ -86,6 +86,20 @@ typedef struct xfs_agf {#define XFS_AGF_NUM_BITS 12#define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1) +#define XFS_AGF_FLAGS \ + { XFS_AGF_MAGICNUM, "MAGICNUM" }, \ + { XFS_AGF_VERSIONNUM, "VERSIONNUM" }, \ + { XFS_AGF_SEQNO, "SEQNO" }, \ + { XFS_AGF_LENGTH, "LENGTH" }, \ + { XFS_AGF_ROOTS, "ROOTS" }, \ + { XFS_AGF_LEVELS, "LEVELS" }, \ + { XFS_AGF_FLFIRST, "FLFIRST" }, \ + { XFS_AGF_FLLAST, "FLLAST" }, \ + { XFS_AGF_FLCOUNT, "FLCOUNT" }, \ + { XFS_AGF_FREEBLKS, "FREEBLKS" }, \ + { XFS_AGF_LONGEST, "LONGEST" }, \ + { XFS_AGF_BTREEBLKS, "BTREEBLKS" } +/* disk block (xfs_daddr_t) in the AG */ #define XFS_AGF_DADDR (mp) ((xfs_daddr_t)(1 << (mp)->m_sectbb_log))#define XFS_AGF_BLOCK (mp) XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp))
fs/xfs/xfs_alloc.c +44 -185
218 lines not on this page · raw message
fs/xfs/xfs_attr.c +9 -98
107 lines not on this page · raw message
fs/xfs/xfs_bmap.c +112 -365
477 lines not on this page · raw message
fs/xfs/xfs_buf_item.c +9 -47
56 lines not on this page · 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_iget.c +14 -97
111 lines not on this page · raw message
fs/xfs/xfs_inode.c +5 -58
63 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_iomap.c +8 -77
85 lines not on this page · raw message
fs/xfs/xfs_log.c +55 -126
181 lines not on this page · raw message
fs/xfs/xfs_trans.h +47 -0
47 lines not on this page · 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.
Quoted 2 lines · Christoph Hellwig
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.
...
Here's my review. I've deleted most of the content, leaving the names of the files that I have comments on, and including only the context in question. Hopefully that's not confusing. In general, I like this change, and like the flexibility of the generic tracing mechanism.
I don't see any outright errors, just have a few questions. A bunch of my comments here are "why are no longer tracing this information," but I also see that you've added and/or completed some tracing of information that was not captured before. There are some others where you have some trivial macros that I'd just as soon see eliminated.
I have initiated some discussions internal to SGI about the impact of this change and hope to have an answer about accepting this in the next few days so we can get it in during this merge window if possible. No promises yet, but I'm working on it.
I have not tried using the code at all at this point, just did a review.
-Alex
fs/xfs/linux-2.6/xfs_buf.c _xfs_buf_initialize( · line 258
Quoted 13 lines
Index:
xfs/fs/xfs/linux-2.6/xfs_buf.c
===================================================================fs/xfs/linux-2.6/xfs_buf.c +1
-1@@ -279,7 +252,7 @@ _xfs_buf_initialize(init_waitqueue_head (&bp->b_waiters);XFS_STATS_INC (xb_create); -XB_TRACE (bp,"initialize" , target); +xfs_buftrace (bp,"initialize" ); }/*
Is "target" no longer useful information? (Why not xfs_buftrace_val()?)
fs/xfs/linux-2.6/xfs_buf.c xfs_buf_rele( · line 838
Quoted 9 lines
fs/xfs/linux-2.6/xfs_buf.c +1
-1@@ -859,7 +832,7 @@ xfs_buf_rele( {xfs_bufhash_t *hash = bp->b_hash; -XB_TRACE (bp,"rele" , bp->b_relse); +xfs_buftrace (bp,"rele" );if (unlikely (!hash)) {ASSERT (!bp->b_relse);
Is "bp->b_relse" no longer useful information? Always the same value (it can be NULL for error paths)?
fs/xfs/linux-2.6/xfs_buf.c xfs_buf_iodone_work( · line 1015
Quoted 9 lines
fs/xfs/linux-2.6/xfs_buf.c +1
-1@@ -1035,7 +1009,7 @@ xfs_buf_iodone_work(*/ if ((bp->b_error ==EOPNOTSUPP ) && (bp->b_flags & (XBF_ORDERED |XBF_ASYNC )) == (XBF_ORDERED |XBF_ASYNC )) { -XB_TRACE (bp,"ordered_retry" , bp->b_iodone); +xfs_buftrace (bp,"ordered_retry" ); bp->b_flags &= ~XBF_ORDERED ; bp->b_flags |= _XFS_BARRIER_FAILED;xfs_buf_iorequest (bp);
Is "bp->b_iodone" no longer useful information? Always the same value?
fs/xfs/linux-2.6/xfs_lrw.c +0 -0
fs/xfs/linux-2.6/xfs_buf.c start: · line 656
Quoted 9 lines
fs/xfs/linux-2.6/xfs_buf.c +0
-2@@ -712,8 +651,6 @@ start:if ((ioflags &IO_ISDIRECT )) {if (mapping->nrpages) {WARN_ON (need_i_mutex ==0 ); -xfs_inval_cached_trace (xip, pos,-1 , - (pos &PAGE_CACHE_MASK ),-1 ); error =xfs_flushinval_pages (xip, (pos &PAGE_CACHE_MASK ),-1 ,FI_REMAPF_LOCKED );
Why are you eliminating tracing of this event (here and elsewhere)?
fs/xfs/linux-2.6/xfs_super.c line 76
Quoted 13 lines
Index:
xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================fs/xfs/linux-2.6/xfs_super.c +2
-0@@ -67,6 +69,8 @@#include <linux/freezer.h> #include <linux/parser.h> + +static struct super_operations xfs_super_operations;static kmem_zone_t *xfs_ioend_zone;mempool_t *xfs_ioend_pool;
Pretty blanky.
Quoted 4 lines
Index:
xfs/fs/xfs/linux-2.6/xfs_trace.h
===================================================================fs/xfs/linux-2.6/xfs_trace.h new file +0
-0
...
Quoted 3 lines
fs/xfs/linux-2.6/xfs_trace.h new file +3
-0+#define xfs_buf_item_trace (id, bip) \ + trace_xfs_buf_item((id), (bip)); +
...
fs/xfs/linux-2.6/xfs_trace.h
Quoted 4 lines
fs/xfs/linux-2.6/xfs_trace.h new file +4
-0+#define xfs_dqtrace_entry_ino (dqp, func, ip) \ + trace_xfs_dquot((dqp), (func), (ip)); +#define xfs_dqtrace_entry (dqp, func) \ + trace_xfs_dquot((dqp), (func), NULL)
Get rid of these macros, just replace calls to them with the "normally" spelled macros (trace_xfs_dquot(), trace_xfs_buf_item()).
Quoted 13 lines
fs/xfs/linux-2.6/xfs_trace.h new file +13
-0+#define DEFINE_LOCK_EVENT (name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ + unsigned long caller_ip), \ + TP_ARGS(ip, lock_flags, caller_ip), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(int, lock_flags) \ + __field(unsigned long, caller_ip) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \
fs/xfs/linux-2.6/xfs_trace.h
Quoted 10 lines
fs/xfs/linux-2.6/xfs_trace.h new file +10
-0+ __entry->ino = ip->i_ino; \ + __entry->lock_flags = lock_flags; \ + __entry->caller_ip = caller_ip; \ + ), \ +TP_printk ("dev %d:%d ino 0x%llx flags %s caller %pf" , \ +MAJOR (__entry->dev),MINOR (__entry->dev), \ + __entry->ino, \ +__print_flags (__entry->lock_flags,"|" ,XFS_LOCK_FLAGS ), \ + (void *)__entry->caller_ip) \ +)
Incorporate _RET_IP_ here rather than passing in caller_ip in all call sites.
+/* XXX: make generic? */
+#define XFS_BUSY_STATES \
+ { 0, "found" }, \
+ { 1, "missing" }
How generic do you want to make it? If the sense were inverted you could use a Boolean value (i.e., __entry->found = true or false).
+#define xfs_trace_agf(mp, agf, flags) \
+ trace_xfs_agf(mp, agf, flags, _THIS_IP_)
Get rid of this macro, just replace calls to it with its "normal" spelling (trace_xfs_agf()). There's no reason you can't use _THIS_IP_ in the TRACE_EVENT() macro, right?
+#define xfs_trace_alloc_extent(args, str) \
+ trace_xfs_alloc_extent(args, str, _THIS_IP_)
Same as above. Get rid of this macro and replace calls to it with its "normal" spelling (trace_xfs_alloc_extent()).
Quoted 4 lines
Index:
xfs/fs/xfs/xfs_attr.c
===================================================================fs/xfs/xfs_attr.c +0
-0
...
fs/xfs/xfs_attr.c xfs_attr_node_list(xfs_attr_list_context · line 1850
Quoted 9 lines
fs/xfs/xfs_attr.c +1
-1@@ -1849,7 +1844,7 @@ xfs_attr_node_list(xfs_attr_list_context node = bp->data;switch (be16_to_cpu (node->hdr.info.magic)) {case XFS_DA_NODE_MAGIC : -xfs_attr_trace_l_cn ("wrong blk" , context, node); +trace_xfs_attr_list_wrong_blk (context);xfs_da_brelse (NULL , bp); bp =NULL ;break ;
Is "node" no longer useful information?
Quoted 8 lines
fs/xfs/xfs_attr.c +1
-2@@ -1857,20 +1852,18 @@ xfs_attr_node_list(xfs_attr_list_context leaf = bp->data;if (cursor->hashval >be32_to_cpu (leaf->entries[be16_to_cpu (leaf->hdr.count)-1 ].hashval)) { -xfs_attr_trace_l_cl ("wrong blk" , - context, leaf); +trace_xfs_attr_list_wrong_blk (context);xfs_da_brelse (NULL , bp);
fs/xfs/xfs_attr.c xfs_attr_node_list(xfs_attr_list_context · line 1864
Quoted 10 lines
fs/xfs/xfs_attr.c +1
-2bp =NULL ; }else if (cursor->hashval <=be32_to_cpu (leaf->entries[0 ].hashval)) { -xfs_attr_trace_l_cl ("maybe wrong blk" , - context, leaf); +trace_xfs_attr_list_wrong_blk (context);xfs_da_brelse (NULL , bp); bp =NULL ; }break ;
...
Is "leaf" no longer useful information?
Quoted 6 lines
Index:
xfs/fs/xfs/xfs_bmap.c
===================================================================fs/xfs/xfs_bmap.c +0
-0@@ -398,6 +322,11 @@ xfs_bmap_disk_count_leaves( int numrecs,
fs/xfs/xfs_bmap.c xfs_bmap_disk_count_leaves( · line 332
Quoted 10 lines
fs/xfs/xfs_bmap.c +5
-0int *count); +#define xfs_trace_bmap_post_update (d, ip, i, w) \ + trace_xfs_bmap_post_update(ip, i, w, d) +#define xfs_trace_bmap_pre_update (d, ip, i, w) \ + trace_xfs_bmap_pre_update(ip, i, w, d) +/* * Bmap internal routines. */
Get rid of these macros, just replace calls to them with their "normal" spelling (i.e., trace_xfs_bmap_...).
Quoted 5 lines
Index:
xfs/fs/xfs/xfs_dir2_block.c
===================================================================
fs/xfs/xfs_dir2_block.c xfs_dir2_leaf_to_block( · line 908
Quoted 9 lines
fs/xfs/xfs_dir2_block.c +2
-1@@ -897,7 +901,8 @@ xfs_dir2_leaf_to_block(int to;/* block/leaf to index */ xfs_trans_t *tp;/* transaction pointer */ -xfs_dir2_trace_args_bb ("leaf_to_block" , args, lbp, dbp); +trace_xfs_dir2_leaf_to_block (args); + dp = args->dp; tp = args->trans; mp = dp->i_mount;
Are the disk address buffer pointers in traces like this one no longer useful information?
Quoted 5 lines
Index:
xfs/fs/xfs/xfs_dir2_node.c
===================================================================
fs/xfs/xfs_dir2_node.c xfs_dir2_leaf_to_node( · line 130
Quoted 9 lines
fs/xfs/xfs_dir2_node.c +2
-1@@ -123,7 +123,8 @@ xfs_dir2_leaf_to_node(__be16 *to;/* pointer to freespace entry */ xfs_trans_t *tp;/* transaction pointer */ -xfs_dir2_trace_args_b ("leaf_to_node" , args, lbp); +trace_xfs_dir2_leaf_to_node (args); + dp = args->dp; mp = dp->i_mount; tp = args->trans;
Another disk address buffer pointer trace. I'll refrain from commenting on the others.
Quoted 5 lines
Index:
xfs/fs/xfs/xfs_dir2_sf.c
===================================================================
fs/xfs/xfs_dir2_sf.c xfs_dir2_sf_create( · line 663
Quoted 9 lines
fs/xfs/xfs_dir2_sf.c +2
-1@@ -654,7 +656,8 @@ xfs_dir2_sf_create(xfs_dir2_sf_t *sfp;/* shortform structure */ int size;/* directory size */ -xfs_dir2_trace_args_i ("sf_create" , args, pino); +trace_xfs_dir2_sf_create (args); + dp = args->dp;ASSERT (dp !=NULL );
Is the parent inode number no longer useful information?
Quoted 5 lines
Index:
xfs/fs/xfs/xfs_error.c
===================================================================
fs/xfs/xfs_error.c xfs_corruption_error( · line 226
Quoted 10 lines
fs/xfs/xfs_error.c +7
-0@@ -217,3 +217,19 @@ xfs_corruption_error(xfs_hex_dump (p,16 );xfs_error_report (tag, level, mp, fname, linenum, ra); } + +/* +* Format fsblock number into a static buffer & return it. +*/ +char *xfs_fmtfsblock (xfs_fsblock_t bno) +{ +static char rval[50 ];
Why 50? 37 is enough for +/- 2^63, and 50 isn't really much better than that for alignment or anything. Not a big deal.
Quoted 13 lines
Index:
xfs/fs/xfs/xfs_rw.c
===================================================================fs/xfs/xfs_rw.c +0
-1@@ -171,7 +172,6 @@ xfs_bioerror(* No need to wait until the buffer is unpinned. * We aren't flushing it. */ -xfs_buftrace ("XFS IOERROR" , bp);XFS_BUF_ERROR (bp,EIO );/* * We're calling biodone, so delete B_DONE flag. Either way
fs/xfs/xfs_rw.c xfs_bioerror_relse( · line 210
Quoted 7 lines
fs/xfs/xfs_rw.c +0
-1@@ -205,7 +205,6 @@ xfs_bioerror_relse(ASSERT (XFS_BUF_IODONE_FUNC (bp) != xfs_buf_iodone_callbacks);ASSERT (XFS_BUF_IODONE_FUNC (bp) != xlog_iodone); -xfs_buftrace ("XFS IOERRELSE" , bp); fl =XFS_BUF_BFLAGS (bp);/* * No need to wait until the buffer is unpinned.
Why are you dropping tracing of these cases?
Quoted 13 lines
Index:
xfs/fs/xfs/xfs_vnodeops.c
===================================================================fs/xfs/xfs_vnodeops.c +1
-0@@ -53,6 +53,7 @@#include "xfs_log_priv.h" #include "xfs_filestream.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" int xfs_setattr(
fs/xfs/xfs_vnodeops.c xfs_lookup( · line 1386
Quoted 7 lines
fs/xfs/xfs_vnodeops.c +0
-1@@ -1380,7 +1381,6 @@ xfs_lookup(if (error) goto out_free_name; -xfs_itrace_ref (*ipp);return 0 ; out_free_name:
Why are you dropping tracing where xfs_itrace_ref() and xfs_itrace_exit() was being called (here and elsewhere)? Other than the spots where xfs_itrace_exit_tag() was used.
fs/xfs/xfs_attr_leaf.c
Quoted 12 lines
Index:
xfs/fs/xfs/xfs_attr_leaf.c
===================================================================fs/xfs/xfs_attr_leaf.c +0
-1@@ -653,7 +654,6 @@ xfs_attr_shortform_list(xfs_attr_list_coXFS_CORRUPTION_ERROR ("xfs_attr_shortform_list" ,XFS_ERRLEVEL_LOW , context->dp->i_mount, sfe); -xfs_attr_trace_l_c ("sf corrupted" , context);kmem_free (sbuf);return XFS_ERROR (EFSCORRUPTED ); }
Why are you dropping tracing of the returns from this function? Too much output?
fs/xfs/xfs_attr_leaf.c xfs_attr_leaf_list_int(xfs_dabuf_t *bp, · line 2327
Quoted 9 lines
fs/xfs/xfs_attr_leaf.c +1
-1@@ -2323,7 +2321,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, cursor = context->cursor; cursor->initted =1 ; -xfs_attr_trace_l_cl ("blk start" , context, leaf); +trace_xfs_attr_list_leaf (context);/* * Re-find our place in the leaf block if this is a new syscall.
Is "leaf" no longer useful information?
fs/xfs/xfs_attr_leaf.c xfs_attr_leaf_list_int(xfs_dabuf_t *bp, · line 2422
Quoted 8 lines
fs/xfs/xfs_attr_leaf.c +1
-1@@ -2419,7 +2417,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp,break ; cursor->offset++; } -xfs_attr_trace_l_cl ("blk end" , context, leaf); +trace_xfs_attr_list_leaf_end (context);return (retval); }
Is "leaf" no longer useful information?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 8 lines · Alex Elder
Review
Quoted 6 lines
(quoted diff) +1
-1XFS_STATS_INC(xb_create); - XB_TRACE(bp, "initialize", target); + xfs_buftrace(bp, "initialize"); } /*Is "target" no longer useful information? (Why not
xfs_buftrace_val()?)
The target itself is not really useful information. We still trace the device it's on inside the tracer which is the most important information.
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0
-0@@ -859,7 +832,7 @@ xfs_buf_rele( { xfs_bufhash_t *hash = bp->b_hash;
Quoted 8 lines
Review xfs_buf_rele( · line 838
Quoted 5 lines
(quoted diff) +1
-1- XB_TRACE(bp, "rele", bp->b_relse); + xfs_buftrace(bp, "rele"); if (unlikely(!hash)) { ASSERT(!bp->b_relse);Is "
bp->b_relse" no longer useful information? Always the same value (it can be NULL for error paths)?
The function pointer values aren't too useful information in a user trace, while previously they were a bit more useful using kdb. If you really want it I can add it back using the in-kernel symbol lookup so that we'll actually get a useful name back.
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0
-0@@ -1035,7 +1009,7 @@ xfs_buf_iodone_work( */ if ((bp->b_error == EOPNOTSUPP) && (bp->b_flags & (XBF_ORDERED|XBF_ASYNC)) == (XBF_ORDERED|XBF_ASYNC)) {
Quoted 8 lines
Review xfs_buf_iodone_work( · line 1015
Quoted 5 lines
(quoted diff) +1
-1- XB_TRACE(bp, "ordered_retry", bp->b_iodone); + xfs_buftrace(bp, "ordered_retry"); bp->b_flags &= ~XBF_ORDERED; bp->b_flags |= _XFS_BARRIER_FAILED; xfs_buf_iorequest(bp);Is "
bp->b_iodone" no longer useful information? Always the same value?
Same argument as above.
Quoted 7 lines
Index:
xfs/fs/xfs/linux-2.6/xfs_lrw.c
===================================================================fs/xfs/linux-2.6/xfs_lrw.c +0
-0Quoted 3 lines
(quoted diff) +0
-0@@ -712,8 +651,6 @@ start: if ((ioflags & IO_ISDIRECT)) { if (mapping->nrpages) {
Quoted 8 lines
Review start: · line 656
Quoted 6 lines
(quoted diff) +0
-2WARN_ON(need_i_mutex == 0); - xfs_inval_cached_trace(xip, pos, -1, - (pos & PAGE_CACHE_MASK), -1); error = xfs_flushinval_pages(xip, (pos & PAGE_CACHE_MASK), -1, FI_REMAPF_LOCKED);Why are you eliminating tracing of this event (here and elsewhere)?
It's moved into xfs_flushinval_pages from the callers.
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +2
-0+ + static struct super_operations xfs_super_operations; static kmem_zone_t *xfs_ioend_zone; mempool_t *xfs_ioend_pool;Pretty blanky.
Fixed.
Quoted 7 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+#define xfs_dqtrace_entry_ino(dqp, func, ip) \ + trace_xfs_dquot((dqp), (func), (ip)); +#define xfs_dqtrace_entry(dqp, func) \ + trace_xfs_dquot((dqp), (func), NULL)Get rid of these macros, just replace calls to them with the "normally" spelled macros (
trace_xfs_dquot(),trace_xfs_buf_item()).
Yeah. This will change a bit in the next repositing by switching to the per-callsite tracepoints already used elsewhere in the patch.
Quoted 10 lines
Review
Quoted 7 lines
(quoted diff) +7
-0+ ), \ + TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), \ + (void *)__entry->caller_ip) \ +)Incorporate _RET_IP_ here rather than passing in
caller_ipin all call sites.
We can't. We want the caller of the lock functions, not the caller of the tracing handler which is either the lock function itself or some garbage. I hope to wotk with the trace infrastructure people to get some nicer way to catch the caller ip, though..
Quoted 8 lines
fs/xfs/linux-2.6/xfs_lrw.c +4
-0+/* XXX: make generic? */ +#define XFS_BUSY_STATES \ + { 0, "found" }, \ + { 1, "missing" }How generic do you want to make it? If the sense were inverted you could use a Boolean value (i.e.,
__entry->found= true or false).
Hmm, I could do it that way. For now it's just found/missing, but we could change it to a found true/false
Quoted 7 lines
fs/xfs/linux-2.6/xfs_lrw.c +2
-0+#define xfs_trace_agf (mp, agf, flags) \ + trace_xfs_agf(mp, agf, flags, _THIS_IP_)Get rid of this macro, just replace calls to it with its "normal" spelling (
trace_xfs_agf()). There's no reason you can't use _THIS_IP_ in theTRACE_EVENT()macro, right?
I can use it, but it gives the wrong result. TRACE_EVENT expends to an attachment point in the caller, and a function to do the tracing. We only binary patch a call to the tracing function onto the callsite if tracing is enabled - that way the overhead for tracing is low if not dynamically enabled.
Quoted 11 lines
Review xfs_attr_node_list(xfs_attr_list_context · line 1850
Quoted 9 lines
(quoted diff) +1
-1@@ -1849,7 +1844,7 @@ xfs_attr_node_list(xfs_attr_list_context node = bp->data; switch (be16_to_cpu(node->hdr.info.magic)) { case XFS_DA_NODE_MAGIC: - xfs_attr_trace_l_cn("wrong blk", context, node); + trace_xfs_attr_list_wrong_blk(context); xfs_da_brelse(NULL, bp); bp = NULL; break;Is "node" no longer useful information?
I don't think it ever was. What we do here is to walk the attr btree to find our curosr position, and trace if we found a wrong entry in the btree. I can't see how we need additional information about the exact node we ended up. This trace point has been there since 1995 almost unmodified and I can't remember anyone needing it - it's mostly left in for completeness.
Quoted 1 line
Is "leaf" no longer useful information?
Same here.
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +5
-0+#define xfs_trace_bmap_post_update(d, ip, i, w) \ + trace_xfs_bmap_post_update(ip, i, w, d) +#define xfs_trace_bmap_pre_update(d, ip, i, w) \ + trace_xfs_bmap_pre_update(ip, i, w, d) + /* * Bmap internal routines. */Get rid of these macros, just replace calls to them with their "normal" spelling (i.e.,
trace_xfs_bmap_...).
Yeah, this area also needs a bit more love anyway.
Quoted 8 lines
Quoted 8 lines
Index:
xfs/fs/xfs/xfs_dir2_block.c
===================================================================fs/xfs/xfs_dir2_block.c +0
-0@@ -897,7 +901,8 @@ xfs_dir2_leaf_to_block(int to;/* block/leaf to index */ xfs_trans_t *tp;/* transaction pointer */
Quoted 9 lines
fs/xfs/xfs_dir2_block.c xfs_dir2_leaf_to_block( · line 908
Quoted 6 lines
fs/xfs/xfs_dir2_block.c +2
-1-xfs_dir2_trace_args_bb ("leaf_to_block" , args, lbp, dbp); +trace_xfs_dir2_leaf_to_block (args); + dp = args->dp; tp = args->trans; mp = dp->i_mount;Are the disk address buffer pointers in traces like this one no longer useful information?
We can't do anything with pointers to buffers in userspace - they are usually gone by the time we read the trace (same for kdb without an actualy crash). Note that if you need them in a special case the tracepoints allow attaching manually written tracing code easily without modifying the xfs kernel module. I will post some examples for that after the merge window stress is over.
Quoted 5 lines
Quoted 5 lines
+++
xfs/fs/xfs/xfs_dir2_sf.c2009-09-09 12:49:11.317273917 -0300fs/xfs/xfs_dir2_block.c +0
-0@@ -654,7 +656,8 @@ xfs_dir2_sf_create(xfs_dir2_sf_t *sfp;/* shortform structure */ int size;/* directory size */
Quoted 8 lines
fs/xfs/xfs_dir2_block.c xfs_dir2_sf_create( · line 663
Quoted 6 lines
fs/xfs/xfs_dir2_block.c +2
-1-xfs_dir2_trace_args_i ("sf_create" , args, pino); +trace_xfs_dir2_sf_create (args); + dp = args->dp;ASSERT (dp !=NULL );Is the parent inode number no longer useful information?
I don't think it ever was.
Quoted 10 lines
Quoted 10 lines
Index:
xfs/fs/xfs/xfs_error.c
===================================================================fs/xfs/xfs_error.c +2
-0@@ -217,3 +217,19 @@ xfs_corruption_error(xfs_hex_dump (p,16 );xfs_error_report (tag, level, mp, fname, linenum, ra); } + +/*
Quoted 8 lines
fs/xfs/xfs_error.c xfs_corruption_error( · line 226
Quoted 5 lines
fs/xfs/xfs_error.c +5
-0+* Format fsblock number into a static buffer & return it. +*/ +char *xfs_fmtfsblock (xfs_fsblock_t bno) +{ +static char rval[50 ];Why 50? 37 is enough for +/- 2^63, and 50 isn't really much better than that for alignment or anything. Not a big deal.
This function was copied from xfsidbg. No idea why it choses the magic number..
Quoted 24 lines
Quoted 13 lines
Index:
xfs/fs/xfs/xfs_rw.c
===================================================================fs/xfs/xfs_rw.c +0
-1@@ -171,7 +172,6 @@ xfs_bioerror(* No need to wait until the buffer is unpinned. * We aren't flushing it. */ -xfs_buftrace ("XFS IOERROR" , bp);XFS_BUF_ERROR (bp,EIO );/* * We're calling biodone, so delete B_DONE flag. Either way fs/xfs/xfs_rw.c xfs_bioerror_relse( · line 210
Quoted 7 lines
fs/xfs/xfs_rw.c +0
-1@@ -205,7 +205,6 @@ xfs_bioerror_relse(ASSERT (XFS_BUF_IODONE_FUNC (bp) != xfs_buf_iodone_callbacks);ASSERT (XFS_BUF_IODONE_FUNC (bp) != xlog_iodone); -xfs_buftrace ("XFS IOERRELSE" , bp); fl =XFS_BUF_BFLAGS (bp);/* * No need to wait until the buffer is unpinned. Why are you dropping tracing of these cases?
Quoted 3 lines
Why are you dropping tracing where
xfs_itrace_ref()andxfs_itrace_exit()was being called (here and elsewhere)? Other than the spots wherexfs_itrace_exit_tag()was used.
These are replaced by the increased tracing in iget, instead of tracing inodes sometimes in iget and then in the callers we now make sure to trace all inodes in iget.
Quoted 16 lines
fs/xfs/xfs_attr_leaf.c
Quoted 13 lines
Index:
xfs/fs/xfs/xfs_attr_leaf.c
===================================================================fs/xfs/xfs_attr_leaf.c +0
-1@@ -653,7 +654,6 @@ xfs_attr_shortform_list(xfs_attr_list_coXFS_CORRUPTION_ERROR ("xfs_attr_shortform_list" ,XFS_ERRLEVEL_LOW , context->dp->i_mount, sfe); -xfs_attr_trace_l_c ("sf corrupted" , context);kmem_free (sbuf);return XFS_ERROR (EFSCORRUPTED ); }Why are you dropping tracing of the returns from this function? Too much output?
This and the others are dropped because I really couldn't find a use for it. Many other attr tracepoints are pretty borderline, too - did anyone on hte list ever use the attr tracing in kdb, btw?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Updated version below, mostly making the buffer and quota tracing fit the one tracepoint per caller model. Note that the buf item trace points now are strict supersets of the buffer tracepoints, so a lot of duplication in that area was cleaned up. The alloc and bmap tracers still need some loving, but that's not a merge blocker to me as it's relatively small incremental changes.
8,244 lines not shown · raw message
Part of this message is not shown here. View the raw message.