diff mbox series

[06/11] NFS: Add tracepoints for nfs_readdir_xdr_filler enter and exit

Message ID 1604325011-29427-7-git-send-email-dwysocha@redhat.com (mailing list archive)
State New, archived
Headers show
Series Add NFS readdir tracepoints and improve performance of reading directories | expand

Commit Message

David Wysochanski Nov. 2, 2020, 1:50 p.m. UTC
Add tracepoints for entry and exit to nfs_readdir_xdr_filler.
Note the exit trace event captures the results of over the wire
READDIR operations, regardless of NFS version.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
---
 fs/nfs/dir.c      | 2 ++
 fs/nfs/nfstrace.h | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index e4cd9789ebb5..d1e9ba28c4a0 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -361,6 +361,7 @@  int nfs_readdir_xdr_filler(struct page **pages, nfs_readdir_descriptor_t *desc,
 	int		error;
 
  again:
+	trace_nfs_readdir_xdr_filler_enter(desc);
 	timestamp = jiffies;
 	gencount = nfs_inc_attr_generation_counter();
 	desc->dir_verifier = nfs_save_change_attribute(inode);
@@ -379,6 +380,7 @@  int nfs_readdir_xdr_filler(struct page **pages, nfs_readdir_descriptor_t *desc,
 	desc->timestamp = timestamp;
 	desc->gencount = gencount;
 error:
+	trace_nfs_readdir_xdr_filler_exit(desc, error);
 	return error;
 }
 
diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h
index 0ed330f323bb..5dbadd2718e3 100644
--- a/fs/nfs/nfstrace.h
+++ b/fs/nfs/nfstrace.h
@@ -926,6 +926,8 @@ 
 DEFINE_NFS_READDIR_DESCRIPTOR_EVENT_EXIT(nfs_readdir_search_pagecache_exit);
 DEFINE_NFS_READDIR_DESCRIPTOR_EVENT(nfs_readdir_search_array_enter);
 DEFINE_NFS_READDIR_DESCRIPTOR_EVENT_EXIT(nfs_readdir_search_array_exit);
+DEFINE_NFS_READDIR_DESCRIPTOR_EVENT(nfs_readdir_xdr_filler_enter);
+DEFINE_NFS_READDIR_DESCRIPTOR_EVENT_EXIT(nfs_readdir_xdr_filler_exit);
 
 TRACE_EVENT(nfs_link_enter,
 		TP_PROTO(