Trond Myklebust | 82b0a4c | 2012-01-20 14:52:23 -0500 | [diff] [blame^] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM sunrpc |
| 3 | |
| 4 | #if !defined(_TRACE_SUNRPC_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_SUNRPC_H |
| 6 | |
| 7 | #include <linux/sunrpc/sched.h> |
| 8 | #include <linux/sunrpc/clnt.h> |
| 9 | #include <linux/tracepoint.h> |
| 10 | |
| 11 | DECLARE_EVENT_CLASS(rpc_task_running, |
| 12 | |
| 13 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), |
| 14 | |
| 15 | TP_ARGS(clnt, task, action), |
| 16 | |
| 17 | TP_STRUCT__entry( |
| 18 | __field(const struct rpc_clnt *, clnt) |
| 19 | __field(const struct rpc_task *, task) |
| 20 | __field(const void *, action) |
| 21 | __field(unsigned long, runstate) |
| 22 | __field(int, status) |
| 23 | __field(unsigned short, flags) |
| 24 | ), |
| 25 | |
| 26 | TP_fast_assign( |
| 27 | __entry->clnt = clnt; |
| 28 | __entry->task = task; |
| 29 | __entry->action = action; |
| 30 | __entry->runstate = task->tk_runstate; |
| 31 | __entry->status = task->tk_status; |
| 32 | __entry->flags = task->tk_flags; |
| 33 | ), |
| 34 | |
| 35 | TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d action=%pf", |
| 36 | __entry->task, |
| 37 | __entry->clnt, |
| 38 | __entry->flags, |
| 39 | __entry->runstate, |
| 40 | __entry->status, |
| 41 | __entry->action |
| 42 | ) |
| 43 | ); |
| 44 | |
| 45 | DEFINE_EVENT(rpc_task_running, rpc_task_begin, |
| 46 | |
| 47 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), |
| 48 | |
| 49 | TP_ARGS(clnt, task, action) |
| 50 | |
| 51 | ); |
| 52 | |
| 53 | DEFINE_EVENT(rpc_task_running, rpc_task_run_action, |
| 54 | |
| 55 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), |
| 56 | |
| 57 | TP_ARGS(clnt, task, action) |
| 58 | |
| 59 | ); |
| 60 | |
| 61 | DEFINE_EVENT(rpc_task_running, rpc_task_complete, |
| 62 | |
| 63 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), |
| 64 | |
| 65 | TP_ARGS(clnt, task, action) |
| 66 | |
| 67 | ); |
| 68 | |
| 69 | DECLARE_EVENT_CLASS(rpc_task_queued, |
| 70 | |
| 71 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), |
| 72 | |
| 73 | TP_ARGS(clnt, task, q), |
| 74 | |
| 75 | TP_STRUCT__entry( |
| 76 | __field(const struct rpc_clnt *, clnt) |
| 77 | __field(const struct rpc_task *, task) |
| 78 | __field(const struct rpc_wait_queue *, queue) |
| 79 | __field(unsigned long, timeout) |
| 80 | __field(unsigned long, runstate) |
| 81 | __field(int, status) |
| 82 | __field(unsigned short, flags) |
| 83 | ), |
| 84 | |
| 85 | TP_fast_assign( |
| 86 | __entry->clnt = clnt; |
| 87 | __entry->task = task; |
| 88 | __entry->queue = q; |
| 89 | __entry->timeout = task->tk_timeout; |
| 90 | __entry->runstate = task->tk_runstate; |
| 91 | __entry->status = task->tk_status; |
| 92 | __entry->flags = task->tk_flags; |
| 93 | ), |
| 94 | |
| 95 | TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s", |
| 96 | __entry->task, |
| 97 | __entry->clnt, |
| 98 | __entry->flags, |
| 99 | __entry->runstate, |
| 100 | __entry->status, |
| 101 | __entry->timeout, |
| 102 | rpc_qname(__entry->queue) |
| 103 | ) |
| 104 | ); |
| 105 | |
| 106 | DEFINE_EVENT(rpc_task_queued, rpc_task_sleep, |
| 107 | |
| 108 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), |
| 109 | |
| 110 | TP_ARGS(clnt, task, q) |
| 111 | |
| 112 | ); |
| 113 | |
| 114 | DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup, |
| 115 | |
| 116 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), |
| 117 | |
| 118 | TP_ARGS(clnt, task, q) |
| 119 | |
| 120 | ); |
| 121 | |
| 122 | #endif /* _TRACE_SUNRPC_H */ |
| 123 | |
| 124 | #include <trace/define_trace.h> |