aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-11-26 14:44:43 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-11-27 13:14:51 -0500
commitb4b9d2ccf0be61c69213f6ae4e33377c05194ef4 (patch)
tree54709e972d890b22b6de65124f87953534aaa9a3 /include/linux
parentea5264138d240825a7e3f11d5945d568b74efb91 (diff)
sunrpc: add debugfs file for displaying client rpc_task queue
It's possible to get a dump of the RPC task queue by writing a value to /proc/sys/sunrpc/rpc_debug. If you write any value to that file, you get a dump of the RPC client task list into the log buffer. This is a rather inconvenient interface however, and makes it hard to get immediate info about the task queue. Add a new directory hierarchy under debugfs: sunrpc/ rpc_clnt/ <clientid>/ Within each clientid directory we create a new "tasks" file that will dump info similar to what shows up in the log buffer, but with a few small differences -- we avoid printing raw kernel addresses in favor of symbolic names and the XID is also displayed. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sunrpc/clnt.h4
-rw-r--r--include/linux/sunrpc/debug.h31
2 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 70736b98c721..d86acc63b25f 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -63,6 +63,9 @@ struct rpc_clnt {
63 struct rpc_rtt cl_rtt_default; 63 struct rpc_rtt cl_rtt_default;
64 struct rpc_timeout cl_timeout_default; 64 struct rpc_timeout cl_timeout_default;
65 const struct rpc_program *cl_program; 65 const struct rpc_program *cl_program;
66#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
67 struct dentry *cl_debugfs; /* debugfs directory */
68#endif
66}; 69};
67 70
68/* 71/*
@@ -176,5 +179,6 @@ size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
176const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); 179const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
177int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); 180int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t);
178 181
182const char *rpc_proc_name(const struct rpc_task *task);
179#endif /* __KERNEL__ */ 183#endif /* __KERNEL__ */
180#endif /* _LINUX_SUNRPC_CLNT_H */ 184#endif /* _LINUX_SUNRPC_CLNT_H */
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 43f38ee9668c..835339707094 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -53,9 +53,40 @@ extern unsigned int nlm_debug;
53/* 53/*
54 * Sysctl interface for RPC debugging 54 * Sysctl interface for RPC debugging
55 */ 55 */
56
57struct rpc_clnt;
58
56#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) 59#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
57void rpc_register_sysctl(void); 60void rpc_register_sysctl(void);
58void rpc_unregister_sysctl(void); 61void rpc_unregister_sysctl(void);
62int sunrpc_debugfs_init(void);
63void sunrpc_debugfs_exit(void);
64int rpc_clnt_debugfs_register(struct rpc_clnt *);
65void rpc_clnt_debugfs_unregister(struct rpc_clnt *);
66#else
67static inline int
68sunrpc_debugfs_init(void)
69{
70 return 0;
71}
72
73static inline void
74sunrpc_debugfs_exit(void)
75{
76 return;
77}
78
79static inline int
80rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
81{
82 return 0;
83}
84
85static inline void
86rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt)
87{
88 return;
89}
59#endif 90#endif
60 91
61#endif /* _LINUX_SUNRPC_DEBUG_H_ */ 92#endif /* _LINUX_SUNRPC_DEBUG_H_ */