aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2010-01-13 20:33:55 -0500
committerAlex Elder <aelder@sgi.com>2010-01-15 16:20:06 -0500
commit3a85cd96d3ab3c6dcf88b81fc6eaddb84e565a43 (patch)
tree9b1cfa8db498d7e76b1aa745254261010814f676 /fs/xfs/linux-2.6
parente09f98606dcc156de1146c209d45a0d6d5f51c3f (diff)
xfs: add tracing to xfs_swap_extents
To be able to diagnose whether the swap extents function is detecting compatible inode data fork configurations for swapping extents, add tracing points to the code to allow us to see the format of the inode forks before and after the swap. Signed-off-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_trace.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h
index c22a608321a3..3353aef50530 100644
--- a/fs/xfs/linux-2.6/xfs_trace.h
+++ b/fs/xfs/linux-2.6/xfs_trace.h
@@ -1414,6 +1414,59 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
1414 __entry->count) 1414 __entry->count)
1415); 1415);
1416 1416
1417#define XFS_SWAPEXT_INODES \
1418 { 0, "target" }, \
1419 { 1, "temp" }
1420
1421#define XFS_INODE_FORMAT_STR \
1422 { 0, "invalid" }, \
1423 { 1, "local" }, \
1424 { 2, "extent" }, \
1425 { 3, "btree" }
1426
1427DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1428 TP_PROTO(struct xfs_inode *ip, int which),
1429 TP_ARGS(ip, which),
1430 TP_STRUCT__entry(
1431 __field(dev_t, dev)
1432 __field(int, which)
1433 __field(xfs_ino_t, ino)
1434 __field(int, format)
1435 __field(int, nex)
1436 __field(int, max_nex)
1437 __field(int, broot_size)
1438 __field(int, fork_off)
1439 ),
1440 TP_fast_assign(
1441 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1442 __entry->which = which;
1443 __entry->ino = ip->i_ino;
1444 __entry->format = ip->i_d.di_format;
1445 __entry->nex = ip->i_d.di_nextents;
1446 __entry->max_nex = ip->i_df.if_ext_max;
1447 __entry->broot_size = ip->i_df.if_broot_bytes;
1448 __entry->fork_off = XFS_IFORK_BOFF(ip);
1449 ),
1450 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1451 "Max in-fork extents %d, broot size %d, fork offset %d",
1452 MAJOR(__entry->dev), MINOR(__entry->dev),
1453 __entry->ino,
1454 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1455 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1456 __entry->nex,
1457 __entry->max_nex,
1458 __entry->broot_size,
1459 __entry->fork_off)
1460)
1461
1462#define DEFINE_SWAPEXT_EVENT(name) \
1463DEFINE_EVENT(xfs_swap_extent_class, name, \
1464 TP_PROTO(struct xfs_inode *ip, int which), \
1465 TP_ARGS(ip, which))
1466
1467DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1468DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1469
1417#endif /* _TRACE_XFS_H */ 1470#endif /* _TRACE_XFS_H */
1418 1471
1419#undef TRACE_INCLUDE_PATH 1472#undef TRACE_INCLUDE_PATH