c825f8b5d1fdef36da5e15ec658721cf0b76cd6f
[lttng-modules.git] / instrumentation / events / lttng-module / rpc.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM rpc
4
5 #if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_RPC_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/sunrpc/sched.h>
10 #include <linux/sunrpc/clnt.h>
11
12 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
13
14 TP_PROTO(struct rpc_task *task),
15
16 TP_ARGS(task),
17
18 TP_FIELDS(
19 ctf_integer_hex(const struct rpc_task *, task, task)
20 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
21 ctf_integer(int, status, task->tk_status)
22 )
23 )
24
25 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
26 TP_PROTO(struct rpc_task *task),
27
28 TP_ARGS(task)
29 )
30
31 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
32 TP_PROTO(struct rpc_task *task),
33
34 TP_ARGS(task)
35 )
36
37 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
38 LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
39 TP_PROTO(const struct rpc_task *task),
40
41 TP_ARGS(task),
42
43 TP_FIELDS(
44 ctf_integer_hex(const struct rpc_task *, task, task)
45 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
46 ctf_integer(int, status, task->tk_status)
47 )
48 )
49
50 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
51
52 TP_PROTO(const struct rpc_task *task, const void *action),
53
54 TP_ARGS(task, action),
55
56 TP_FIELDS(
57 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
58 ctf_integer_hex(const struct rpc_task *, task, task)
59 ctf_integer_hex(const void *, action, action)
60 ctf_integer(unsigned long, runstate, task->tk_runstate)
61 ctf_integer(int, status, task->tk_status)
62 ctf_integer(unsigned short, flags, task->tk_flags)
63 )
64 )
65
66 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
67
68 TP_PROTO(const struct rpc_task *task, const void *action),
69
70 TP_ARGS(task, action)
71 )
72
73 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
74
75 TP_PROTO(const struct rpc_task *task, const void *action),
76
77 TP_ARGS(task, action)
78 )
79
80 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
81
82 TP_PROTO(const struct rpc_task *task, const void *action),
83
84 TP_ARGS(task, action)
85 )
86
87 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
88
89 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
90
91 TP_ARGS(task, q),
92
93 TP_FIELDS(
94 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
95 ctf_integer_hex(const struct rpc_task *, task, task)
96 ctf_integer(unsigned long, timeout, task->tk_timeout)
97 ctf_integer(unsigned long, runstate, task->tk_runstate)
98 ctf_integer(int, status, task->tk_status)
99 ctf_integer(unsigned short, flags, task->tk_flags)
100 ctf_string(q_name, rpc_qname(q))
101 )
102 )
103
104 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
105
106 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
107
108 TP_ARGS(task, q)
109 )
110
111 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
112
113 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
114
115 TP_ARGS(task, q)
116 )
117
118 #else
119 LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
120 TP_PROTO(struct rpc_task *task, int status),
121
122 TP_ARGS(task, status),
123
124 TP_FIELDS(
125 ctf_integer_hex(const struct rpc_task *, task, task)
126 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
127 ctf_integer(int, status, status)
128 )
129 )
130
131 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
132
133 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
134
135 TP_ARGS(clnt, task, action),
136
137 TP_FIELDS(
138 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
139 ctf_integer_hex(const struct rpc_task *, task, task)
140 ctf_integer_hex(const void *, action, action)
141 ctf_integer(unsigned long, runstate, task->tk_runstate)
142 ctf_integer(int, status, task->tk_status)
143 ctf_integer(unsigned short, flags, task->tk_flags)
144 )
145 )
146
147 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
148
149 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
150
151 TP_ARGS(clnt, task, action)
152 )
153
154 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
155
156 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
157
158 TP_ARGS(clnt, task, action)
159 )
160
161 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
162
163 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
164
165 TP_ARGS(clnt, task, action)
166 )
167
168 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
169
170 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
171
172 TP_ARGS(clnt, task, q),
173
174 TP_FIELDS(
175 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
176 ctf_integer_hex(const struct rpc_task *, task, task)
177 ctf_integer(unsigned long, timeout, task->tk_timeout)
178 ctf_integer(unsigned long, runstate, task->tk_runstate)
179 ctf_integer(int, status, task->tk_status)
180 ctf_integer(unsigned short, flags, task->tk_flags)
181 ctf_string(q_name, rpc_qname(q))
182 )
183 )
184
185 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
186
187 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
188
189 TP_ARGS(clnt, task, q)
190 )
191
192 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
193
194 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
195
196 TP_ARGS(clnt, task, q)
197 )
198 #endif
199
200 #endif /* LTTNG_TRACE_RPC_H */
201
202 #include <probes/define_trace.h>
This page took 0.032325 seconds and 3 git commands to generate.