diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-21 13:54:44 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-22 08:58:20 -0400 |
commit | 1fd1085b49f8cafbd0ce4e4682c209a31f7b287f (patch) | |
tree | 82bc8631aedfc1e5d633c4357c7a378e93f11505 | |
parent | 70ded2017072ae16aeaa7fb2a15a879a475161a6 (diff) |
NFS: Add tracepoints for debugging NFS hard links
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/dir.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfstrace.h | 70 |
2 files changed, 72 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index dca7deb1609b..4ce7f7696e11 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1860,6 +1860,7 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | |||
1860 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, | 1860 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, |
1861 | dentry->d_parent->d_name.name, dentry->d_name.name); | 1861 | dentry->d_parent->d_name.name, dentry->d_name.name); |
1862 | 1862 | ||
1863 | trace_nfs_link_enter(inode, dir, dentry); | ||
1863 | NFS_PROTO(inode)->return_delegation(inode); | 1864 | NFS_PROTO(inode)->return_delegation(inode); |
1864 | 1865 | ||
1865 | d_drop(dentry); | 1866 | d_drop(dentry); |
@@ -1868,6 +1869,7 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | |||
1868 | ihold(inode); | 1869 | ihold(inode); |
1869 | d_add(dentry, inode); | 1870 | d_add(dentry, inode); |
1870 | } | 1871 | } |
1872 | trace_nfs_link_exit(inode, dir, dentry, error); | ||
1871 | return error; | 1873 | return error; |
1872 | } | 1874 | } |
1873 | EXPORT_SYMBOL_GPL(nfs_link); | 1875 | EXPORT_SYMBOL_GPL(nfs_link); |
diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index a20f0d147cf2..89fe741e58b1 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h | |||
@@ -512,6 +512,76 @@ DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit); | |||
512 | DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter); | 512 | DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter); |
513 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit); | 513 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit); |
514 | 514 | ||
515 | TRACE_EVENT(nfs_link_enter, | ||
516 | TP_PROTO( | ||
517 | const struct inode *inode, | ||
518 | const struct inode *dir, | ||
519 | const struct dentry *dentry | ||
520 | ), | ||
521 | |||
522 | TP_ARGS(inode, dir, dentry), | ||
523 | |||
524 | TP_STRUCT__entry( | ||
525 | __field(dev_t, dev) | ||
526 | __field(u64, fileid) | ||
527 | __field(u64, dir) | ||
528 | __string(name, dentry->d_name.name) | ||
529 | ), | ||
530 | |||
531 | TP_fast_assign( | ||
532 | __entry->dev = inode->i_sb->s_dev; | ||
533 | __entry->fileid = NFS_FILEID(inode); | ||
534 | __entry->dir = NFS_FILEID(dir); | ||
535 | __assign_str(name, dentry->d_name.name); | ||
536 | ), | ||
537 | |||
538 | TP_printk( | ||
539 | "fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s", | ||
540 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
541 | __entry->fileid, | ||
542 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
543 | (unsigned long long)__entry->dir, | ||
544 | __get_str(name) | ||
545 | ) | ||
546 | ); | ||
547 | |||
548 | TRACE_EVENT(nfs_link_exit, | ||
549 | TP_PROTO( | ||
550 | const struct inode *inode, | ||
551 | const struct inode *dir, | ||
552 | const struct dentry *dentry, | ||
553 | int error | ||
554 | ), | ||
555 | |||
556 | TP_ARGS(inode, dir, dentry, error), | ||
557 | |||
558 | TP_STRUCT__entry( | ||
559 | __field(int, error) | ||
560 | __field(dev_t, dev) | ||
561 | __field(u64, fileid) | ||
562 | __field(u64, dir) | ||
563 | __string(name, dentry->d_name.name) | ||
564 | ), | ||
565 | |||
566 | TP_fast_assign( | ||
567 | __entry->dev = inode->i_sb->s_dev; | ||
568 | __entry->fileid = NFS_FILEID(inode); | ||
569 | __entry->dir = NFS_FILEID(dir); | ||
570 | __entry->error = error; | ||
571 | __assign_str(name, dentry->d_name.name); | ||
572 | ), | ||
573 | |||
574 | TP_printk( | ||
575 | "error=%d fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s", | ||
576 | __entry->error, | ||
577 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
578 | __entry->fileid, | ||
579 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
580 | (unsigned long long)__entry->dir, | ||
581 | __get_str(name) | ||
582 | ) | ||
583 | ); | ||
584 | |||
515 | DECLARE_EVENT_CLASS(nfs_rename_event, | 585 | DECLARE_EVENT_CLASS(nfs_rename_event, |
516 | TP_PROTO( | 586 | TP_PROTO( |
517 | const struct inode *old_dir, | 587 | const struct inode *old_dir, |