aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-03-27 16:53:03 -0400
committerSteven Rostedt <rostedt@goodmis.org>2015-04-08 09:41:08 -0400
commit6ba16eefcdaa8634e1c1d70d5c31b0495c99ab02 (patch)
treeed11bd1d3873fea26d35c61da538d9d9f6549b5e
parent190f0b76ca498789b4dc6acb8c8e9a31b6548f9d (diff)
SUNRPC: Export enums in tracepoints to user space
The enums used in the tracepoints for __print_symbolic() have their names shown in the tracepoint format files. User space tools do not know how to convert those names into their values to be able to convert the binary data. Use TRACE_DEFINE_ENUM() to export the enum names to their values for userspace to do the parsing correctly. Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org Acked-by: Trond Myklebust <trond.myklebust@primarydata.com> Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/trace/events/sunrpc.h62
1 files changed, 44 insertions, 18 deletions
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index b9c1dc6c825a..fd1a02cb3c82 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -179,27 +179,53 @@ DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
179 179
180); 180);
181 181
182/*
183 * First define the enums in the below macros to be exported to userspace
184 * via TRACE_DEFINE_ENUM().
185 */
186#undef EM
187#undef EMe
188#define EM(a, b) TRACE_DEFINE_ENUM(a);
189#define EMe(a, b) TRACE_DEFINE_ENUM(a);
190
191#define RPC_SHOW_SOCKET \
192 EM( SS_FREE, "FREE" ) \
193 EM( SS_UNCONNECTED, "UNCONNECTED" ) \
194 EM( SS_CONNECTING, "CONNECTING," ) \
195 EM( SS_CONNECTED, "CONNECTED," ) \
196 EMe(SS_DISCONNECTING, "DISCONNECTING" )
197
182#define rpc_show_socket_state(state) \ 198#define rpc_show_socket_state(state) \
183 __print_symbolic(state, \ 199 __print_symbolic(state, RPC_SHOW_SOCKET)
184 { SS_FREE, "FREE" }, \ 200
185 { SS_UNCONNECTED, "UNCONNECTED" }, \ 201RPC_SHOW_SOCKET
186 { SS_CONNECTING, "CONNECTING," }, \ 202
187 { SS_CONNECTED, "CONNECTED," }, \ 203#define RPC_SHOW_SOCK \
188 { SS_DISCONNECTING, "DISCONNECTING" }) 204 EM( TCP_ESTABLISHED, "ESTABLISHED" ) \
205 EM( TCP_SYN_SENT, "SYN_SENT" ) \
206 EM( TCP_SYN_RECV, "SYN_RECV" ) \
207 EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \
208 EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \
209 EM( TCP_TIME_WAIT, "TIME_WAIT" ) \
210 EM( TCP_CLOSE, "CLOSE" ) \
211 EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \
212 EM( TCP_LAST_ACK, "LAST_ACK" ) \
213 EM( TCP_LISTEN, "LISTEN" ) \
214 EMe( TCP_CLOSING, "CLOSING" )
189 215
190#define rpc_show_sock_state(state) \ 216#define rpc_show_sock_state(state) \
191 __print_symbolic(state, \ 217 __print_symbolic(state, RPC_SHOW_SOCK)
192 { TCP_ESTABLISHED, "ESTABLISHED" }, \ 218
193 { TCP_SYN_SENT, "SYN_SENT" }, \ 219RPC_SHOW_SOCK
194 { TCP_SYN_RECV, "SYN_RECV" }, \ 220
195 { TCP_FIN_WAIT1, "FIN_WAIT1" }, \ 221/*
196 { TCP_FIN_WAIT2, "FIN_WAIT2" }, \ 222 * Now redefine the EM() and EMe() macros to map the enums to the strings
197 { TCP_TIME_WAIT, "TIME_WAIT" }, \ 223 * that will be printed in the output.
198 { TCP_CLOSE, "CLOSE" }, \ 224 */
199 { TCP_CLOSE_WAIT, "CLOSE_WAIT" }, \ 225#undef EM
200 { TCP_LAST_ACK, "LAST_ACK" }, \ 226#undef EMe
201 { TCP_LISTEN, "LISTEN" }, \ 227#define EM(a, b) {a, b},
202 { TCP_CLOSING, "CLOSING" }) 228#define EMe(a, b) {a, b}
203 229
204DECLARE_EVENT_CLASS(xs_socket_event, 230DECLARE_EVENT_CLASS(xs_socket_event,
205 231