1 From d11b568681f87c2df6ecb0516d3f16d153f24bd2 Mon Sep 17 00:00:00 2001
2 From: Michael Jeanson <mjeanson@efficios.com>
3 Date: Wed, 9 Jan 2019 14:59:17 -0500
4 Subject: [PATCH 7/9] Fix: SUNRPC: Simplify defining common RPC trace events
9 commit dc5820bd21d84ee34770b0a1e2fca9378f8f7456
10 Author: Chuck Lever <chuck.lever@oracle.com>
11 Date: Wed Dec 19 11:00:16 2018 -0500
13 SUNRPC: Simplify defining common RPC trace events
15 Clean up, no functional change is expected.
17 Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
18 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
20 Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/d11b568681f87c2df6ecb0516d3f16d153f24bd2
22 Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
24 instrumentation/events/lttng-module/rpc.h | 99 ++++++++++++++++-------
25 1 file changed, 72 insertions(+), 27 deletions(-)
27 diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h
28 index a4ac557..4239280 100644
29 --- a/instrumentation/events/lttng-module/rpc.h
30 +++ b/instrumentation/events/lttng-module/rpc.h
32 #include <linux/sunrpc/sched.h>
33 #include <linux/sunrpc/clnt.h>
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,
39 + TP_PROTO(const struct rpc_task *task),
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)
50 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
51 + TP_PROTO(const struct rpc_task *task),
56 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
57 + TP_PROTO(const struct rpc_task *task),
61 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
62 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
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)
70 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
71 + TP_PROTO(struct rpc_task *task),
76 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
77 + TP_PROTO(struct rpc_task *task),
82 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
84 @@ -34,7 +71,6 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
85 ctf_integer(int, status, task->tk_status)
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,
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),
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),
109 @@ -60,7 +103,33 @@ LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
110 ctf_integer(int, status, task->tk_status)
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),
117 + TP_ARGS(task, status),
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)
126 +LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
127 + TP_PROTO(struct rpc_task *task, int status),
129 + TP_ARGS(task, status),
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)
139 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
140 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
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,
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),
150 - TP_ARGS(task, status),
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)
159 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
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,
166 -LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
167 - TP_PROTO(struct rpc_task *task, int status),
169 - TP_ARGS(task, status),
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)
178 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
180 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),