summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-modules/0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch
blob: f3673301dea6d9e7b7757634e360cc450abdeee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
From d11b568681f87c2df6ecb0516d3f16d153f24bd2 Mon Sep 17 00:00:00 2001
From: Michael Jeanson <mjeanson@efficios.com>
Date: Wed, 9 Jan 2019 14:59:17 -0500
Subject: [PATCH 7/9] Fix: SUNRPC: Simplify defining common RPC trace events
 (v5.0)

See upstream commit :

  commit dc5820bd21d84ee34770b0a1e2fca9378f8f7456
  Author: Chuck Lever <chuck.lever@oracle.com>
  Date:   Wed Dec 19 11:00:16 2018 -0500

    SUNRPC: Simplify defining common RPC trace events

    Clean up, no functional change is expected.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/d11b568681f87c2df6ecb0516d3f16d153f24bd2

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 instrumentation/events/lttng-module/rpc.h | 99 ++++++++++++++++-------
 1 file changed, 72 insertions(+), 27 deletions(-)

diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h
index a4ac557..4239280 100644
--- a/instrumentation/events/lttng-module/rpc.h
+++ b/instrumentation/events/lttng-module/rpc.h
@@ -8,7 +8,32 @@
 #include <linux/sunrpc/sched.h>
 #include <linux/sunrpc/clnt.h>
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
+
+	TP_PROTO(const struct rpc_task *task),
+
+	TP_ARGS(task),
+
+	TP_FIELDS(
+		ctf_integer(unsigned int, task_id, task->tk_pid)
+		ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
+		ctf_integer(int, status, task->tk_status)
+	)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
+	TP_PROTO(const struct rpc_task *task),
+
+	TP_ARGS(task)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
+	TP_PROTO(const struct rpc_task *task),
+
+	TP_ARGS(task)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
 
 	TP_PROTO(struct rpc_task *task),
@@ -21,6 +46,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
 		ctf_integer(int, status, task->tk_status)
 	)
 )
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
+	TP_PROTO(struct rpc_task *task),
+
+	TP_ARGS(task)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
+	TP_PROTO(struct rpc_task *task),
+
+	TP_ARGS(task)
+)
 #else
 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
 
@@ -34,7 +71,6 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
 		ctf_integer(int, status, task->tk_status)
 	)
 )
-#endif
 
 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
 	TP_PROTO(struct rpc_task *task),
@@ -47,8 +83,15 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
 
 	TP_ARGS(task)
 )
+#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status,
+	TP_PROTO(const struct rpc_task *task),
+
+	TP_ARGS(task)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
 LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
 	TP_PROTO(const struct rpc_task *task),
 
@@ -60,7 +103,33 @@ LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
 		ctf_integer(int, status, task->tk_status)
 	)
 )
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
+	TP_PROTO(struct rpc_task *task, int status),
+
+	TP_ARGS(task, status),
+
+	TP_FIELDS(
+		ctf_integer(unsigned int, task_id, task->tk_pid)
+		ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
+		ctf_integer(int, status, status)
+	)
+)
+#else
+LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
+	TP_PROTO(struct rpc_task *task, int status),
+
+	TP_ARGS(task, status),
+
+	TP_FIELDS(
+		ctf_integer_hex(const struct rpc_task *, task, task)
+		ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
+		ctf_integer(int, status, status)
+	)
+)
+#endif
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
 
 	TP_PROTO(const struct rpc_task *task, const void *action),
@@ -130,18 +199,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
 )
 
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
-LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
-	TP_PROTO(struct rpc_task *task, int status),
-
-	TP_ARGS(task, status),
-
-	TP_FIELDS(
-		ctf_integer(unsigned int, task_id, task->tk_pid)
-		ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
-		ctf_integer(int, status, status)
-	)
-)
-
 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
 
 	TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
@@ -211,18 +268,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
 )
 
 #else
-LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
-	TP_PROTO(struct rpc_task *task, int status),
-
-	TP_ARGS(task, status),
-
-	TP_FIELDS(
-		ctf_integer_hex(const struct rpc_task *, task, task)
-		ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
-		ctf_integer(int, status, status)
-	)
-)
-
 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
 
 	TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
-- 
2.19.1