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>
This commit is contained in:
Jeff Layton 2014-11-26 14:44:43 -05:00 committed by Trond Myklebust
parent ea5264138d
commit b4b9d2ccf0
7 changed files with 245 additions and 1 deletions

View file

@ -53,9 +53,40 @@ extern unsigned int nlm_debug;
/*
* Sysctl interface for RPC debugging
*/
struct rpc_clnt;
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
void rpc_register_sysctl(void);
void rpc_unregister_sysctl(void);
int sunrpc_debugfs_init(void);
void sunrpc_debugfs_exit(void);
int rpc_clnt_debugfs_register(struct rpc_clnt *);
void rpc_clnt_debugfs_unregister(struct rpc_clnt *);
#else
static inline int
sunrpc_debugfs_init(void)
{
return 0;
}
static inline void
sunrpc_debugfs_exit(void)
{
return;
}
static inline int
rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
{
return 0;
}
static inline void
rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt)
{
return;
}
#endif
#endif /* _LINUX_SUNRPC_DEBUG_H_ */