aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-06-23 21:57:09 -0400
committerAlex Elder <aelder@sgi.com>2010-07-26 14:16:44 -0400
commitcca28fb83d9e60779bb348edc33a62068e5f04a4 (patch)
tree182ab465eadfb00ff4e1d0717b6dea127cba18e3 /fs/xfs/linux-2.6
parentf2d6761433d69d94e0b39ac44ef0f0f0b0508065 (diff)
xfs: split xfs_itrace_entry
Replace the xfs_itrace_entry catchall with specific trace points. For most simple callers we now use the simple inode class, which used to be the iget class, but add more details tracing for namespace events, which now includes the name of the directory entries manipulated. Remove the xfs_inactive trace point, which is a duplicate of the clear_inode one, and the xfs_change_file_space trace point, which is immediately followed by the more specific alloc/free space trace points. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_acl.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl32.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c7
-rw-r--r--fs/xfs/linux-2.6/xfs_trace.h115
8 files changed, 102 insertions, 34 deletions
diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c
index 9f769b5b38fc..b2771862fd3d 100644
--- a/fs/xfs/linux-2.6/xfs_acl.c
+++ b/fs/xfs/linux-2.6/xfs_acl.c
@@ -225,7 +225,7 @@ xfs_check_acl(struct inode *inode, int mask)
225 struct posix_acl *acl; 225 struct posix_acl *acl;
226 int error = -EAGAIN; 226 int error = -EAGAIN;
227 227
228 xfs_itrace_entry(ip); 228 trace_xfs_check_acl(ip);
229 229
230 /* 230 /*
231 * If there is no attribute fork no ACL exists on this inode and 231 * If there is no attribute fork no ACL exists on this inode and
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 88ce1c6efff0..ed9c3db376c3 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1513,7 +1513,7 @@ xfs_vm_bmap(
1513 struct inode *inode = (struct inode *)mapping->host; 1513 struct inode *inode = (struct inode *)mapping->host;
1514 struct xfs_inode *ip = XFS_I(inode); 1514 struct xfs_inode *ip = XFS_I(inode);
1515 1515
1516 xfs_itrace_entry(XFS_I(inode)); 1516 trace_xfs_vm_bmap(XFS_I(inode));
1517 xfs_ilock(ip, XFS_IOLOCK_SHARED); 1517 xfs_ilock(ip, XFS_IOLOCK_SHARED);
1518 xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); 1518 xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
1519 xfs_iunlock(ip, XFS_IOLOCK_SHARED); 1519 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 22edad7a0bec..3447555e9f76 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -100,7 +100,7 @@ xfs_file_fsync(
100 int error = 0; 100 int error = 0;
101 int log_flushed = 0; 101 int log_flushed = 0;
102 102
103 xfs_itrace_entry(ip); 103 trace_xfs_file_fsync(ip);
104 104
105 if (XFS_FORCED_SHUTDOWN(ip->i_mount)) 105 if (XFS_FORCED_SHUTDOWN(ip->i_mount))
106 return -XFS_ERROR(EIO); 106 return -XFS_ERROR(EIO);
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index a12dddad126e..237f5ffb2ee8 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -899,7 +899,7 @@ xfs_ioctl_setattr(
899 struct xfs_dquot *olddquot = NULL; 899 struct xfs_dquot *olddquot = NULL;
900 int code; 900 int code;
901 901
902 xfs_itrace_entry(ip); 902 trace_xfs_ioctl_setattr(ip);
903 903
904 if (mp->m_flags & XFS_MOUNT_RDONLY) 904 if (mp->m_flags & XFS_MOUNT_RDONLY)
905 return XFS_ERROR(EROFS); 905 return XFS_ERROR(EROFS);
@@ -1282,7 +1282,7 @@ xfs_file_ioctl(
1282 if (filp->f_mode & FMODE_NOCMTIME) 1282 if (filp->f_mode & FMODE_NOCMTIME)
1283 ioflags |= IO_INVIS; 1283 ioflags |= IO_INVIS;
1284 1284
1285 xfs_itrace_entry(ip); 1285 trace_xfs_file_ioctl(ip);
1286 1286
1287 switch (cmd) { 1287 switch (cmd) {
1288 case XFS_IOC_ALLOCSP: 1288 case XFS_IOC_ALLOCSP:
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
index 6cd1225608ac..6c83f7f62dc9 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl32.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
@@ -540,7 +540,7 @@ xfs_file_compat_ioctl(
540 if (filp->f_mode & FMODE_NOCMTIME) 540 if (filp->f_mode & FMODE_NOCMTIME)
541 ioflags |= IO_INVIS; 541 ioflags |= IO_INVIS;
542 542
543 xfs_itrace_entry(ip); 543 trace_xfs_file_compat_ioctl(ip);
544 544
545 switch (cmd) { 545 switch (cmd) {
546 /* No size or alignment issues on any arch */ 546 /* No size or alignment issues on any arch */
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 4393de6b0c07..536b81e63a3d 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -488,7 +488,7 @@ xfs_vn_getattr(
488 struct xfs_inode *ip = XFS_I(inode); 488 struct xfs_inode *ip = XFS_I(inode);
489 struct xfs_mount *mp = ip->i_mount; 489 struct xfs_mount *mp = ip->i_mount;
490 490
491 xfs_itrace_entry(ip); 491 trace_xfs_getattr(ip);
492 492
493 if (XFS_FORCED_SHUTDOWN(mp)) 493 if (XFS_FORCED_SHUTDOWN(mp))
494 return XFS_ERROR(EIO); 494 return XFS_ERROR(EIO);
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 0ac1df74341f..22faaea5f3e1 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -907,7 +907,7 @@ xfs_fs_destroy_inode(
907{ 907{
908 struct xfs_inode *ip = XFS_I(inode); 908 struct xfs_inode *ip = XFS_I(inode);
909 909
910 xfs_itrace_entry(ip); 910 trace_xfs_destroy_inode(ip);
911 911
912 XFS_STATS_INC(vn_reclaim); 912 XFS_STATS_INC(vn_reclaim);
913 913
@@ -1040,7 +1040,7 @@ xfs_fs_write_inode(
1040 struct xfs_mount *mp = ip->i_mount; 1040 struct xfs_mount *mp = ip->i_mount;
1041 int error = EAGAIN; 1041 int error = EAGAIN;
1042 1042
1043 xfs_itrace_entry(ip); 1043 trace_xfs_write_inode(ip);
1044 1044
1045 if (XFS_FORCED_SHUTDOWN(mp)) 1045 if (XFS_FORCED_SHUTDOWN(mp))
1046 return XFS_ERROR(EIO); 1046 return XFS_ERROR(EIO);
@@ -1107,7 +1107,8 @@ xfs_fs_clear_inode(
1107{ 1107{
1108 xfs_inode_t *ip = XFS_I(inode); 1108 xfs_inode_t *ip = XFS_I(inode);
1109 1109
1110 xfs_itrace_entry(ip); 1110 trace_xfs_clear_inode(ip);
1111
1111 XFS_STATS_INC(vn_rele); 1112 XFS_STATS_INC(vn_rele);
1112 XFS_STATS_INC(vn_remove); 1113 XFS_STATS_INC(vn_remove);
1113 XFS_STATS_DEC(vn_active); 1114 XFS_STATS_DEC(vn_active);
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h
index 9efe368d38c7..24e5580bf3e7 100644
--- a/fs/xfs/linux-2.6/xfs_trace.h
+++ b/fs/xfs/linux-2.6/xfs_trace.h
@@ -539,7 +539,7 @@ DEFINE_LOCK_EVENT(xfs_ilock_nowait);
539DEFINE_LOCK_EVENT(xfs_ilock_demote); 539DEFINE_LOCK_EVENT(xfs_ilock_demote);
540DEFINE_LOCK_EVENT(xfs_iunlock); 540DEFINE_LOCK_EVENT(xfs_iunlock);
541 541
542DECLARE_EVENT_CLASS(xfs_iget_class, 542DECLARE_EVENT_CLASS(xfs_inode_class,
543 TP_PROTO(struct xfs_inode *ip), 543 TP_PROTO(struct xfs_inode *ip),
544 TP_ARGS(ip), 544 TP_ARGS(ip),
545 TP_STRUCT__entry( 545 TP_STRUCT__entry(
@@ -555,17 +555,36 @@ DECLARE_EVENT_CLASS(xfs_iget_class,
555 __entry->ino) 555 __entry->ino)
556) 556)
557 557
558#define DEFINE_IGET_EVENT(name) \ 558#define DEFINE_INODE_EVENT(name) \
559DEFINE_EVENT(xfs_iget_class, name, \ 559DEFINE_EVENT(xfs_inode_class, name, \
560 TP_PROTO(struct xfs_inode *ip), \ 560 TP_PROTO(struct xfs_inode *ip), \
561 TP_ARGS(ip)) 561 TP_ARGS(ip))
562DEFINE_IGET_EVENT(xfs_iget_skip); 562DEFINE_INODE_EVENT(xfs_iget_skip);
563DEFINE_IGET_EVENT(xfs_iget_reclaim); 563DEFINE_INODE_EVENT(xfs_iget_reclaim);
564DEFINE_IGET_EVENT(xfs_iget_reclaim_fail); 564DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
565DEFINE_IGET_EVENT(xfs_iget_hit); 565DEFINE_INODE_EVENT(xfs_iget_hit);
566DEFINE_IGET_EVENT(xfs_iget_miss); 566DEFINE_INODE_EVENT(xfs_iget_miss);
567 567
568DECLARE_EVENT_CLASS(xfs_inode_class, 568DEFINE_INODE_EVENT(xfs_getattr);
569DEFINE_INODE_EVENT(xfs_setattr);
570DEFINE_INODE_EVENT(xfs_readlink);
571DEFINE_INODE_EVENT(xfs_alloc_file_space);
572DEFINE_INODE_EVENT(xfs_free_file_space);
573DEFINE_INODE_EVENT(xfs_readdir);
574DEFINE_INODE_EVENT(xfs_check_acl);
575DEFINE_INODE_EVENT(xfs_vm_bmap);
576DEFINE_INODE_EVENT(xfs_file_ioctl);
577DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
578DEFINE_INODE_EVENT(xfs_ioctl_setattr);
579DEFINE_INODE_EVENT(xfs_file_fsync);
580DEFINE_INODE_EVENT(xfs_destroy_inode);
581DEFINE_INODE_EVENT(xfs_write_inode);
582DEFINE_INODE_EVENT(xfs_clear_inode);
583
584DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
585DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
586
587DECLARE_EVENT_CLASS(xfs_iref_class,
569 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), 588 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
570 TP_ARGS(ip, caller_ip), 589 TP_ARGS(ip, caller_ip),
571 TP_STRUCT__entry( 590 TP_STRUCT__entry(
@@ -590,20 +609,71 @@ DECLARE_EVENT_CLASS(xfs_inode_class,
590 (char *)__entry->caller_ip) 609 (char *)__entry->caller_ip)
591) 610)
592 611
593#define DEFINE_INODE_EVENT(name) \ 612#define DEFINE_IREF_EVENT(name) \
594DEFINE_EVENT(xfs_inode_class, name, \ 613DEFINE_EVENT(xfs_iref_class, name, \
595 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ 614 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
596 TP_ARGS(ip, caller_ip)) 615 TP_ARGS(ip, caller_ip))
597DEFINE_INODE_EVENT(xfs_ihold); 616DEFINE_IREF_EVENT(xfs_ihold);
598DEFINE_INODE_EVENT(xfs_irele); 617DEFINE_IREF_EVENT(xfs_irele);
599DEFINE_INODE_EVENT(xfs_inode_pin); 618DEFINE_IREF_EVENT(xfs_inode_pin);
600DEFINE_INODE_EVENT(xfs_inode_unpin); 619DEFINE_IREF_EVENT(xfs_inode_unpin);
601DEFINE_INODE_EVENT(xfs_inode_unpin_nowait); 620DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
621
622DECLARE_EVENT_CLASS(xfs_namespace_class,
623 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
624 TP_ARGS(dp, name),
625 TP_STRUCT__entry(
626 __field(dev_t, dev)
627 __field(xfs_ino_t, dp_ino)
628 __dynamic_array(char, name, name->len)
629 ),
630 TP_fast_assign(
631 __entry->dev = VFS_I(dp)->i_sb->s_dev;
632 __entry->dp_ino = dp->i_ino;
633 memcpy(__get_str(name), name->name, name->len);
634 ),
635 TP_printk("dev %d:%d dp ino 0x%llx name %s",
636 MAJOR(__entry->dev), MINOR(__entry->dev),
637 __entry->dp_ino,
638 __get_str(name))
639)
602 640
603/* the old xfs_itrace_entry tracer - to be replaced by s.th. in the VFS */ 641#define DEFINE_NAMESPACE_EVENT(name) \
604DEFINE_INODE_EVENT(xfs_inode); 642DEFINE_EVENT(xfs_namespace_class, name, \
605#define xfs_itrace_entry(ip) \ 643 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
606 trace_xfs_inode(ip, _THIS_IP_) 644 TP_ARGS(dp, name))
645DEFINE_NAMESPACE_EVENT(xfs_remove);
646DEFINE_NAMESPACE_EVENT(xfs_link);
647DEFINE_NAMESPACE_EVENT(xfs_lookup);
648DEFINE_NAMESPACE_EVENT(xfs_create);
649DEFINE_NAMESPACE_EVENT(xfs_symlink);
650
651TRACE_EVENT(xfs_rename,
652 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
653 struct xfs_name *src_name, struct xfs_name *target_name),
654 TP_ARGS(src_dp, target_dp, src_name, target_name),
655 TP_STRUCT__entry(
656 __field(dev_t, dev)
657 __field(xfs_ino_t, src_dp_ino)
658 __field(xfs_ino_t, target_dp_ino)
659 __dynamic_array(char, src_name, src_name->len)
660 __dynamic_array(char, target_name, target_name->len)
661 ),
662 TP_fast_assign(
663 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
664 __entry->src_dp_ino = src_dp->i_ino;
665 __entry->target_dp_ino = target_dp->i_ino;
666 memcpy(__get_str(src_name), src_name->name, src_name->len);
667 memcpy(__get_str(target_name), target_name->name, target_name->len);
668 ),
669 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
670 " src name %s target name %s",
671 MAJOR(__entry->dev), MINOR(__entry->dev),
672 __entry->src_dp_ino,
673 __entry->target_dp_ino,
674 __get_str(src_name),
675 __get_str(target_name))
676)
607 677
608DECLARE_EVENT_CLASS(xfs_dquot_class, 678DECLARE_EVENT_CLASS(xfs_dquot_class,
609 TP_PROTO(struct xfs_dquot *dqp), 679 TP_PROTO(struct xfs_dquot *dqp),
@@ -683,9 +753,6 @@ DEFINE_DQUOT_EVENT(xfs_dqrele);
683DEFINE_DQUOT_EVENT(xfs_dqflush); 753DEFINE_DQUOT_EVENT(xfs_dqflush);
684DEFINE_DQUOT_EVENT(xfs_dqflush_force); 754DEFINE_DQUOT_EVENT(xfs_dqflush_force);
685DEFINE_DQUOT_EVENT(xfs_dqflush_done); 755DEFINE_DQUOT_EVENT(xfs_dqflush_done);
686/* not really iget events, but we re-use the format */
687DEFINE_IGET_EVENT(xfs_dquot_dqalloc);
688DEFINE_IGET_EVENT(xfs_dquot_dqdetach);
689 756
690DECLARE_EVENT_CLASS(xfs_loggrant_class, 757DECLARE_EVENT_CLASS(xfs_loggrant_class,
691 TP_PROTO(struct log *log, struct xlog_ticket *tic), 758 TP_PROTO(struct log *log, struct xlog_ticket *tic),