aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-08 22:01:15 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-15 00:19:51 -0500
commit2f09c24216cd789653eb8efbf8be88409eb8d581 (patch)
tree8ad3049b8303e4537f03ce3c11abdad468cd0803 /include/linux/sunrpc
parent685f50f9188ac1e8244d0340a9d6ea36b6136cec (diff)
SUNRPC: Ensure that we can trace waitqueues when !defined(CONFIG_SYSCTL)
The tracepoint code relies on the queue->name being defined in order to be able to display the name of the waitqueue on which an RPC task is sleeping. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Reported-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/debug.h3
-rw-r--r--include/linux/sunrpc/sched.h15
2 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index c2786f20016f..2a11eb278f64 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -34,6 +34,9 @@
34#ifdef CONFIG_SYSCTL 34#ifdef CONFIG_SYSCTL
35#define RPC_DEBUG 35#define RPC_DEBUG
36#endif 36#endif
37#ifdef CONFIG_TRACEPOINTS
38#define RPC_TRACEPOINTS
39#endif
37/* #define RPC_PROFILE */ 40/* #define RPC_PROFILE */
38 41
39/* 42/*
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index f7b2df5252b0..22dfc24013b6 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -195,7 +195,7 @@ struct rpc_wait_queue {
195 unsigned char nr; /* # tasks remaining for cookie */ 195 unsigned char nr; /* # tasks remaining for cookie */
196 unsigned short qlen; /* total # tasks waiting in queue */ 196 unsigned short qlen; /* total # tasks waiting in queue */
197 struct rpc_timer timer_list; 197 struct rpc_timer timer_list;
198#ifdef RPC_DEBUG 198#if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS)
199 const char * name; 199 const char * name;
200#endif 200#endif
201}; 201};
@@ -270,11 +270,22 @@ static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char pri
270 return (task->tk_priority + RPC_PRIORITY_LOW == prio); 270 return (task->tk_priority + RPC_PRIORITY_LOW == prio);
271} 271}
272 272
273#ifdef RPC_DEBUG 273#if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS)
274static inline const char * rpc_qname(const struct rpc_wait_queue *q) 274static inline const char * rpc_qname(const struct rpc_wait_queue *q)
275{ 275{
276 return ((q && q->name) ? q->name : "unknown"); 276 return ((q && q->name) ? q->name : "unknown");
277} 277}
278
279static inline void rpc_assign_waitqueue_name(struct rpc_wait_queue *q,
280 const char *name)
281{
282 q->name = name;
283}
284#else
285static inline void rpc_assign_waitqueue_name(struct rpc_wait_queue *q,
286 const char *name)
287{
288}
278#endif 289#endif
279 290
280#endif /* _LINUX_SUNRPC_SCHED_H_ */ 291#endif /* _LINUX_SUNRPC_SCHED_H_ */