From: Dave Wysochanski <dwysocha@redhat.com>
To: Trond Myklebust <trondmy@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 08/11] NFS: Replace LOOKUPCACHE dfprintk statements with tracepoints
Date: Mon, 2 Nov 2020 08:50:08 -0500 [thread overview]
Message-ID: <1604325011-29427-9-git-send-email-dwysocha@redhat.com> (raw)
In-Reply-To: <1604325011-29427-1-git-send-email-dwysocha@redhat.com>
Remove all the LOOKUPCACHE dfprintk statements in favor of
tracepoints based on existing tracing templates
DEFINE_NFS_LOOKUP_EVENT and DEFINE_NFS_LOOKUP_EVENT_DONE.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
---
fs/nfs/dir.c | 27 ++++++++++++---------------
fs/nfs/nfstrace.h | 8 ++++++++
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index d8c3c3fdea75..52e06c8fc7cd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1226,8 +1226,7 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
{
switch (error) {
case 1:
- dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is valid\n",
- __func__, dentry);
+ trace_nfs_lookup_revalidate_done_valid(dir, dentry, 0);
return 1;
case 0:
nfs_mark_for_revalidate(dir);
@@ -1243,12 +1242,10 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
if (IS_ROOT(dentry))
return 1;
}
- dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
- __func__, dentry);
+ trace_nfs_lookup_revalidate_done_invalid(dir, dentry, 0);
return 0;
}
- dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) lookup returned error %d\n",
- __func__, dentry, error);
+ trace_nfs_lookup_revalidate_done_exit(dir, dentry, 0, error);
return error;
}
@@ -1344,12 +1341,14 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
inode = d_inode(dentry);
- if (!inode)
+ if (!inode) {
+ trace_nfs_lookup_revalidate_negative_inode(dir, dentry,
+ flags);
return nfs_lookup_revalidate_negative(dir, dentry, flags);
+ }
if (is_bad_inode(inode)) {
- dfprintk(LOOKUPCACHE, "%s: %pd2 has dud inode\n",
- __func__, dentry);
+ trace_nfs_lookup_revalidate_bad_inode(dir, dentry, flags);
goto out_bad;
}
@@ -1436,20 +1435,18 @@ static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags)
* eventually need to do something more here.
*/
if (!inode) {
- dfprintk(LOOKUPCACHE, "%s: %pd2 has negative inode\n",
- __func__, dentry);
+ trace_nfs_weak_revalidate_negative_inode(inode, dentry,
+ flags);
return 1;
}
if (is_bad_inode(inode)) {
- dfprintk(LOOKUPCACHE, "%s: %pd2 has dud inode\n",
- __func__, dentry);
+ trace_nfs_weak_revalidate_bad_inode(inode, dentry, flags);
return 0;
}
error = nfs_lookup_verify_inode(inode, flags);
- dfprintk(LOOKUPCACHE, "NFS: %s: inode %lu is %s\n",
- __func__, inode->i_ino, error ? "invalid" : "valid");
+ trace_nfs_weak_revalidate_exit(inode, dentry, flags, error);
return !error;
}
diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h
index e28551f70eab..06b301da85a2 100644
--- a/fs/nfs/nfstrace.h
+++ b/fs/nfs/nfstrace.h
@@ -386,6 +386,14 @@
DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit);
DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter);
DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit);
+DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_negative_inode);
+DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_bad_inode);
+DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_done_valid);
+DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_done_invalid);
+DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_done_exit);
+DEFINE_NFS_LOOKUP_EVENT(nfs_weak_revalidate_negative_inode);
+DEFINE_NFS_LOOKUP_EVENT(nfs_weak_revalidate_bad_inode);
+DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_weak_revalidate_exit);
TRACE_DEFINE_ENUM(O_WRONLY);
TRACE_DEFINE_ENUM(O_RDWR);
--
1.8.3.1
next prev parent reply other threads:[~2020-11-02 13:51 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 13:50 [PATCH 00/11] Add NFS readdir tracepoints and improve performance of reading directories Dave Wysochanski
2020-11-02 13:50 ` [PATCH 01/11] NFSv4: Improve nfs4_readdir tracepoint by adding additional fields Dave Wysochanski
2020-11-02 13:50 ` [PATCH 02/11] NFS: Replace dfprintk statements with trace events in nfs_readdir Dave Wysochanski
2020-11-02 13:50 ` [PATCH 03/11] NFS: Move nfs_readdir_descriptor_t into internal header Dave Wysochanski
2020-11-02 13:50 ` [PATCH 04/11] NFS: Add tracepoints for functions involving nfs_readdir_descriptor_t Dave Wysochanski
2020-11-02 17:32 ` kernel test robot
2020-11-02 13:50 ` [PATCH 05/11] NFS: Add tracepoints for opendir, closedir, fsync_dir and llseek_dir Dave Wysochanski
2020-11-02 13:50 ` [PATCH 06/11] NFS: Add tracepoints for nfs_readdir_xdr_filler enter and exit Dave Wysochanski
2020-11-02 13:50 ` [PATCH 07/11] NFS: Add tracepoint to entry and exit of nfs_do_filldir Dave Wysochanski
2020-11-02 13:50 ` Dave Wysochanski [this message]
2020-11-02 13:50 ` [PATCH 09/11] NFS: Improve performance of listing directories being modified Dave Wysochanski
2020-11-02 16:21 ` Trond Myklebust
2020-11-02 16:26 ` David Wysochanski
2020-11-02 17:31 ` Trond Myklebust
2020-11-02 19:45 ` David Wysochanski
2020-11-02 21:30 ` Trond Myklebust
2020-11-02 22:05 ` David Wysochanski
2020-11-03 3:38 ` Trond Myklebust
2020-11-03 13:29 ` David Wysochanski
2020-11-03 0:09 ` Frank van der Linden
2020-11-03 17:49 ` David Wysochanski
2020-11-02 13:50 ` [PATCH 10/11] NFS: Add page_index to nfs_readdir enter and exit tracepoints Dave Wysochanski
2020-11-02 13:50 ` [PATCH 11/11] NFS: Bring back nfs_dir_mapping_need_revalidate() in nfs_readdir() Dave Wysochanski
2020-11-02 15:38 ` Mkrtchyan, Tigran
2020-11-02 16:16 ` David Wysochanski
2020-11-02 14:27 ` [PATCH 00/11] Add NFS readdir tracepoints and improve performance of reading directories Chuck Lever
2020-11-02 15:07 ` David Wysochanski
2020-11-02 15:13 ` Chuck Lever
2020-11-02 15:58 ` Mkrtchyan, Tigran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1604325011-29427-9-git-send-email-dwysocha@redhat.com \
--to=dwysocha@redhat.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox