Subject: Re: linux-next: Tree for Feb 2 (trace/events/sunrpc.h)

From: Steven Rostedt <[email-masked]>
Date: Wed, 08 Feb 2012 21:37:10 -0500

[ Added the person responsible for this ]

On Thu, 2012-02-02 at 10:10 -0800, Randy Dunlap wrote:
> On 02/01/2012 07:45 PM, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Changes since 20120201:
> 
> 
> 
> include/trace/events/sunrpc.h:69:1: error: implicit declaration of function 'rpc_qname'
> include/trace/events/sunrpc.h:69:1: warning: format '%s' expects type 'char *', but argument 9 has type 'int'

This has actually nothing to do with the tracepoint itself. The bug is
with the rpc_qname().

The tracepoint references rpc_qname() and in
include/linux/sunrpc/sched.h:

#ifdef RPC_DEBUG
static inline const char * rpc_qname(const struct rpc_wait_queue *q)
{
	return ((q && q->name) ? q->name : "unknown");
}
#endif

Your config had RPC_DEBUG not set, thus the function was not defined.

The below patch fixes the problem with the side effect that the trace
data will contain "unknown" for all references to rcu_qname().

-- Steve

Signed-off-by: Steven Rostedt <[email-masked]>

diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index f7b2df5..c89ba95 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -275,6 +275,11 @@ static inline const char * rpc_qname(const struct rpc_wait_queue *q)
 {
 	return ((q && q->name) ? q->name : "unknown");
 }
+#else
+static inline const char * rpc_qname(const struct rpc_wait_queue *q)
+{
+	return "unknown";
+}
 #endif
 
 #endif /* _LINUX_SUNRPC_SCHED_H_ */