blob: f3673301dea6d9e7b7757634e360cc450abdeee0 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From d11b568681f87c2df6ecb0516d3f16d153f24bd2 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Wed, 9 Jan 2019 14:59:17 -0500
4Subject: [PATCH 7/9] Fix: SUNRPC: Simplify defining common RPC trace events
5 (v5.0)
6
7See upstream commit :
8
9 commit dc5820bd21d84ee34770b0a1e2fca9378f8f7456
10 Author: Chuck Lever <chuck.lever@oracle.com>
11 Date: Wed Dec 19 11:00:16 2018 -0500
12
13 SUNRPC: Simplify defining common RPC trace events
14
15 Clean up, no functional change is expected.
16
17Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
18Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
19
20Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/d11b568681f87c2df6ecb0516d3f16d153f24bd2
21
22Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
23---
24 instrumentation/events/lttng-module/rpc.h | 99 ++++++++++++++++-------
25 1 file changed, 72 insertions(+), 27 deletions(-)
26
27diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h
28index a4ac557..4239280 100644
29--- a/instrumentation/events/lttng-module/rpc.h
30+++ b/instrumentation/events/lttng-module/rpc.h
31@@ -8,7 +8,32 @@
32 #include <linux/sunrpc/sched.h>
33 #include <linux/sunrpc/clnt.h>
34
35-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
36+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
37+LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
38+
39+ TP_PROTO(const struct rpc_task *task),
40+
41+ TP_ARGS(task),
42+
43+ TP_FIELDS(
44+ ctf_integer(unsigned int, task_id, task->tk_pid)
45+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
46+ ctf_integer(int, status, task->tk_status)
47+ )
48+)
49+
50+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
51+ TP_PROTO(const struct rpc_task *task),
52+
53+ TP_ARGS(task)
54+)
55+
56+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
57+ TP_PROTO(const struct rpc_task *task),
58+
59+ TP_ARGS(task)
60+)
61+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
62 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
63
64 TP_PROTO(struct rpc_task *task),
65@@ -21,6 +46,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
66 ctf_integer(int, status, task->tk_status)
67 )
68 )
69+
70+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
71+ TP_PROTO(struct rpc_task *task),
72+
73+ TP_ARGS(task)
74+)
75+
76+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
77+ TP_PROTO(struct rpc_task *task),
78+
79+ TP_ARGS(task)
80+)
81 #else
82 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
83
84@@ -34,7 +71,6 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
85 ctf_integer(int, status, task->tk_status)
86 )
87 )
88-#endif
89
90 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
91 TP_PROTO(struct rpc_task *task),
92@@ -47,8 +83,15 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
93
94 TP_ARGS(task)
95 )
96+#endif
97
98-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
99+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
100+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status,
101+ TP_PROTO(const struct rpc_task *task),
102+
103+ TP_ARGS(task)
104+)
105+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
106 LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
107 TP_PROTO(const struct rpc_task *task),
108
109@@ -60,7 +103,33 @@ LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
110 ctf_integer(int, status, task->tk_status)
111 )
112 )
113+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
114+LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
115+ TP_PROTO(struct rpc_task *task, int status),
116+
117+ TP_ARGS(task, status),
118+
119+ TP_FIELDS(
120+ ctf_integer(unsigned int, task_id, task->tk_pid)
121+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
122+ ctf_integer(int, status, status)
123+ )
124+)
125+#else
126+LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
127+ TP_PROTO(struct rpc_task *task, int status),
128+
129+ TP_ARGS(task, status),
130+
131+ TP_FIELDS(
132+ ctf_integer_hex(const struct rpc_task *, task, task)
133+ ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
134+ ctf_integer(int, status, status)
135+ )
136+)
137+#endif
138
139+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
140 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
141
142 TP_PROTO(const struct rpc_task *task, const void *action),
143@@ -130,18 +199,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
144 )
145
146 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
147-LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
148- TP_PROTO(struct rpc_task *task, int status),
149-
150- TP_ARGS(task, status),
151-
152- TP_FIELDS(
153- ctf_integer(unsigned int, task_id, task->tk_pid)
154- ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
155- ctf_integer(int, status, status)
156- )
157-)
158-
159 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
160
161 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
162@@ -211,18 +268,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
163 )
164
165 #else
166-LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
167- TP_PROTO(struct rpc_task *task, int status),
168-
169- TP_ARGS(task, status),
170-
171- TP_FIELDS(
172- ctf_integer_hex(const struct rpc_task *, task, task)
173- ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
174- ctf_integer(int, status, status)
175- )
176-)
177-
178 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
179
180 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
181--
1822.19.1
183