diff options
| author | Jeff Layton <jlayton@primarydata.com> | 2014-11-26 14:44:44 -0500 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-11-27 13:14:52 -0500 |
| commit | 388f0c776781fe64ce951701bfe712b2182a31f2 (patch) | |
| tree | 535e64ee7e52c96a16f80c2d71f2310d6f796b2b /include/linux/sunrpc | |
| parent | b4b9d2ccf0be61c69213f6ae4e33377c05194ef4 (diff) | |
sunrpc: add a debugfs rpc_xprt directory with an info file in it
Add a new directory heirarchy under the debugfs sunrpc/ directory:
sunrpc/
rpc_xprt/
<xprt id>/
Within that directory, we can put files that give info about the
xprts. We do have the (minor) problem that there is no succinct,
unique identifier for rpc_xprts. So we generate them synthetically
with a static atomic_t counter.
For now, this directory just holds an "info" file, but we may add
other files to it in the future.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/debug.h | 15 | ||||
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 835339707094..c57d8ea0716c 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
| @@ -55,6 +55,7 @@ extern unsigned int nlm_debug; | |||
| 55 | */ | 55 | */ |
| 56 | 56 | ||
| 57 | struct rpc_clnt; | 57 | struct rpc_clnt; |
| 58 | struct rpc_xprt; | ||
| 58 | 59 | ||
| 59 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | 60 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
| 60 | void rpc_register_sysctl(void); | 61 | void rpc_register_sysctl(void); |
| @@ -63,6 +64,8 @@ int sunrpc_debugfs_init(void); | |||
| 63 | void sunrpc_debugfs_exit(void); | 64 | void sunrpc_debugfs_exit(void); |
| 64 | int rpc_clnt_debugfs_register(struct rpc_clnt *); | 65 | int rpc_clnt_debugfs_register(struct rpc_clnt *); |
| 65 | void rpc_clnt_debugfs_unregister(struct rpc_clnt *); | 66 | void rpc_clnt_debugfs_unregister(struct rpc_clnt *); |
| 67 | int rpc_xprt_debugfs_register(struct rpc_xprt *); | ||
| 68 | void rpc_xprt_debugfs_unregister(struct rpc_xprt *); | ||
| 66 | #else | 69 | #else |
| 67 | static inline int | 70 | static inline int |
| 68 | sunrpc_debugfs_init(void) | 71 | sunrpc_debugfs_init(void) |
| @@ -87,6 +90,18 @@ rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt) | |||
| 87 | { | 90 | { |
| 88 | return; | 91 | return; |
| 89 | } | 92 | } |
| 93 | |||
| 94 | static inline int | ||
| 95 | rpc_xprt_debugfs_register(struct rpc_xprt *xprt) | ||
| 96 | { | ||
| 97 | return 0; | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void | ||
| 101 | rpc_xprt_debugfs_unregister(struct rpc_xprt *xprt) | ||
| 102 | { | ||
| 103 | return; | ||
| 104 | } | ||
| 90 | #endif | 105 | #endif |
| 91 | 106 | ||
| 92 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ | 107 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index cf391eef2e6d..9d27ac45b909 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -239,6 +239,9 @@ struct rpc_xprt { | |||
| 239 | struct net *xprt_net; | 239 | struct net *xprt_net; |
| 240 | const char *servername; | 240 | const char *servername; |
| 241 | const char *address_strings[RPC_DISPLAY_MAX]; | 241 | const char *address_strings[RPC_DISPLAY_MAX]; |
| 242 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | ||
| 243 | struct dentry *debugfs; /* debugfs directory */ | ||
| 244 | #endif | ||
| 242 | }; | 245 | }; |
| 243 | 246 | ||
| 244 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) | 247 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
