aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-05-21 17:09:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-09 12:08:58 -0400
commitcb3997b5a0b21864368bd1bd1d0929f9304fb6d9 (patch)
treeb3b0f4369c8dba139e0e359cfcfc9277d82430a1 /net/sunrpc/clnt.c
parent38e886e0c18975543938519254fc9bf0829c75a3 (diff)
SUNRPC: Display some debugging information as text rather than numbers
In rpc_show_tasks(), display the program name, version number, procedure name and tk_action as human-readable variable-length text fields rather than columnar numbers. Doing the symbol lookup here helps in cases where we have actual debugging output from a kernel log, but don't have access to the kernel image or RPC module that generated the output. Sample output: -pid- flgs status -client- --rqstp- -timeout ---ops-- 5608 0001 -11 eeb42690 f6d93710 0 f8fa1764 nfsv3 WRITE a:call_transmit_status q:none 5609 0001 -11 eeb42690 f6d937e0 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5610 0001 -11 eeb42690 f6d93230 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5611 0001 -11 eeb42690 f6d93300 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5612 0001 -11 eeb42690 f6d93090 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5613 0001 -11 eeb42690 f6d933d0 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5614 0001 -11 eeb42690 f6d93cc0 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5615 0001 -11 eeb42690 f6d93a50 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5616 0001 -11 eeb42690 f6d93640 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5617 0001 -11 eeb42690 f6d93b20 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending 5618 0001 -11 eeb42690 f6d93160 0 f8fa1764 nfsv3 WRITE a:call_status q:xprt_sending Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 7964a98c90e5..0530eea37b59 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -25,6 +25,7 @@
25 25
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/kallsyms.h>
28#include <linux/mm.h> 29#include <linux/mm.h>
29#include <linux/slab.h> 30#include <linux/slab.h>
30#include <linux/smp_lock.h> 31#include <linux/smp_lock.h>
@@ -1528,29 +1529,31 @@ EXPORT_SYMBOL_GPL(rpc_call_null);
1528#ifdef RPC_DEBUG 1529#ifdef RPC_DEBUG
1529static void rpc_show_header(void) 1530static void rpc_show_header(void)
1530{ 1531{
1531 printk(KERN_INFO "-pid- proc flgs status -client- -prog- --rqstp- " 1532 printk(KERN_INFO "-pid- flgs status -client- --rqstp- "
1532 "-timeout -rpcwait -action- ---ops--\n"); 1533 "-timeout ---ops--\n");
1533} 1534}
1534 1535
1535static void rpc_show_task(const struct rpc_clnt *clnt, 1536static void rpc_show_task(const struct rpc_clnt *clnt,
1536 const struct rpc_task *task) 1537 const struct rpc_task *task)
1537{ 1538{
1538 const char *rpc_waitq = "none"; 1539 const char *rpc_waitq = "none";
1539 int proc = -1; 1540 char *p, action[KSYM_SYMBOL_LEN];
1540
1541 if (task->tk_msg.rpc_proc)
1542 proc = task->tk_msg.rpc_proc->p_proc;
1543 1541
1544 if (RPC_IS_QUEUED(task)) 1542 if (RPC_IS_QUEUED(task))
1545 rpc_waitq = rpc_qname(task->tk_waitqueue); 1543 rpc_waitq = rpc_qname(task->tk_waitqueue);
1546 1544
1547 printk(KERN_INFO "%5u %04d %04x %6d %8p %6d %8p %8ld %8s %8p %8p\n", 1545 /* map tk_action pointer to a function name; then trim off
1548 task->tk_pid, proc, 1546 * the "+0x0 [sunrpc]" */
1549 task->tk_flags, task->tk_status, 1547 sprint_symbol(action, (unsigned long)task->tk_action);
1550 clnt, clnt->cl_prog, 1548 p = strchr(action, '+');
1551 task->tk_rqstp, task->tk_timeout, 1549 if (p)
1552 rpc_waitq, 1550 *p = '\0';
1553 task->tk_action, task->tk_ops); 1551
1552 printk(KERN_INFO "%5u %04x %6d %8p %8p %8ld %8p %sv%u %s a:%s q:%s\n",
1553 task->tk_pid, task->tk_flags, task->tk_status,
1554 clnt, task->tk_rqstp, task->tk_timeout, task->tk_ops,
1555 clnt->cl_protname, clnt->cl_vers, rpc_proc_name(task),
1556 action, rpc_waitq);
1554} 1557}
1555 1558
1556void rpc_show_tasks(void) 1559void rpc_show_tasks(void)