SUNRPC: Fix up sunrpc trace events
[firefly-linux-kernel-4.4.55.git] / include / trace / events / sunrpc.h
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(unsigned long, timeout)
79                 __field(unsigned long, runstate)
80                 __field(int, status)
81                 __field(unsigned short, flags)
82                 __string(q_name, rpc_qname(q))
83                 ),
84
85         TP_fast_assign(
86                 __entry->clnt = clnt;
87                 __entry->task = task;
88                 __entry->timeout = task->tk_timeout;
89                 __entry->runstate = task->tk_runstate;
90                 __entry->status = task->tk_status;
91                 __entry->flags = task->tk_flags;
92                 __assign_str(q_name, rpc_qname(q));
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                 __get_str(q_name)
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>