X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Frpc.h;h=1f47d6e4a5bb9496574b4f3a524bc7c2c23ff2a4;hb=b9dbdfe2d4fd6d682b2cbcd3f529259aee3d080b;hp=bcaafbc12c084dc365cd9287b95be36d3220d4b7;hpb=9bbf98da13bbaf289ac5787a80325d2e1dd81d0d;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h index bcaafbc1..1f47d6e4 100644 --- a/instrumentation/events/lttng-module/rpc.h +++ b/instrumentation/events/lttng-module/rpc.h @@ -1,33 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #undef TRACE_SYSTEM #define TRACE_SYSTEM rpc #if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ) #define LTTNG_TRACE_RPC_H -#include "../../../probes/lttng-tracepoint-event.h" +#include #include #include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, TP_PROTO(struct rpc_task *task), TP_ARGS(task), - TP_STRUCT__entry( - __field(const struct rpc_task *, task) - __field(const struct rpc_clnt *, clnt) - __field(int, 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, task->tk_status) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - TP_fast_assign( - tp_assign(task, task) - tp_assign(clnt, task->tk_client) - tp_assign(status, task->tk_status) - ), + TP_PROTO(struct rpc_task *task), - TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) + TP_ARGS(task), + + 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, task->tk_status) + ) ) +#endif LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, TP_PROTO(struct rpc_task *task), @@ -41,24 +49,179 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, TP_ARGS(task) ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) +LTTNG_TRACEPOINT_EVENT(rpc_connect_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_CLASS(rpc_task_running, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) + ctf_integer_hex(const void *, action, action) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(task, q), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) + ctf_integer(unsigned long, timeout, task->tk_timeout) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ctf_string(q_name, rpc_qname(q)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(task, q) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(task, q) +) + +#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_STRUCT__entry( - __field(const struct rpc_task *, task) - __field(const struct rpc_clnt *, clnt) - __field(int, 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) + ) +) - TP_fast_assign( - tp_assign(task, task) - tp_assign(clnt, task->tk_client) - tp_assign(status, status) - ), +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) + TP_ARGS(clnt, task, action), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) + ctf_integer_hex(const void *, action, action) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) + ctf_integer(unsigned long, timeout, task->tk_timeout) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ctf_string(q_name, rpc_qname(q)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q) +) + +#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, @@ -67,32 +230,14 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, TP_ARGS(clnt, task, action), - TP_STRUCT__entry( - __field(const struct rpc_clnt *, clnt) - __field(const struct rpc_task *, task) - __field(const void *, action) - __field(unsigned long, runstate) - __field(int, status) - __field(unsigned short, flags) - ), - - TP_fast_assign( - tp_assign(clnt, clnt) - tp_assign(task, task) - tp_assign(action, action) - tp_assign(runstate, task->tk_runstate) - tp_assign(status, task->tk_status) - tp_assign(flags, task->tk_flags) - ), - - TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d action=%pf", - __entry->task, - __entry->clnt, - __entry->flags, - __entry->runstate, - __entry->status, - __entry->action - ) + TP_FIELDS( + ctf_integer_hex(const struct rpc_clnt *, clnt, clnt) + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer_hex(const void *, action, action) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ) ) LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, @@ -100,7 +245,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), TP_ARGS(clnt, task, action) - ) LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, @@ -108,7 +252,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), TP_ARGS(clnt, task, action) - ) LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, @@ -116,7 +259,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), TP_ARGS(clnt, task, action) - ) LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, @@ -125,35 +267,15 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, TP_ARGS(clnt, task, q), - TP_STRUCT__entry( - __field(const struct rpc_clnt *, clnt) - __field(const struct rpc_task *, task) - __field(unsigned long, timeout) - __field(unsigned long, runstate) - __field(int, status) - __field(unsigned short, flags) - __string(q_name, rpc_qname(q)) - ), - - TP_fast_assign( - tp_assign(clnt, clnt) - tp_assign(task, task) - tp_assign(timeout, task->tk_timeout) - tp_assign(runstate, task->tk_runstate) - tp_assign(status, task->tk_status) - tp_assign(flags, task->tk_flags) - tp_strcpy(q_name, rpc_qname(q)) - ), - - TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s", - __entry->task, - __entry->clnt, - __entry->flags, - __entry->runstate, - __entry->status, - __entry->timeout, - __get_str(q_name) - ) + TP_FIELDS( + ctf_integer_hex(const struct rpc_clnt *, clnt, clnt) + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer(unsigned long, timeout, task->tk_timeout) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ctf_string(q_name, rpc_qname(q)) + ) ) LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, @@ -161,7 +283,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), TP_ARGS(clnt, task, q) - ) LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, @@ -169,9 +290,9 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), TP_ARGS(clnt, task, q) - ) +#endif #endif /* LTTNG_TRACE_RPC_H */ -#include "../../../probes/define_trace.h" +#include