1215817Srrs/*-
2235828Stuexen * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
3235828Stuexen * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
4215817Srrs *
5215817Srrs * Redistribution and use in source and binary forms, with or without
6215817Srrs * modification, are permitted provided that the following conditions are met:
7215817Srrs *
8215817Srrs * a) Redistributions of source code must retain the above copyright notice,
9228653Stuexen *    this list of conditions and the following disclaimer.
10215817Srrs *
11215817Srrs * b) Redistributions in binary form must reproduce the above copyright
12215817Srrs *    notice, this list of conditions and the following disclaimer in
13228653Stuexen *    the documentation and/or other materials provided with the distribution.
14215817Srrs *
15215817Srrs * c) Neither the name of Cisco Systems, Inc. nor the names of its
16215817Srrs *    contributors may be used to endorse or promote products derived
17215817Srrs *    from this software without specific prior written permission.
18215817Srrs *
19215817Srrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20215817Srrs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21215817Srrs * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22215817Srrs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23215817Srrs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24215817Srrs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25215817Srrs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26215817Srrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27215817Srrs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28215817Srrs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29215817Srrs * THE POSSIBILITY OF SUCH DAMAGE.
30215817Srrs */
31235828Stuexen
32215817Srrs#include <sys/cdefs.h>
33215817Srrs__FBSDID("$FreeBSD$");
34235828Stuexen
35235828Stuexen#ifndef _NETINET_SCTP_DTRACE_DEFINE_H_
36235828Stuexen#define _NETINET_SCTP_DTRACE_DEFINE_H_
37235828Stuexen
38215817Srrs#include "opt_kdtrace.h"
39215817Srrs#include <sys/kernel.h>
40215817Srrs#include <sys/sdt.h>
41215817Srrs
42215817SrrsSDT_PROVIDER_DEFINE(sctp);
43215817Srrs
44215817Srrs/********************************************************/
45215817Srrs/* Cwnd probe - tracks changes in the congestion window on a netp */
46215817Srrs/********************************************************/
47215817Srrs/* Initial */
48260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, init,
49254350Smarkj    "uint32_t",		/* The Vtag for this end */
50254350Smarkj    "uint32_t",		/*
51254350Smarkj			 * The port number of the local side << 16 | port number
52254350Smarkj			 * of remote in network byte order.
53254350Smarkj			 */
54254350Smarkj    "uintptr_t",	/* The pointer to the struct sctp_nets * changing */
55254350Smarkj    "int",		/* The old value of the cwnd */
56254350Smarkj    "int");		/* The new value of the cwnd */
57215817Srrs
58215817Srrs/* ACK-INCREASE */
59260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, ack,
60254350Smarkj    "uint32_t",		/* The Vtag for this end */
61254350Smarkj    "uint32_t",		/*
62254350Smarkj			 * The port number of the local side << 16 | port number
63254350Smarkj			 * of remote in network byte order.
64254350Smarkj			 */
65254350Smarkj    "uintptr_t",	/* The pointer to the struct sctp_nets * changing */
66254350Smarkj    "int",		/* The old value of the cwnd */
67254350Smarkj    "int");		/* The new value of the cwnd */
68215817Srrs
69219057Srrs/* ACK-INCREASE */
70260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, rttvar,
71254350Smarkj    "uint64_t",		/* The Vtag << 32 | localport << 16 | remoteport */
72254350Smarkj    "uint64_t",		/* obw | nbw */
73254350Smarkj    "uint64_t",		/* bwrtt | newrtt */
74254350Smarkj    "uint64_t",		/* flight */
75254350Smarkj    "uint64_t");	/* (cwnd << 32) | point << 16 | retval(0/1) */
76219057Srrs
77260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, rttstep,
78254350Smarkj    "uint64_t",		/* The Vtag << 32 | localport << 16 | remoteport */
79254350Smarkj    "uint64_t",		/* obw | nbw */
80254350Smarkj    "uint64_t",		/* bwrtt | newrtt */
81254350Smarkj    "uint64_t",		/* flight */
82254350Smarkj    "uint64_t");	/* (cwnd << 32) | point << 16 | retval(0/1) */
83219057Srrs
84215817Srrs/* FastRetransmit-DECREASE */
85260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, fr,
86254350Smarkj    "uint32_t",		/* The Vtag for this end */
87254350Smarkj    "uint32_t",		/*
88254350Smarkj			 * The port number of the local side << 16 | port number
89254350Smarkj			 * of remote in network byte order.
90254350Smarkj			 */
91254350Smarkj    "uintptr_t",	/* The pointer to the struct sctp_nets * changing */
92254350Smarkj    "int",		/* The old value of the cwnd */
93254350Smarkj    "int");		/* The new value of the cwnd */
94215817Srrs
95215817Srrs/* TimeOut-DECREASE */
96260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, to,
97254350Smarkj    "uint32_t",		/* The Vtag for this end */
98254350Smarkj    "uint32_t",		/*
99254350Smarkj			 * The port number of the local side << 16 | port number
100254350Smarkj			 * of remote in network byte order.
101254350Smarkj			 */
102254350Smarkj    "uintptr_t",	/* The pointer to the struct sctp_nets * changing */
103254350Smarkj    "int",		/* The old value of the cwnd */
104254350Smarkj    "int");		/* The new value of the cwnd */
105215817Srrs
106215817Srrs/* BurstLimit-DECREASE */
107260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, bl,
108254350Smarkj    "uint32_t",		/* The Vtag for this end */
109254350Smarkj    "uint32_t",		/*
110254350Smarkj			 * The port number of the local side << 16 | port number
111254350Smarkj			 * of remote in network byte order.
112254350Smarkj			 */
113254350Smarkj    "uintptr_t",	/* The pointer to the struct sctp_nets * changing */
114254350Smarkj    "int",		/* The old value of the cwnd */
115254350Smarkj    "int");		/* The new value of the cwnd */
116215817Srrs
117215817Srrs/* ECN-DECREASE */
118260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, ecn,
119254350Smarkj    "uint32_t",		/* The Vtag for this end */
120254350Smarkj    "uint32_t",		/*
121254350Smarkj			 * The port number of the local side << 16 | port number
122254350Smarkj			 * of remote in network byte order.
123254350Smarkj			 */
124254350Smarkj    "uintptr_t",	/* The pointer to the struct sctp_nets * changing */
125254350Smarkj    "int",		/* The old value of the cwnd */
126254350Smarkj    "int");		/* The new value of the cwnd */
127215817Srrs
128215817Srrs/* PacketDrop-DECREASE */
129260817SavgSDT_PROBE_DEFINE5(sctp, cwnd, net, pd,
130254350Smarkj    "uint32_t",		/* The Vtag for this end */
131254350Smarkj    "uint32_t",		/*
132254350Smarkj			 * The port number of the local side << 16 | port number
133254350Smarkj			 * of remote in network byte order.
134254350Smarkj			 */
135254350Smarkj    "uintptr_t",	/* The pointer to the struct sctp_nets * changing */
136254350Smarkj    "int",		/* The old value of the cwnd */
137254350Smarkj    "int");		/* The new value of the cwnd */
138215817Srrs
139215817Srrs/********************************************************/
140215817Srrs/* Rwnd probe - tracks changes in the receiver window for an assoc */
141215817Srrs/********************************************************/
142260817SavgSDT_PROBE_DEFINE4(sctp, rwnd, assoc, val,
143254350Smarkj    "uint32_t",		/* The Vtag for this end */
144254350Smarkj    "uint32_t",		/*
145254350Smarkj			 * The port number of the local side << 16 | port number
146254350Smarkj			 * of remote in network byte order.
147254350Smarkj			 */
148254350Smarkj    "int",		/* The up/down amount */
149254350Smarkj    "int");		/* The new value of the cwnd */
150215817Srrs
151215817Srrs/********************************************************/
152215817Srrs/* flight probe - tracks changes in the flight size on a net or assoc */
153215817Srrs/********************************************************/
154260817SavgSDT_PROBE_DEFINE5(sctp, flightsize, net, val,
155254350Smarkj    "uint32_t",		/* The Vtag for this end */
156254350Smarkj    "uint32_t",		/*
157254350Smarkj			 * The port number of the local side << 16 | port number
158254350Smarkj			 * of remote in network byte order.
159254350Smarkj			 */
160254350Smarkj    "uintptr_t",        /* The pointer to the struct sctp_nets * changing */
161254350Smarkj    "int",		/* The up/down amount */
162254350Smarkj    "int");		/* The new value of the cwnd */
163254350Smarkj
164215817Srrs/********************************************************/
165215817Srrs/* The total flight version */
166215817Srrs/********************************************************/
167260817SavgSDT_PROBE_DEFINE4(sctp, flightsize, assoc, val,
168254350Smarkj    "uint32_t",		/* The Vtag for this end */
169254350Smarkj    "uint32_t",		/*
170254350Smarkj			 * The port number of the local side << 16 | port number
171254350Smarkj			 * of remote in network byte order.
172254350Smarkj			 */
173254350Smarkj    "int",		/* The up/down amount */
174254350Smarkj    "int");		/* The new value of the cwnd */
175215817Srrs
176215817Srrs#endif
177