提交 6ba16eef 编写于 作者: S Steven Rostedt (Red Hat) 提交者: Steven Rostedt

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.orgAcked-by: NTrond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Tested-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 190f0b76
...@@ -179,27 +179,53 @@ DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup, ...@@ -179,27 +179,53 @@ DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
); );
/*
* First define the enums in the below macros to be exported to userspace
* via TRACE_DEFINE_ENUM().
*/
#undef EM
#undef EMe
#define EM(a, b) TRACE_DEFINE_ENUM(a);
#define EMe(a, b) TRACE_DEFINE_ENUM(a);
#define RPC_SHOW_SOCKET \
EM( SS_FREE, "FREE" ) \
EM( SS_UNCONNECTED, "UNCONNECTED" ) \
EM( SS_CONNECTING, "CONNECTING," ) \
EM( SS_CONNECTED, "CONNECTED," ) \
EMe(SS_DISCONNECTING, "DISCONNECTING" )
#define rpc_show_socket_state(state) \ #define rpc_show_socket_state(state) \
__print_symbolic(state, \ __print_symbolic(state, RPC_SHOW_SOCKET)
{ SS_FREE, "FREE" }, \
{ SS_UNCONNECTED, "UNCONNECTED" }, \ RPC_SHOW_SOCKET
{ SS_CONNECTING, "CONNECTING," }, \
{ SS_CONNECTED, "CONNECTED," }, \ #define RPC_SHOW_SOCK \
{ SS_DISCONNECTING, "DISCONNECTING" }) EM( TCP_ESTABLISHED, "ESTABLISHED" ) \
EM( TCP_SYN_SENT, "SYN_SENT" ) \
EM( TCP_SYN_RECV, "SYN_RECV" ) \
EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \
EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \
EM( TCP_TIME_WAIT, "TIME_WAIT" ) \
EM( TCP_CLOSE, "CLOSE" ) \
EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \
EM( TCP_LAST_ACK, "LAST_ACK" ) \
EM( TCP_LISTEN, "LISTEN" ) \
EMe( TCP_CLOSING, "CLOSING" )
#define rpc_show_sock_state(state) \ #define rpc_show_sock_state(state) \
__print_symbolic(state, \ __print_symbolic(state, RPC_SHOW_SOCK)
{ TCP_ESTABLISHED, "ESTABLISHED" }, \
{ TCP_SYN_SENT, "SYN_SENT" }, \ RPC_SHOW_SOCK
{ TCP_SYN_RECV, "SYN_RECV" }, \
{ TCP_FIN_WAIT1, "FIN_WAIT1" }, \ /*
{ TCP_FIN_WAIT2, "FIN_WAIT2" }, \ * Now redefine the EM() and EMe() macros to map the enums to the strings
{ TCP_TIME_WAIT, "TIME_WAIT" }, \ * that will be printed in the output.
{ TCP_CLOSE, "CLOSE" }, \ */
{ TCP_CLOSE_WAIT, "CLOSE_WAIT" }, \ #undef EM
{ TCP_LAST_ACK, "LAST_ACK" }, \ #undef EMe
{ TCP_LISTEN, "LISTEN" }, \ #define EM(a, b) {a, b},
{ TCP_CLOSING, "CLOSING" }) #define EMe(a, b) {a, b}
DECLARE_EVENT_CLASS(xs_socket_event, DECLARE_EVENT_CLASS(xs_socket_event,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册