xref: /freebsd/sys/netinet/sctp_kdtrace.c (revision 671d68fad961f791f120de809b4cc9479717c21b)
1*671d68faSMark Johnston /*-
2*671d68faSMark Johnston  * SPDX-License-Identifier: BSD-3-Clause
3*671d68faSMark Johnston  *
4*671d68faSMark Johnston  * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
5*671d68faSMark Johnston  * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
6*671d68faSMark Johnston  *
7*671d68faSMark Johnston  * Redistribution and use in source and binary forms, with or without
8*671d68faSMark Johnston  * modification, are permitted provided that the following conditions are met:
9*671d68faSMark Johnston  *
10*671d68faSMark Johnston  * a) Redistributions of source code must retain the above copyright notice,
11*671d68faSMark Johnston  *    this list of conditions and the following disclaimer.
12*671d68faSMark Johnston  *
13*671d68faSMark Johnston  * b) Redistributions in binary form must reproduce the above copyright
14*671d68faSMark Johnston  *    notice, this list of conditions and the following disclaimer in
15*671d68faSMark Johnston  *    the documentation and/or other materials provided with the distribution.
16*671d68faSMark Johnston  *
17*671d68faSMark Johnston  * c) Neither the name of Cisco Systems, Inc. nor the names of its
18*671d68faSMark Johnston  *    contributors may be used to endorse or promote products derived
19*671d68faSMark Johnston  *    from this software without specific prior written permission.
20*671d68faSMark Johnston  *
21*671d68faSMark Johnston  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22*671d68faSMark Johnston  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23*671d68faSMark Johnston  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24*671d68faSMark Johnston  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25*671d68faSMark Johnston  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26*671d68faSMark Johnston  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27*671d68faSMark Johnston  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28*671d68faSMark Johnston  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29*671d68faSMark Johnston  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30*671d68faSMark Johnston  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31*671d68faSMark Johnston  * THE POSSIBILITY OF SUCH DAMAGE.
32*671d68faSMark Johnston  */
33*671d68faSMark Johnston 
34*671d68faSMark Johnston #include <sys/cdefs.h>
35*671d68faSMark Johnston __FBSDID("$FreeBSD$");
36*671d68faSMark Johnston 
37*671d68faSMark Johnston #include <sys/param.h>
38*671d68faSMark Johnston #include <sys/kernel.h>
39*671d68faSMark Johnston #include <sys/sdt.h>
40*671d68faSMark Johnston 
41*671d68faSMark Johnston SDT_PROVIDER_DECLARE(sctp);
42*671d68faSMark Johnston 
43*671d68faSMark Johnston /********************************************************/
44*671d68faSMark Johnston /* Cwnd probe - tracks changes in the congestion window on a netp */
45*671d68faSMark Johnston /********************************************************/
46*671d68faSMark Johnston /* Initial */
47*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, init,
48*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
49*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
50*671d68faSMark Johnston 				 * port number of remote in network byte
51*671d68faSMark Johnston 				 * order. */
52*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
53*671d68faSMark Johnston 				 * changing */
54*671d68faSMark Johnston     "int",			/* The old value of the cwnd */
55*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
56*671d68faSMark Johnston 
57*671d68faSMark Johnston /* ACK-INCREASE */
58*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, ack,
59*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
60*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
61*671d68faSMark Johnston 				 * port number of remote in network byte
62*671d68faSMark Johnston 				 * order. */
63*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
64*671d68faSMark Johnston 				 * changing */
65*671d68faSMark Johnston     "int",			/* The old value of the cwnd */
66*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
67*671d68faSMark Johnston 
68*671d68faSMark Johnston /* ACK-INCREASE */
69*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, rttvar,
70*671d68faSMark Johnston     "uint64_t",			/* The Vtag << 32 | localport << 16 |
71*671d68faSMark Johnston 				 * remoteport */
72*671d68faSMark Johnston     "uint64_t",			/* obw | nbw */
73*671d68faSMark Johnston     "uint64_t",			/* bwrtt | newrtt */
74*671d68faSMark Johnston     "uint64_t",			/* flight */
75*671d68faSMark Johnston     "uint64_t");		/* (cwnd << 32) | point << 16 | retval(0/1) */
76*671d68faSMark Johnston 
77*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, rttstep,
78*671d68faSMark Johnston     "uint64_t",			/* The Vtag << 32 | localport << 16 |
79*671d68faSMark Johnston 				 * remoteport */
80*671d68faSMark Johnston     "uint64_t",			/* obw | nbw */
81*671d68faSMark Johnston     "uint64_t",			/* bwrtt | newrtt */
82*671d68faSMark Johnston     "uint64_t",			/* flight */
83*671d68faSMark Johnston     "uint64_t");		/* (cwnd << 32) | point << 16 | retval(0/1) */
84*671d68faSMark Johnston 
85*671d68faSMark Johnston /* FastRetransmit-DECREASE */
86*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, fr,
87*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
88*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
89*671d68faSMark Johnston 				 * port number of remote in network byte
90*671d68faSMark Johnston 				 * order. */
91*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
92*671d68faSMark Johnston 				 * changing */
93*671d68faSMark Johnston     "int",			/* The old value of the cwnd */
94*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
95*671d68faSMark Johnston 
96*671d68faSMark Johnston /* TimeOut-DECREASE */
97*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, to,
98*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
99*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
100*671d68faSMark Johnston 				 * port number of remote in network byte
101*671d68faSMark Johnston 				 * order. */
102*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
103*671d68faSMark Johnston 				 * changing */
104*671d68faSMark Johnston     "int",			/* The old value of the cwnd */
105*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
106*671d68faSMark Johnston 
107*671d68faSMark Johnston /* BurstLimit-DECREASE */
108*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, bl,
109*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
110*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
111*671d68faSMark Johnston 				 * port number of remote in network byte
112*671d68faSMark Johnston 				 * order. */
113*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
114*671d68faSMark Johnston 				 * changing */
115*671d68faSMark Johnston     "int",			/* The old value of the cwnd */
116*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
117*671d68faSMark Johnston 
118*671d68faSMark Johnston /* ECN-DECREASE */
119*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, ecn,
120*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
121*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
122*671d68faSMark Johnston 				 * port number of remote in network byte
123*671d68faSMark Johnston 				 * order. */
124*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
125*671d68faSMark Johnston 				 * changing */
126*671d68faSMark Johnston     "int",			/* The old value of the cwnd */
127*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
128*671d68faSMark Johnston 
129*671d68faSMark Johnston /* PacketDrop-DECREASE */
130*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, cwnd, net, pd,
131*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
132*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
133*671d68faSMark Johnston 				 * port number of remote in network byte
134*671d68faSMark Johnston 				 * order. */
135*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
136*671d68faSMark Johnston 				 * changing */
137*671d68faSMark Johnston     "int",			/* The old value of the cwnd */
138*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
139*671d68faSMark Johnston 
140*671d68faSMark Johnston /********************************************************/
141*671d68faSMark Johnston /* Rwnd probe - tracks changes in the receiver window for an assoc */
142*671d68faSMark Johnston /********************************************************/
143*671d68faSMark Johnston SDT_PROBE_DEFINE4(sctp, rwnd, assoc, val,
144*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
145*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
146*671d68faSMark Johnston 				 * port number of remote in network byte
147*671d68faSMark Johnston 				 * order. */
148*671d68faSMark Johnston     "int",			/* The up/down amount */
149*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
150*671d68faSMark Johnston 
151*671d68faSMark Johnston /********************************************************/
152*671d68faSMark Johnston /* flight probe - tracks changes in the flight size on a net or assoc */
153*671d68faSMark Johnston /********************************************************/
154*671d68faSMark Johnston SDT_PROBE_DEFINE5(sctp, flightsize, net, val,
155*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
156*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
157*671d68faSMark Johnston 				 * port number of remote in network byte
158*671d68faSMark Johnston 				 * order. */
159*671d68faSMark Johnston     "uintptr_t",		/* The pointer to the struct sctp_nets *
160*671d68faSMark Johnston 				 * changing */
161*671d68faSMark Johnston     "int",			/* The up/down amount */
162*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
163*671d68faSMark Johnston 
164*671d68faSMark Johnston /********************************************************/
165*671d68faSMark Johnston /* The total flight version */
166*671d68faSMark Johnston /********************************************************/
167*671d68faSMark Johnston SDT_PROBE_DEFINE4(sctp, flightsize, assoc, val,
168*671d68faSMark Johnston     "uint32_t",			/* The Vtag for this end */
169*671d68faSMark Johnston     "uint32_t",			/* The port number of the local side << 16 |
170*671d68faSMark Johnston 				 * port number of remote in network byte
171*671d68faSMark Johnston 				 * order. */
172*671d68faSMark Johnston     "int",			/* The up/down amount */
173*671d68faSMark Johnston     "int");			/* The new value of the cwnd */
174