diff options
-rw-r--r-- | include/linux/sunrpc/debug.h | 3 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 15 | ||||
-rw-r--r-- | net/sunrpc/sched.c | 4 |
3 files changed, 17 insertions, 5 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index c2786f20016..2a11eb278f6 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 f7b2df5252b..22dfc24013b 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) |
274 | static inline const char * rpc_qname(const struct rpc_wait_queue *q) | 274 | static 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 | |||
279 | static inline void rpc_assign_waitqueue_name(struct rpc_wait_queue *q, | ||
280 | const char *name) | ||
281 | { | ||
282 | q->name = name; | ||
283 | } | ||
284 | #else | ||
285 | static 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_ */ |
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index d79c63df49b..1c570a81096 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -208,9 +208,7 @@ static void __rpc_init_priority_wait_queue(struct rpc_wait_queue *queue, const c | |||
208 | queue->qlen = 0; | 208 | queue->qlen = 0; |
209 | setup_timer(&queue->timer_list.timer, __rpc_queue_timer_fn, (unsigned long)queue); | 209 | setup_timer(&queue->timer_list.timer, __rpc_queue_timer_fn, (unsigned long)queue); |
210 | INIT_LIST_HEAD(&queue->timer_list.list); | 210 | INIT_LIST_HEAD(&queue->timer_list.list); |
211 | #ifdef RPC_DEBUG | 211 | rpc_assign_waitqueue_name(queue, qname); |
212 | queue->name = qname; | ||
213 | #endif | ||
214 | } | 212 | } |
215 | 213 | ||
216 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *queue, const char *qname) | 214 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *queue, const char *qname) |