All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: trond.myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 2/6] SUNRPC: Add a function to display the name of an RPC procedure
Date: Wed, 21 May 2008 14:15:51 -0400	[thread overview]
Message-ID: <20080521181550.3295.65954.stgit@ellison> (raw)
In-Reply-To: <20080521180231.3295.84997.stgit@ellison>

Improve debugging messages in call_start() and call_verify() by having
them show the RPC procedure name instead of the procedure number.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 net/sunrpc/clnt.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)


diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 8945307..b20638b 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -690,6 +690,21 @@ rpc_restart_call(struct rpc_task *task)
 }
 EXPORT_SYMBOL_GPL(rpc_restart_call);
 
+#ifdef RPC_DEBUG
+static const char *rpc_proc_name(const struct rpc_task *task)
+{
+	const struct rpc_procinfo *proc = task->tk_msg.rpc_proc;
+
+	if (proc) {
+		if (proc->p_name)
+			return proc->p_name;
+		else
+			return "NULL";
+	} else
+		return "no proc";
+}
+#endif
+
 /*
  * 0.  Initial state
  *
@@ -701,9 +716,9 @@ call_start(struct rpc_task *task)
 {
 	struct rpc_clnt	*clnt = task->tk_client;
 
-	dprintk("RPC: %5u call_start %s%d proc %d (%s)\n", task->tk_pid,
+	dprintk("RPC: %5u call_start %s%d proc %s (%s)\n", task->tk_pid,
 			clnt->cl_protname, clnt->cl_vers,
-			task->tk_msg.rpc_proc->p_proc,
+			rpc_proc_name(task),
 			(RPC_IS_ASYNC(task) ? "async" : "sync"));
 
 	/* Increment call count */
@@ -1431,10 +1446,10 @@ call_verify(struct rpc_task *task)
 		error = -EPROTONOSUPPORT;
 		goto out_err;
 	case RPC_PROC_UNAVAIL:
-		dprintk("RPC: %5u %s: proc %p unsupported by program %u, "
+		dprintk("RPC: %5u %s: proc %s unsupported by program %u, "
 				"version %u on server %s\n",
 				task->tk_pid, __func__,
-				task->tk_msg.rpc_proc,
+				rpc_proc_name(task),
 				task->tk_client->cl_prog,
 				task->tk_client->cl_vers,
 				task->tk_client->cl_server);


  parent reply	other threads:[~2008-05-21 18:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 18:15 [PATCH 0/6] Initial set of 2.6.27 patches, take 3 Chuck Lever
2008-05-21 18:15 ` [PATCH 1/6] NFS: Update help text for CONFIG_NFS_FS Chuck Lever
2008-05-21 18:15 ` Chuck Lever [this message]
2008-05-21 18:15 ` [PATCH 3/6] SUNRPC: Rename "call_" functions that are no longer FSM states Chuck Lever
2008-05-21 18:16 ` [PATCH 4/6] SUNRPC: Don't display the rpc_show_tasks header if there are no tasks Chuck Lever
2008-05-21 18:16 ` [PATCH 5/6] SUNRPC: Refactor rpc_show_tasks Chuck Lever
2008-05-21 18:16 ` [PATCH 6/6] SUNRPC: Display some debugging information as text rather than numbers Chuck Lever
2008-05-21 19:50   ` J. Bruce Fields
2008-05-21 20:37     ` Chuck Lever
2008-05-21 20:40       ` Trond Myklebust
2008-05-21 20:42       ` J. Bruce Fields
2008-05-21 20:57         ` Chuck Lever
2008-05-21 19:15 ` [PATCH 0/6] Initial set of 2.6.27 patches, take 3 J. Bruce Fields
  -- strict thread matches above, loose matches on Subject: below --
2008-05-21 21:08 [PATCH 0/6] Initial set of 2.6.27 patches, take 4 Chuck Lever
     [not found] ` <20080521210411.6468.68771.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-05-21 21:09   ` [PATCH 2/6] SUNRPC: Add a function to display the name of an RPC procedure Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080521181550.3295.65954.stgit@ellison \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.