xref: /openbmc/linux/net/smc/smc_tracepoint.h (revision 67559900)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #undef TRACE_SYSTEM
4 #define TRACE_SYSTEM smc
5 
6 #if !defined(_TRACE_SMC_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_SMC_H
8 
9 #include <linux/ipv6.h>
10 #include <linux/tcp.h>
11 #include <linux/tracepoint.h>
12 #include <net/ipv6.h>
13 #include "smc.h"
14 #include "smc_core.h"
15 
16 TRACE_EVENT(smc_switch_to_fallback,
17 
18 	    TP_PROTO(const struct smc_sock *smc, int fallback_rsn),
19 
20 	    TP_ARGS(smc, fallback_rsn),
21 
22 	    TP_STRUCT__entry(
23 			     __field(const void *, sk)
24 			     __field(const void *, clcsk)
25 			     __field(int, fallback_rsn)
26 	    ),
27 
28 	    TP_fast_assign(
29 			   const struct sock *sk = &smc->sk;
30 			   const struct sock *clcsk = smc->clcsock->sk;
31 
32 			   __entry->sk = sk;
33 			   __entry->clcsk = clcsk;
34 			   __entry->fallback_rsn = fallback_rsn;
35 	    ),
36 
37 	    TP_printk("sk=%p clcsk=%p fallback_rsn=%d",
38 		      __entry->sk, __entry->clcsk, __entry->fallback_rsn)
39 );
40 
41 DECLARE_EVENT_CLASS(smc_msg_event,
42 
43 		    TP_PROTO(const struct smc_sock *smc, size_t len),
44 
45 		    TP_ARGS(smc, len),
46 
47 		    TP_STRUCT__entry(
48 				     __field(const void *, smc)
49 				     __field(size_t, len)
50 				     __string(name, smc->conn.lnk->ibname)
51 		    ),
52 
53 		    TP_fast_assign(
54 				   __entry->smc = smc;
55 				   __entry->len = len;
56 				   __assign_str(name, smc->conn.lnk->ibname);
57 		    ),
58 
59 		    TP_printk("smc=%p len=%zu dev=%s",
60 			      __entry->smc, __entry->len,
61 			      __get_str(name))
62 );
63 
64 DEFINE_EVENT(smc_msg_event, smc_tx_sendmsg,
65 
66 	     TP_PROTO(const struct smc_sock *smc, size_t len),
67 
68 	     TP_ARGS(smc, len)
69 );
70 
71 DEFINE_EVENT(smc_msg_event, smc_rx_recvmsg,
72 
73 	     TP_PROTO(const struct smc_sock *smc, size_t len),
74 
75 	     TP_ARGS(smc, len)
76 );
77 
78 TRACE_EVENT(smcr_link_down,
79 
80 	    TP_PROTO(const struct smc_link *lnk, void *location),
81 
82 	    TP_ARGS(lnk, location),
83 
84 	    TP_STRUCT__entry(
85 			     __field(const void *, lnk)
86 			     __field(const void *, lgr)
87 			     __field(int, state)
88 			     __string(name, lnk->ibname)
89 			     __field(void *, location)
90 	    ),
91 
92 	    TP_fast_assign(
93 			   const struct smc_link_group *lgr = lnk->lgr;
94 
95 			   __entry->lnk = lnk;
96 			   __entry->lgr = lgr;
97 			   __entry->state = lnk->state;
98 			   __assign_str(name, lnk->ibname);
99 			   __entry->location = location;
100 	    ),
101 
102 	    TP_printk("lnk=%p lgr=%p state=%d dev=%s location=%pS",
103 		      __entry->lnk, __entry->lgr,
104 		      __entry->state, __get_str(name),
105 		      __entry->location)
106 );
107 
108 #endif /* _TRACE_SMC_H */
109 
110 #undef TRACE_INCLUDE_PATH
111 #define TRACE_INCLUDE_PATH .
112 
113 #undef TRACE_INCLUDE_FILE
114 #define TRACE_INCLUDE_FILE smc_tracepoint
115 
116 #include <trace/define_trace.h>
117