diff options
-rw-r--r-- | fs/nfs/callback_proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/delegation.c | 3 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4trace.h | 72 |
4 files changed, 79 insertions, 0 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index e6ebc4c38c81..c0749305189b 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "internal.h" | 15 | #include "internal.h" |
16 | #include "pnfs.h" | 16 | #include "pnfs.h" |
17 | #include "nfs4session.h" | 17 | #include "nfs4session.h" |
18 | #include "nfs4trace.h" | ||
18 | 19 | ||
19 | #ifdef NFS_DEBUG | 20 | #ifdef NFS_DEBUG |
20 | #define NFSDBG_FACILITY NFSDBG_CALLBACK | 21 | #define NFSDBG_FACILITY NFSDBG_CALLBACK |
@@ -93,6 +94,7 @@ __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy, | |||
93 | default: | 94 | default: |
94 | res = htonl(NFS4ERR_RESOURCE); | 95 | res = htonl(NFS4ERR_RESOURCE); |
95 | } | 96 | } |
97 | trace_nfs4_recall_delegation(inode, -ntohl(res)); | ||
96 | iput(inode); | 98 | iput(inode); |
97 | out: | 99 | out: |
98 | dprintk("%s: exit with status = %d\n", __func__, ntohl(res)); | 100 | dprintk("%s: exit with status = %d\n", __func__, ntohl(res)); |
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 7ec4814e298d..ef792f29f831 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "nfs4_fs.h" | 20 | #include "nfs4_fs.h" |
21 | #include "delegation.h" | 21 | #include "delegation.h" |
22 | #include "internal.h" | 22 | #include "internal.h" |
23 | #include "nfs4trace.h" | ||
23 | 24 | ||
24 | static void nfs_free_delegation(struct nfs_delegation *delegation) | 25 | static void nfs_free_delegation(struct nfs_delegation *delegation) |
25 | { | 26 | { |
@@ -160,6 +161,7 @@ void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, | |||
160 | spin_unlock(&delegation->lock); | 161 | spin_unlock(&delegation->lock); |
161 | put_rpccred(oldcred); | 162 | put_rpccred(oldcred); |
162 | rcu_read_unlock(); | 163 | rcu_read_unlock(); |
164 | trace_nfs4_reclaim_delegation(inode, res->delegation_type); | ||
163 | } else { | 165 | } else { |
164 | /* We appear to have raced with a delegation return. */ | 166 | /* We appear to have raced with a delegation return. */ |
165 | spin_unlock(&delegation->lock); | 167 | spin_unlock(&delegation->lock); |
@@ -344,6 +346,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct | |||
344 | spin_lock(&inode->i_lock); | 346 | spin_lock(&inode->i_lock); |
345 | nfsi->cache_validity |= NFS_INO_REVAL_FORCED; | 347 | nfsi->cache_validity |= NFS_INO_REVAL_FORCED; |
346 | spin_unlock(&inode->i_lock); | 348 | spin_unlock(&inode->i_lock); |
349 | trace_nfs4_set_delegation(inode, res->delegation_type); | ||
347 | 350 | ||
348 | out: | 351 | out: |
349 | spin_unlock(&clp->cl_lock); | 352 | spin_unlock(&clp->cl_lock); |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4b3ba92b0e10..cbbaee27bf82 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4802,6 +4802,7 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata) | |||
4802 | if (!nfs4_sequence_done(task, &data->res.seq_res)) | 4802 | if (!nfs4_sequence_done(task, &data->res.seq_res)) |
4803 | return; | 4803 | return; |
4804 | 4804 | ||
4805 | trace_nfs4_delegreturn_exit(&data->args, &data->res, task->tk_status); | ||
4805 | switch (task->tk_status) { | 4806 | switch (task->tk_status) { |
4806 | case -NFS4ERR_STALE_STATEID: | 4807 | case -NFS4ERR_STALE_STATEID: |
4807 | case -NFS4ERR_EXPIRED: | 4808 | case -NFS4ERR_EXPIRED: |
@@ -4905,6 +4906,7 @@ int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4 | |||
4905 | int err; | 4906 | int err; |
4906 | do { | 4907 | do { |
4907 | err = _nfs4_proc_delegreturn(inode, cred, stateid, issync); | 4908 | err = _nfs4_proc_delegreturn(inode, cred, stateid, issync); |
4909 | trace_nfs4_delegreturn(inode, err); | ||
4908 | switch (err) { | 4910 | switch (err) { |
4909 | case -NFS4ERR_STALE_STATEID: | 4911 | case -NFS4ERR_STALE_STATEID: |
4910 | case -NFS4ERR_EXPIRED: | 4912 | case -NFS4ERR_EXPIRED: |
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 6388db847017..900f233ee4dc 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h | |||
@@ -411,6 +411,76 @@ DEFINE_NFS4_LOCK_EVENT(nfs4_lock_reclaim); | |||
411 | DEFINE_NFS4_LOCK_EVENT(nfs4_lock_expired); | 411 | DEFINE_NFS4_LOCK_EVENT(nfs4_lock_expired); |
412 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); | 412 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); |
413 | 413 | ||
414 | DECLARE_EVENT_CLASS(nfs4_set_delegation_event, | ||
415 | TP_PROTO( | ||
416 | const struct inode *inode, | ||
417 | fmode_t fmode | ||
418 | ), | ||
419 | |||
420 | TP_ARGS(inode, fmode), | ||
421 | |||
422 | TP_STRUCT__entry( | ||
423 | __field(dev_t, dev) | ||
424 | __field(u32, fhandle) | ||
425 | __field(u64, fileid) | ||
426 | __field(unsigned int, fmode) | ||
427 | ), | ||
428 | |||
429 | TP_fast_assign( | ||
430 | __entry->dev = inode->i_sb->s_dev; | ||
431 | __entry->fileid = NFS_FILEID(inode); | ||
432 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); | ||
433 | __entry->fmode = (__force unsigned int)fmode; | ||
434 | ), | ||
435 | |||
436 | TP_printk( | ||
437 | "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x", | ||
438 | show_fmode_flags(__entry->fmode), | ||
439 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
440 | (unsigned long long)__entry->fileid, | ||
441 | __entry->fhandle | ||
442 | ) | ||
443 | ); | ||
444 | #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \ | ||
445 | DEFINE_EVENT(nfs4_set_delegation_event, name, \ | ||
446 | TP_PROTO( \ | ||
447 | const struct inode *inode, \ | ||
448 | fmode_t fmode \ | ||
449 | ), \ | ||
450 | TP_ARGS(inode, fmode)) | ||
451 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation); | ||
452 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation); | ||
453 | |||
454 | TRACE_EVENT(nfs4_delegreturn_exit, | ||
455 | TP_PROTO( | ||
456 | const struct nfs4_delegreturnargs *args, | ||
457 | const struct nfs4_delegreturnres *res, | ||
458 | int error | ||
459 | ), | ||
460 | |||
461 | TP_ARGS(args, res, error), | ||
462 | |||
463 | TP_STRUCT__entry( | ||
464 | __field(dev_t, dev) | ||
465 | __field(u32, fhandle) | ||
466 | __field(int, error) | ||
467 | ), | ||
468 | |||
469 | TP_fast_assign( | ||
470 | __entry->dev = res->server->s_dev; | ||
471 | __entry->fhandle = nfs_fhandle_hash(args->fhandle); | ||
472 | __entry->error = error; | ||
473 | ), | ||
474 | |||
475 | TP_printk( | ||
476 | "error=%d (%s) dev=%02x:%02x fhandle=0x%08x", | ||
477 | __entry->error, | ||
478 | show_nfsv4_errors(__entry->error), | ||
479 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
480 | __entry->fhandle | ||
481 | ) | ||
482 | ); | ||
483 | |||
414 | DECLARE_EVENT_CLASS(nfs4_lookup_event, | 484 | DECLARE_EVENT_CLASS(nfs4_lookup_event, |
415 | TP_PROTO( | 485 | TP_PROTO( |
416 | const struct inode *dir, | 486 | const struct inode *dir, |
@@ -554,6 +624,8 @@ DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); | |||
554 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); | 624 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); |
555 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); | 625 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); |
556 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ | 626 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ |
627 | DEFINE_NFS4_INODE_EVENT(nfs4_recall_delegation); | ||
628 | DEFINE_NFS4_INODE_EVENT(nfs4_delegreturn); | ||
557 | 629 | ||
558 | #endif /* _TRACE_NFS4_H */ | 630 | #endif /* _TRACE_NFS4_H */ |
559 | 631 | ||