1 /* SPDX-License-Identifier: GPL-2.0 */
4 #define TRACE_SYSTEM smc
6 #if !defined(_TRACE_SMC_H) || defined(TRACE_HEADER_MULTI_READ)
9 #include <linux/ipv6.h>
10 #include <linux/tcp.h>
11 #include <linux/tracepoint.h>
16 TRACE_EVENT(smc_switch_to_fallback,
18 TP_PROTO(const struct smc_sock *smc, int fallback_rsn),
20 TP_ARGS(smc, fallback_rsn),
23 __field(const void *, sk)
24 __field(const void *, clcsk)
25 __field(u64, net_cookie)
26 __field(int, fallback_rsn)
30 const struct sock *sk = &smc->sk;
31 const struct sock *clcsk = smc->clcsock->sk;
34 __entry->clcsk = clcsk;
35 __entry->net_cookie = sock_net(sk)->net_cookie;
36 __entry->fallback_rsn = fallback_rsn;
39 TP_printk("sk=%p clcsk=%p net=%llu fallback_rsn=%d",
40 __entry->sk, __entry->clcsk,
41 __entry->net_cookie, __entry->fallback_rsn)
44 DECLARE_EVENT_CLASS(smc_msg_event,
46 TP_PROTO(const struct smc_sock *smc, size_t len),
51 __field(const void *, smc)
52 __field(u64, net_cookie)
54 __string(name, smc->conn.lnk->ibname)
58 const struct sock *sk = &smc->sk;
61 __entry->net_cookie = sock_net(sk)->net_cookie;
63 __assign_str(name, smc->conn.lnk->ibname);
66 TP_printk("smc=%p net=%llu len=%zu dev=%s",
67 __entry->smc, __entry->net_cookie,
68 __entry->len, __get_str(name))
71 DEFINE_EVENT(smc_msg_event, smc_tx_sendmsg,
73 TP_PROTO(const struct smc_sock *smc, size_t len),
78 DEFINE_EVENT(smc_msg_event, smc_rx_recvmsg,
80 TP_PROTO(const struct smc_sock *smc, size_t len),
85 TRACE_EVENT(smcr_link_down,
87 TP_PROTO(const struct smc_link *lnk, void *location),
89 TP_ARGS(lnk, location),
92 __field(const void *, lnk)
93 __field(const void *, lgr)
94 __field(u64, net_cookie)
96 __string(name, lnk->ibname)
97 __field(void *, location)
101 const struct smc_link_group *lgr = lnk->lgr;
105 __entry->net_cookie = lgr->net->net_cookie;
106 __entry->state = lnk->state;
107 __assign_str(name, lnk->ibname);
108 __entry->location = location;
111 TP_printk("lnk=%p lgr=%p net=%llu state=%d dev=%s location=%pS",
112 __entry->lnk, __entry->lgr, __entry->net_cookie,
113 __entry->state, __get_str(name),
117 #endif /* _TRACE_SMC_H */
119 #undef TRACE_INCLUDE_PATH
120 #define TRACE_INCLUDE_PATH .
122 #undef TRACE_INCLUDE_FILE
123 #define TRACE_INCLUDE_FILE smc_tracepoint
125 #include <trace/define_trace.h>