Cleanup: move to kernel style SPDX license identifiers
[lttng-modules.git] / instrumentation / events / lttng-module / rpc.h
CommitLineData
9f36eaed 1/* SPDX-License-Identifier: GPL-2.0 */
b87700e3 2#undef TRACE_SYSTEM
9bbf98da 3#define TRACE_SYSTEM rpc
b87700e3 4
9bbf98da
MD
5#if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ)
6#define LTTNG_TRACE_RPC_H
b87700e3 7
6ec43db8 8#include <probes/lttng-tracepoint-event.h>
b87700e3
AG
9#include <linux/sunrpc/sched.h>
10#include <linux/sunrpc/clnt.h>
b87700e3 11
3bc29f0a 12LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
b87700e3
AG
13
14 TP_PROTO(struct rpc_task *task),
15
16 TP_ARGS(task),
17
f127e61e 18 TP_FIELDS(
fa91fcac
MD
19 ctf_integer_hex(const struct rpc_task *, task, task)
20 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
f127e61e
MD
21 ctf_integer(int, status, task->tk_status)
22 )
b87700e3
AG
23)
24
3bc29f0a 25LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
b87700e3
AG
26 TP_PROTO(struct rpc_task *task),
27
28 TP_ARGS(task)
29)
30
3bc29f0a 31LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
b87700e3
AG
32 TP_PROTO(struct rpc_task *task),
33
34 TP_ARGS(task)
35)
36
0f891764
MJ
37#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
38LTTNG_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
50LTTNG_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
66LTTNG_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
73LTTNG_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
80LTTNG_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
87LTTNG_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
104LTTNG_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
111LTTNG_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
3bc29f0a 119LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
b87700e3
AG
120 TP_PROTO(struct rpc_task *task, int status),
121
122 TP_ARGS(task, status),
123
f127e61e 124 TP_FIELDS(
fa91fcac
MD
125 ctf_integer_hex(const struct rpc_task *, task, task)
126 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
f127e61e
MD
127 ctf_integer(int, status, status)
128 )
b87700e3
AG
129)
130
3bc29f0a 131LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
b87700e3
AG
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
f127e61e 137 TP_FIELDS(
fa91fcac
MD
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)
f127e61e
MD
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 )
b87700e3
AG
145)
146
3bc29f0a 147LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
b87700e3
AG
148
149 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
150
151 TP_ARGS(clnt, task, action)
b87700e3
AG
152)
153
3bc29f0a 154LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
b87700e3
AG
155
156 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
157
158 TP_ARGS(clnt, task, action)
b87700e3
AG
159)
160
3bc29f0a 161LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
b87700e3
AG
162
163 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
164
165 TP_ARGS(clnt, task, action)
b87700e3
AG
166)
167
3bc29f0a 168LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
b87700e3
AG
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
f127e61e 174 TP_FIELDS(
fa91fcac
MD
175 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
176 ctf_integer_hex(const struct rpc_task *, task, task)
f127e61e
MD
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 )
b87700e3
AG
183)
184
3bc29f0a 185LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
b87700e3
AG
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)
b87700e3
AG
190)
191
3bc29f0a 192LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
b87700e3
AG
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)
b87700e3 197)
0f891764 198#endif
b87700e3 199
9bbf98da 200#endif /* LTTNG_TRACE_RPC_H */
b87700e3 201
6ec43db8 202#include <probes/define_trace.h>
This page took 0.039004 seconds and 4 git commands to generate.